-
Couldn't load subscription status.
- Fork 3.4k
HBASE-26384 Segment already flushed to hfile may still be remained in… #3777
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
Conversation
… CompactingMemStore
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
Seems error not related to this patch, rerun checking |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
| public VersionedSegmentsList getVersionedTail() { | ||
| synchronized (pipeline){ | ||
| List<ImmutableSegment> segmentList = new ArrayList<>(); | ||
| LinkedList<ImmutableSegment> segmentList = new LinkedList<>(); |
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.
Why change to LinkedList? Usually it will be much slower than ArrayList.
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.
@Apache9 , thank you very much for review,Here I change to LinkedList because I expect VersionedSegmentsList.storeSegments is LinkedList, so in the following CompactionPipline.matchAndRemoveSuffixFromPipeline I could use LinkedList.descendingIterator to simplify code.
I think here change to LinkedList is somwhat ok, because:
- Here the returned
VersionedSegmentsListhas only one tail element,LinkedListandArrayListmake no difference. - Furthermore, the
CompactionPipeline.pipelineandCompactionPipeline.readOnlyCopywhich used inCompactionPipeline.getVersionedListare all LinkedList, that is to say,VersionedSegmentsList.storeSegmentsis actually LinkedList in fact(CompactionPipline.getVersionedTailis only used for test), so here change to LinkedList could also make the code looks consistent.
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.
If ArrayList is not suitable here, is it possible to make use of other array based data structure, like ArrayQueue or ArrayDeque? LinkedList is not recommanded for most cases...
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.
Ok, thank you for review, I would to try to fix the List problem,
| * This test is for HBASE-26384, | ||
| * test {@link CompactingMemStore#flattenOneSegment} and {@link CompactingMemStore#snapshot()} | ||
| * execute concurrently. | ||
| * The threads sequence is: |
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.
This is the expected behavior or the broken behavior?
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.
This is the expected behavior,I modified the comments to explictly state it.
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.
I prefer we explain the broken behavior first and then say what should be the correct behavior, so it will be easier for people to know what we actually fixed.
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.
Ok, thank you for suggestion, I would fix the description.
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
@Apache9 , thank you for review, I modified the LinkedList problem and test comments problem following your suggestions. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
… CompactingMemStore