-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Server Programmability
-
Fully Compatible
-
ALL
-
None
-
None
-
None
-
None
-
None
-
None
-
None
There's a subtle effect in ServiceContextTest-based tests, and this is one of them.
The ServerParameterGuard objects, as members of a derived class, aren't created until after the ServiceContext is already made by the base class, so the construction of ServiceContext sees incorrect values for them, and for disaggregatedStorageEnabled in particular.
This flaw hid a bug in the test that was silently affecting us. The ServiceContext has a decoration (sls_log_encryptor_manager_impl) that needs a CMK key list to have been initialized if disaggregatedStorageEnabled is true. Because it wasn't true (by accident) during construction, we got away with not having a CMK key list installed. But we're in a fragile condition here. If we change the init sequence in some subtle way, such as SERVER-135148's moving the makeServiceContext call to setUp, then the fragile dependency manifests as an invalid dereference of an optional.
This is a smart fix to do anyway, but it's needed by SERVER-135148, where ServiceContext is initialized in setUp rather than in constructor.
- is depended on by
-
SERVER-135148 flexible ServiceContextTest initialization
-
- In Code Review
-