[feat][txn] Implement the AbortedTxnProcessor for TransactionBuffer - #17847
Merged
congbobo184 merged 33 commits intoOct 31, 2022
Merged
[feat][txn] Implement the AbortedTxnProcessor for TransactionBuffer#17847congbobo184 merged 33 commits into
congbobo184 merged 33 commits into
Conversation
liangyepianzhou
marked this pull request as draft
September 27, 2022 03:56
liangyepianzhou
marked this pull request as ready for review
October 25, 2022 03:58
congbobo184
reviewed
Oct 27, 2022
poorbarcode
reviewed
Oct 27, 2022
poorbarcode
left a comment
Contributor
There was a problem hiding this comment.
I haven't read the whole thing, leave some comments
congbobo184
reviewed
Oct 29, 2022
poorbarcode
reviewed
Oct 29, 2022
| CompletableFuture<Void> completableFuture = new CompletableFuture<>(); | ||
| persistentWorker.appendTask(PersistentWorker.OperationType.Close, | ||
| () -> persistentWorker.clearSnapshotSegmentAndIndexes() | ||
| .thenRun(() -> { |
Contributor
There was a problem hiding this comment.
Suggest whenComplete instead thenRun & exceptionally
poorbarcode
reviewed
Oct 29, 2022
poorbarcode
left a comment
Contributor
There was a problem hiding this comment.
I haven't read the whole thing, leave some comments
congbobo184
reviewed
Oct 30, 2022
| return abortTxnSegments.values().stream() | ||
| .anyMatch(list -> list.contains(txnID)) || unsealedAbortedTxnIdSegment.contains(txnID); | ||
| } else { | ||
| PositionImpl maxReadPosition = abortTxnSegments.ceilingKey((PositionImpl) readPosition); |
Contributor
There was a problem hiding this comment.
If it does not exist in the segment, we directly check unsealed segment is ok
congbobo184
approved these changes
Oct 31, 2022
codelipenghui
approved these changes
Oct 31, 2022
poorbarcode
approved these changes
Oct 31, 2022
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #17847 +/- ##
=============================================
+ Coverage 38.97% 49.49% +10.52%
+ Complexity 8311 7002 -1309
=============================================
Files 683 400 -283
Lines 67325 43612 -23713
Branches 7217 4477 -2740
=============================================
- Hits 26239 21586 -4653
+ Misses 38079 19624 -18455
+ Partials 3007 2402 -605
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
2 tasks
4 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Master Issue: #16913
Motivation
Implement an abortedTxnProcessor to handle the storage of the aborted transaction ID.
Modifications
The structure overview:

The main idea is to move the logic of the operation of checking and persistent aborted transaction IDs(take snapshots) and the operation of updating maxReadPosition into the AbortedTxnProcessor.
And the AbortedTxnProcessor can be implemented in different designs.
Documentation
doc-not-needed(Please explain why)
Matching PR in the forked repository
PR in forked repository: liangyepianzhou#7