Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-49153

Fix the policy used by "errorcodes.py"

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: Internal Code
    • None
    • Fully Compatible
    • Service Arch 2022-06-13, Service Arch 2022-06-27, Service Arch 2022-07-11
    • 1

      The script currently suggests new IDs for logs and assertions:

      (python3-venv) ubuntu@vm:~/mongo$ python buildscripts/errorcodes.py
      ok: True
      next: 8423348
      

      Also, it doesn't check for IDs used by iasserts.

      We should change errorcodes.py to check for IDs used by internal assertions (see here) and modify the script so that it doesn't recommend new IDs unless a ticket number is provided.

      It's recommended to useĀ buildscripts/errorcodes.py to choose new IDs for assertions and ErrorCodes. Internally, the script scans the code for the maximum ID used by all assertions, error codes, and LOGV2 log identifiers. Then it increments the maximum by one and returns it as the recommended ID for new assertions and ErrorCodes.

      However, this approach is very error-prone. It heavily relies on the IDs picked by programmers, and does not follow any of the already defined rules for choosing identifiers (e.g., the LOGV2 documentation for using SERVER ticket numbers to construct log IDs).

      We need to define a clear policy for picking IDs and update errorcodes.py to honor the new policy.

            Assignee:
            alex.li@mongodb.com Alex Li
            Reporter:
            amirsaman.memaripour@mongodb.com Amirsaman Memaripour
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: