[SERVER-64515] Remove claims of prepare behavior from linearizable reads Created: 15/Mar/22 Updated: 22/Jun/23 |
|
| Status: | Open |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Daniel Gottlieb (Inactive) | Assignee: | Backlog - Replication Team |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | repl-shortlist | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Assigned Teams: |
Replication
|
||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
As a premise, 5.0 introduced an optimization for sharded transactions to return to the client after the decision was persisted but before the participating shards commit their local storage transactions. That optimization made it incorrect for linearizable reads to ignore prepare conflicts. I have no evidence we actually change the prepare conflict behavior for linearizable reads, but we do have code that suggests we may have at some point. That code (according to a patch run) can be deleted. |
| Comments |
| Comment by Daniel Gottlieb (Inactive) [ 22/Mar/22 ] |
Yes, I agree that in practice, we do enforce prepared conflicts. Because of the code you linked.
I am also in agreement with this statement. However, because we are (correctly) enforcing prepared conflicts, it's unnecessary to change any prepare conflict configuration to do the oplog write at the end. If we did have some bug where we were ignoring prepare conflicts for linearizable reads, the code I linked would mask the bug instead of letting WT raise an error. |
| Comment by Judah Schvimer [ 21/Mar/22 ] |
|
daniel.gottlieb, does this suggest there is a bug? Linearizable reads do enforce prepare conflicts at read time, as indicated here. The linked code in the description changes that prepare conflict behavior for the oplog write at the end of the operation. |