[SERVER-27749] Integrate LogicalTimeMetadata with metadata processing Created: 19/Jan/17  Updated: 21/Feb/20  Resolved: 07/Mar/17

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 3.5.5

Type: Task Priority: Major - P3
Reporter: Misha Tyulenev Assignee: Randolph Tan
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-27855 Attach all NetworkInterface instances... Closed
depends on SERVER-28158 SnapshotThread should stop using Logi... Closed
is depended on by SERVER-27750 Sharding component LogicalTimeMetadat... Closed
Related
is related to SERVER-46257 OplogFetcher should run LogicalTimeMe... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2017-02-13, Sharding 2017-03-06, Sharding 2017-03-27
Participants:

 Description   

class LogicalClock {
public:
    ...
 
    // sets new time if the newTime > _clusterTime and the newTime passes validation.
    // Return OK if time is updated
    // Returns SignatureDoesNotMatch on signature mismatch.
    Status advanceClusterTime(OperationContext* txn, SignedLogicalTime newTime) {
        // TODO: grab mutex here
 
        if (_lastLogicalTime.getTime() >= newTime.getTime()) {
            return Status::OK();
        }
 
        if (!passesRateLimiter(newTime)) {
            return {ErrorCodes::CannotAdvanceLogicalClock, ""};
        }
 
        if (autoOn) {
            if (!hasEnoughPrivilege(txn)) {
                auto mySignature = _hmacService->sign(newTime.getTime().serialize());
 
                if (mySignature != newTime.getSignature()) {
                    return {ErrorCodes::SignatureDoesNotMatch, ""};
                }
            }
        }
 
        _lastLogicalTime = std::move(newTime);
    }
}

processNewLogicalTime should be added to:

  1. readRequestMetadata() in metadata.cpp
  2. ShardingEgressMetadataHook::readReplyMetadata()

Distribution of the metadata means that its read/written from/to op_command and op_command_reply. This should use LogicalTimeMetadata from SERVER-27748 to append metadata to these places:

  1. ShardingEgressMetadataHook::writeRequestMetadata()
  2. Building command response


 Comments   
Comment by Githook User [ 07/Mar/17 ]

Author:

{u'username': u'renctan', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}

Message: SERVER-27749 Integrate LogicalTimeMetadata

Attach logical time metadata to all outgoing messages and process incoming logical time metadata in mongod
Branch: master
https://github.com/mongodb/mongo/commit/43be7d92a003f075a5130b2eb38175a062d0729d

Comment by Githook User [ 24/Feb/17 ]

Author:

{u'username': u'renctan', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}

Message: SERVER-27749 Refactor ShardingEgressMetadataHook
Branch: master
https://github.com/mongodb/mongo/commit/9301066134ca391c6b0f26a0b535c164f13922ed

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