-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix](merge-on-write) Should update pending delete bitmap KVs in MS w…
…hen no need to calc delete bitmaps in publish phase (#46039) consider the following situation: 1. Txn A acquires the lock, obtains version X to publish, calculates the delete bitmap, writes the pending delete bitmap KVs to the MS, but fails for some reason before committing the transaction in the MS. 2. Txn B acquires the lock, obtains version X to publish, **cleans up the pending delete bitmap KV written by Txn A**, calculates the delete bitmap, **writes its pending delete bitmap KV to the MS**, but also fails for some reason before committing the transaction in the MS. 3. Txn A then reacquires the lock, obtains version X to publish, and notices that neither the version nor the compaction counts have changed. It will skip the process of calculating the delete bitmap and writing the pending delete bitmap KV to the MS #39018 and eventually succeeds in committing the transaction in the MS. In this case, Txn A will save the wrong delete bitmaps(generated by Txn B) in MS and causing correctness problem. To solve the problem, we should still update delete bitmap KVs in MS when we skip the calculation of delete bitmap on BE in publish phase. Also add a defensive check: record `lock_id` when writing pending delete bitmap keys and check if the `lock_id` is correct when commit txn in MS.
- Loading branch information
Showing
9 changed files
with
319 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
.../data/fault_injection_p0/cloud/test_cloud_pending_delete_bitmaps_removed_by_other_txn.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !sql -- | ||
1 1 1 | ||
2 2 2 | ||
3 3 3 | ||
|
||
-- !sql -- | ||
1 999 999 | ||
2 2 2 | ||
3 3 3 | ||
|
Oops, something went wrong.