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

upgrade setParameter & getParameter to logv2::LogComponent

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.4.0-rc4, 4.7.0
    • Affects Version/s: None
    • Component/s: Logging
    • Labels:
      None
    • Fully Compatible
    • ALL
    • v4.4
    • Service Arch 2020-04-06, Service arch 2020-04-20, Service arch 2020-05-04

      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

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

              Created:
              Updated:
              Resolved: