[SERVER-27047] DataReplicator should return ShutdownInProgress when it is shutdown Created: 15/Nov/16  Updated: 07/Dec/16  Resolved: 07/Dec/16

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

Type: Bug Priority: Major - P3
Reporter: Judah Schvimer Assignee: Benety Goh
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
is related to SERVER-27052 Add asynchronous operation support to... Closed
Operating System: ALL
Sprint: Repl 2016-12-12
Participants:
Linked BF Score: 0

 Description   

If doInitialSync terminates because the DataReplicator was shutdown, then it will return the current initial sync status if it has an error:
https://github.com/mongodb/mongo/blob/549c3f4315fd95431a662e7a8eff880f00b1458d/src/mongo/db/repl/data_replicator.cpp#L582-L587
https://github.com/mongodb/mongo/blob/549c3f4315fd95431a662e7a8eff880f00b1458d/src/mongo/db/repl/data_replicator.cpp#L691-L697

Rather than logging the shutdown status, we should log the initial sync status, and return the shutdown status so that the caller can differentiate a termination due to shutdown from a termination due to failure.



 Comments   
Comment by Benety Goh [ 06/Dec/16 ]

The work in SERVER-27052 ensures that DataReplicator returns CallbackCanceled to the caller when DataReplicator is shutdown. A cancellation error status will not cause ReplicationCoordinatorImpl to abort:

https://github.com/mongodb/mongo/blob/e30e39ce1a4a55c46db13ad85f6c1000297ea6ff/src/mongo/db/repl/replication_coordinator_impl.cpp#L603

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