[SERVER-39623] Race in rollback_via_refetch_commit_transaction.js Created: 15/Feb/19  Updated: 29/Oct/23  Resolved: 20/Feb/19

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

Type: Bug Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Repl 2019-02-25
Participants:
Linked BF Score: 10

 Description   

The test makes a ReplSetTest with three nodes: Rollback, SyncSource, and TieBreaker. It arranges for a transaction to be prepared and committed on Rollback but not replicated. Then Rollback is stepped down, SyncSource is elected, and Rollback starts syncing from SyncSource. When it tries to roll back its committed transaction it crashes, as expected.

The test informs the ReplSetTest that Rollback is down, then calls ReplSetTest.stop() to stop the other two nodes. Sometimes, by this point, TieBreaker has also crashed, so ReplSetTest.stop() fails, because it expects to reach all up nodes.

Why might TieBreaker crash? It has the opportunity the replicate the commit here, when Rollback is a secondary, TieBreaker can talk to it, and Rollback hasn't crashed yet:

rollbackNode.reconnect(tiebreakerNode);

Disabling chaining won't fix this alone - even after Rollback has stepped down to secondary, TieBreaker could still choose it as a sync source, because it hasn't yet noticed that Rollback is a secondary, and members with chaining disabled don't reconfirm that a sync source candidate is still primary before selecting it.

Consider rewriting as a RollbackTest instead of a ReplSetTest; this may provide better control of when the TieBreaker node is allowed to replicate and from whom.



 Comments   
Comment by Githook User [ 20/Feb/19 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: SERVER-39623 Fix race in rollback_via_refetch_commit_transaction.js
Branch: master
https://github.com/mongodb/mongo/commit/9fe77b9f6f61bc0eda2a51a98d2238017cb5f4d5

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