New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: MVCC design on replica and replica stream isolation #2018
Conversation
ee77baf
to
ce72a0d
Compare
0b8a813
to
ec07af1
Compare
5937e13
to
aac12e1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few minor comments, otherwise very good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me.
9300055
to
99fe1dd
Compare
99fe1dd
to
4e77a0b
Compare
Quality Gate passedIssues Measures |
@as51340 I will use this as RN: The replication stream is now handled as a local variable for transactions, preventing assertion failures during recovery. |
Co-authored-by: antoniofilipovic <filipovicantonio1998@gmail.com>
Description
Jepsen found a few bugs in replication, this PR fixes two of them.
When the replica recovered completely, on the next txn replication, it expected
replica_stream_
to be already destroyed. There MG_ASSERT failed. Now, the replica stream is created as a local variable for transactions.Another bug is related to the MVCC of the replica. Because REPLICA’s transaction timestamps are contingent on MAIN’s timestamps, resulting in the transaction timestamp counter (used for obtaining the start transaction ID, and commit timestamp ID) staying the same when the READ transaction started, MVCC guarantees were broken. Any time the WRITE transaction would commit before the READ transaction would finish, GC could incorrectly unlink deltas as the WRITE transaction would mark its start timestamp as finished, not knowing that the READ transaction is still in the system. This would result in the replica’s READ query reading two different data snapshots during a single transaction.
[master < Task] PR
CI Testing Labels
Please select the appropriate CI test labels (CI -build=build-name -test=test-suite)
Documentation checklist