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

upgrade setParameter & getParameter to logv2::LogComponent

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.4.0-rc4, 4.7.0
    • Component/s: Logging
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.4
    • Sprint:
      Service Arch 2020-04-06, Service arch 2020-04-20, Service arch 2020-05-04

      Description

      Adding a logv2::LogComponent::kTest broke the `logComponentV1toV2` for the new logv2-only "test" component. The parse in setParameter generates logger::LogComponent. We shouldn't have to keep logging::LogComponent and logv2::LogComponent in sync. We can convert everything to logv2 and get rid of logComponentV1toV2.

      The jstests/core/set_param1.js breaks specifically from this effect.

       

      From src/mongo/db/commands/parameters.cpp ,

      using logger::LogComponentSetting;
      using logger::parseLogComponentSettings;
      using logv2::LogComponent;
      using logv2::LogSeverity;

      getParameter, which only uses direct properties of logv2::LogComponent, is getting correct logv2 settings.

      But setParameter, which calls logger::parseLogComponentSettings, is going to use the log v1 parser, which can only generate logger::LogComponent settings, and will not be able to set a kTest. Furthermore, it perfoms v1 to v2 conversion by casts which only use the enum numeric codes, so we aren't really regression-checked against misalignments between v1 and v2 LogComponent and LogSeverity enums.

      I recommend unifying the v1 and v2 enums, and getting rid of the V1toV2 helpers in src/mongo/logger/log_version_util.h

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              billy.donahue Billy Donahue
              Reporter:
              billy.donahue Billy Donahue
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: