[SERVER-38866] Ensure that secondaries correctly pin the stableTimestamp when there are prepared transactions Created: 06/Jan/19 Updated: 29/Oct/23 Resolved: 06/Feb/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | 4.1.8 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Pavithra Vetriselvan | Assignee: | Jason Chan |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | prepare_durability | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Sprint: | Repl 2019-02-11 | ||||||||||||
| Participants: | |||||||||||||
| Linked BF Score: | 50 | ||||||||||||
| Description |
|
We write the prepare oplog entry here, but this only occurs on the primary. On a secondary, the prepareOpTime would be null. This could be a problem on secondaries because the stableTimestamp would always move forward, causing us to possibly commit a transaction before the stableTimestamp. |
| Comments |
| Comment by Githook User [ 06/Feb/19 ] |
|
Author: {'name': 'Jason Chan', 'email': 'jason.chan@10gen.com'}Message: |
| Comment by Githook User [ 06/Feb/19 ] |
|
Author: {'name': 'Jason Chan', 'email': 'jason.chan@10gen.com'}Message: |
| Comment by Jason Chan [ 04/Feb/19 ] |
|
Confirmed with pavithra.vetriselvan that The initial approach is to grab the _finishOpTime and pass it as an optional parameter into commitPreparedTransaction from applyCommitTransaction. For testing, it should be sufficient to confirm the behavior in unit tests with the already existing getFinishOpTimeForTest in transaction_participant.h. CC: judah.schvimer |
| Comment by Siyuan Zhou [ 08/Jan/19 ] |
|
For larger than 16MB project, I guess we still need to track finishTime to know which transactions are active even when stable timestamp doesn't rely on this. |