[SERVER-81524] No-op invocations of setUserWriteBlockMode must await majority confirmation of SystemLastOpTime Created: 28/Sep/23  Updated: 05/Feb/24  Resolved: 31/Oct/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.0-rc0, 6.0.12, 7.0.4

Type: Bug Priority: Major - P3
Reporter: Spencer Jackson Assignee: Spencer Jackson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Duplicate
Assigned Teams:
Server Security
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v7.0, v6.0
Sprint: Security 2023-10-16, Security 2023-10-30, Security 2023-11-13
Participants:
Linked BF Score: 100

 Description   

If setUserWriteBlockMode changes a primary's user write block mode, it will issue a write to a system collection. If the primary's user write block mode disposition is unchanged, then the command is a no-op and no write is issued. Either way, the command doesn't know whether the rest of the replicaset agrees with the local state yet, and so will await majority confirmation of the active Client object's last written OpTime.

Unfortunately, the no-op variant of the command does not advance the OpTime. If an election occurs after the OpTime is stored in the Client but before commit is awaited, waiting will fail with an error. It will not be possible to re-run the command on the same connection, because the OpTime is never advanced.

Instead, if we find that we're eliding writes, we should advance the Client's OpTime using setLastOpToSystemLastOpTime



 Comments   
Comment by Githook User [ 08/Nov/23 ]

Author:

{'name': 'Spencer Jackson', 'email': 'spencer.jackson@mongodb.com', 'username': 'spencerjackson'}

Message: SERVER-81524: No-op invocations of setUserWriteBlockMode must await majority confirmation of SystemLastOpTime

(cherry picked from commit 8cd4489cee257685e748b96443c7b509836f04d4)
(cherry picked from commit 77002e3accf2a264909bf0e492e524512f960fdd)
Branch: v6.0
https://github.com/mongodb/mongo/commit/a0aec0922350088e3b4c6e994733007592c59a00

Comment by Githook User [ 07/Nov/23 ]

Author:

{'name': 'Spencer Jackson', 'email': 'spencer.jackson@mongodb.com', 'username': 'spencerjackson'}

Message: SERVER-81524: No-op invocations of setUserWriteBlockMode must await majority confirmation of SystemLastOpTime

(cherry picked from commit 8cd4489cee257685e748b96443c7b509836f04d4)
Branch: v7.0
https://github.com/mongodb/mongo/commit/77002e3accf2a264909bf0e492e524512f960fdd

Comment by Githook User [ 31/Oct/23 ]

Author:

{'name': 'Spencer Jackson', 'email': 'spencer.jackson@mongodb.com', 'username': 'spencerjackson'}

Message: SERVER-81524: No-op invocations of setUserWriteBlockMode must await majority confirmation of SystemLastOpTime
Branch: master
https://github.com/mongodb/mongo/commit/8cd4489cee257685e748b96443c7b509836f04d4

Generated at Thu Feb 08 06:46:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.