[SERVER-52628] Tenant migration recipient can give a false indication to donor about the data being majority committed on recipient replica set. Created: 05/Nov/20  Updated: 29/Oct/23  Resolved: 06/Nov/20

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Bug Priority: Major - P3
Reporter: Suganthi Mani Assignee: Suganthi Mani
Resolution: Fixed Votes: 0
Labels: pm-1791_milestone-B
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-51246 Write a noop into the oplog buffer af... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Repl 2020-11-16
Participants:

 Description   

After SERVER-51246, future result returned by TenantOplogApplier::getNotificationForOpTime() can have recipient ts as Null. This can result in tenant migration recipient giving a false indication to donor about the data being majority committed on recipient replica set. Consider the below case.
1) Tenant oplog applier applies a first batch containing one entry {_id:1} at donor TS(1) for tenant 'foo'. This would result in recipient write, say, TS(11). So, _lastBatchCompletedOpTimes.donorOpTime is TS(1) and _lastBatchCompletedOpTimes.recipientOpTime is TS(11).
2) Tenant oplog applier applies second batch containing one resume token no-op entry {op: n, ..} at donor TS(2). This would result in no recipient writes. So, _lastBatchCompletedOpTimes.donorOpTime is TS(2) and _lastBatchCompletedOpTimes.recipientOpTime is TS(0).
3) Assume, now, recipient gets "recipientSyncData" cmd with returnAfterReachingDonorTimestamp set to TS(2). This results in calling Instance::waitUntilTimestampIsMajorityCommitted(), waits on a null recipient ts returned in the future result.

As a result, we don't make sure all data <= Donor TS(2) is majority committed on replica set.



 Comments   
Comment by Githook User [ 06/Nov/20 ]

Author:

{'name': 'Suganthi Mani', 'email': 'suganthi.mani@mongodb.com', 'username': 'smani87'}

Message: SERVER-52628 Tenant migration recipient no longer gives a false indication to donor about the data being majority committed on recipient replica set.
Branch: master
https://github.com/mongodb/mongo/commit/d6c15c62c4335266dfd30336ae1cf582b84e09ac

Comment by Suganthi Mani [ 05/Nov/20 ]

FYI, Filed the ticket based on this CR conversation

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