Details
-
Improvement
-
Resolution: Won't Fix
-
Minor - P4
-
None
-
None
-
None
-
Sharding EMEA
Description
Currently the isEnabled() method in VectorClock is public, because various external places need to know whether or not the vector clock is enabled. It would be better (from a code coupling/cohesion POV) if iEnabled() was only used from within VectorClock class (and closely related classes).
Current uses:
- Minor optimisation (that could probably just be removed) in LogicalTimeMetadataHook::readReplyMetadata().
- Minor optimisation (that could probably just be removed) in appendClusterAndOperationTime().
- Debug assertion in ReplicationCoordinatorImpl::_setMyLastAppliedOpTimeAndWallTime(). This could possibly be moved into a VectorClock::ensureTimeIsNotAheadOfClusterTime(Timestamp) method. (The difficulty is that ReplicationCoordinatorExternalStateMock::getGlobalTimestamp() returns a mocked value.)
- Ensuring that arbiters don't attempt to load $clusterTime signing keys in LogicalTimeValidator::signLogicalTime(). This could be done if the LogicalTimeValidator class was to be internalised inside the VectorClock class (possibly along with other classes that it relies on — in the worst case, the entire $clusterTime signing and key management machinery).