[SERVER-29716] Keystring-encode ResumeTokens to allow bytewise comparisons Created: 19/Jun/17  Updated: 30/Oct/23  Resolved: 09/Oct/17

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 3.6.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Matthew Russotto
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by PYTHON-1372 Avoid or optimize RawBSONDocument usa... Closed
Related
related to JAVA-2592 Force change stream resume token to e... Closed
Backwards Compatibility: Fully Compatible
Sprint: Repl 2017-10-02, Repl 2017-10-23
Participants:
Linked BF Score: 0

 Description   

Change notification ResumeTokens are composed of the logical time timestamp, the fully qualified collection name, and the document key of the changed document. In the initial version, these three components will just be fields of a BSON object, and comparisons inside the server for relative ordering will use BSON's woCompare() function. If instead we keystring-encoded that document, then the ResumeTokens become truly opaque blobs which forces users and drivers not to rely on their current format or try to inspect them. It also could give us a performance win since now the internal comparisons the server must do to put notifications in order can be bytewise comparisons instead of needing woCompare().



 Comments   
Comment by Githook User [ 09/Oct/17 ]

Author:

{'email': 'matthew.russotto@10gen.com', 'name': 'Matthew Russotto', 'username': 'mtrussotto'}

Message: SERVER-29716 Fix unittests for ARM (signed vs unsigned char)
Branch: master
https://github.com/mongodb/mongo/commit/c906f6357d22f66d58e3334868025069c62bd97b

Comment by Matthew Russotto [ 09/Oct/17 ]

Reopening to fix issue with unittests on ARM

Comment by Matthew Russotto [ 05/Oct/17 ]

This relaxes the requirements on the drivers to return the resume token in the same order and with the same UUID format as it is sent from the server.

Comment by Githook User [ 05/Oct/17 ]

Author:

{'email': 'matthew.russotto@10gen.com', 'name': 'Matthew Russotto', 'username': 'mtrussotto'}

Message: SERVER-29716 Keystring-encode ResumeTokens to allow bytewise comparisons
Branch: master
https://github.com/mongodb/mongo/commit/316a341735b2ffd12ee203581ac0f736a6aaef88

Comment by Spencer Brody (Inactive) [ 20/Sep/17 ]

Turns out this is required to work around the fact that some drivers don't preserve field ordering of BSON objects, and thus could re-order the shard key in the resumeToken, which would prevent resumability from working properly.

Comment by Spencer Brody (Inactive) [ 19/Jun/17 ]

This ticket is a nice-to-have and shouldn't be considered a requirement to complete the change notification project.

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