[SERVER-28438] Add keyId field to logicalTime object Created: 22/Mar/17  Updated: 06/Dec/17  Resolved: 28/Mar/17

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

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

Backwards Compatibility: Fully Compatible
Sprint: Sharding 2017-04-17
Participants:

 Description   

The keyId field is populated during the signature generation and is used to uniquely identify the key that was used for it.
This change will add a dummy keyId value and a few tests to verify the new format.

1. add int _keyId

{0}

member to the SignedLogicalTime class, change its c-tor to take a keyId argument.
2. add a static const SignedLogicalTime::kUninitialized for the default constructed
3. change LogicalTimeMetadata::writeToMetadata to write to logicalTime the keyId as

logicalTime: {
    clusterTime: <highest known valid LogicalTime_MEM>
    signature: {
        hash: HMAC SHA1 hash of cluster time for validation,
        keyId: <int>
    }
}

4. change LogicalTimeMetadata::readFromMetadata to parse the keyId
5. add a test to logical_type_Test.cpp to validate that keyId roundtrip works



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

Author:

{u'username': u'jsmulrow', u'name': u'Jack Mulrow', u'email': u'jack.mulrow@mongodb.com'}

Message: SERVER-28438 Add keyId field to logicalTime object
Branch: master
https://github.com/mongodb/mongo/commit/399ba02faf7124d4b4c52f8b7e91f5aeb307ee1b

Comment by Randolph Tan [ 24/Mar/17 ]

lgtm

Comment by Misha Tyulenev [ 24/Mar/17 ]

renctan please take a look and provide the feedback on this approach.

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