[SERVER-47207] upgrade setParameter & getParameter to logv2::LogComponent Created: 31/Mar/20  Updated: 29/Oct/23  Resolved: 27/Apr/20

Status: Closed
Project: Core Server
Component/s: Logging
Affects Version/s: None
Fix Version/s: 4.4.0-rc4, 4.7.0

Type: Bug Priority: Major - P3
Reporter: Billy Donahue Assignee: Billy Donahue
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Issue split
split to SERVER-47697 Make logger:: typedefs to logv2::LogS... Closed
split to SERVER-47698 LogSeverity constexpr Closed
split to SERVER-47735 Convert all code to use `logv2` heade... Closed
split to SERVER-47736 Bring LogSeverityLimiter from logger/... Closed
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
Participants:

 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



 Comments   
Comment by Githook User [ 30/Apr/20 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-47207 move parser from logger to db/command

(cherry picked from commit 7f30f053dff852029e2ca50cc2ab181787ca6da6)
Branch: v4.4
https://github.com/mongodb/mongo/commit/cc3a19bcbd166e369086643810e2ac85e0d55889

Comment by Githook User [ 30/Apr/20 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-47207 remove include of parse_log_component_settings.h

(cherry picked from commit 74416ee47807741d5e4c7c5f9ce1ef337bd9795c)
Branch: v4.4
https://github.com/10gen/mongo-enterprise-modules/commit/37f8b64570ed4eb8467b1dea544ca769c27f9600

Comment by Billy Donahue [ 27/Apr/20 ]

backport this and all the commits for all the breakout tickets.

Comment by Billy Donahue [ 27/Apr/20 ]

split-up tickets all resolved.

Comment by Billy Donahue [ 23/Apr/20 ]

moving to blocked while the fanout of subordinate tickets is incrementally committed.

informal completion plan (notes)
https://docs.google.com/document/d/1yke4ZBdw9IULZiAd8mVVibyYRQJm5L4y6PN4L9Iz9AM/edit

Comment by Billy Donahue [ 16/Apr/20 ]

SERVER-47207 logger::{LogComponent,LogSeverity} typedefs to logv2

CR https://mongodbcr.appspot.com/565470001/

Comment by Githook User [ 13/Apr/20 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-47207 move parser from logger to db/command
Branch: master
https://github.com/mongodb/mongo/commit/7f30f053dff852029e2ca50cc2ab181787ca6da6

Comment by Githook User [ 13/Apr/20 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-47207 remove include of parse_log_component_settings.h
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/74416ee47807741d5e4c7c5f9ce1ef337bd9795c

Comment by Billy Donahue [ 10/Apr/20 ]

CR https://mongodbcr.appspot.com/580870003/

Generated at Thu Feb 08 05:13:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.