Skip to content
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] Fix ArrayIndexOut0fBoundsException caused by optimistic lock #4066

Merged
merged 11 commits into from
Apr 28, 2024

Conversation

thetumbled
Copy link
Member

@thetumbled thetumbled commented Sep 1, 2023

Motivation

This is the bug fix simillar to Pulsar. refer to: apache/pulsar#18390.

Changes

Fix bugs in:

ConcurrentLongHashMap
ConcurrentLongHashSet
ConcurrentLongLongHashMap
ConcurrentLongLongPairHashMap
ConcurrentOpenHashMap
ConcurrentOpenHashSet

@thetumbled
Copy link
Member Author

thetumbled commented Sep 18, 2023

Could you help to reviw this PR? @eolivelli @sijie @hangc0276 @zymap
Thanks.

@thetumbled
Copy link
Member Author

Could you help to reviw this PR? @eolivelli @dlg99 @hangc0276 @nicoloboschi @shoothzj @zymap @wenbingshen
This bug could happen when the concurrent data structure shrink it's capacity.

@thetumbled
Copy link
Member Author

I find that the same concurrency problem is reported in bookkeeper #4316, it is time to merge this fix into the bookkeeper.
PTAL, thanks. @lhotari @hangc0276 @eolivelli @wenbingshen @zymap @shoothzj @horizonzy

Copy link
Contributor

@dlg99 dlg99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Thank you!

@dlg99 dlg99 changed the title Fix ArrayIndexOut0fBoundsException caused by optimistic lock [fix] Fix ArrayIndexOut0fBoundsException caused by optimistic lock Apr 28, 2024
@dlg99
Copy link
Contributor

dlg99 commented Apr 28, 2024

retest this please

@eolivelli
Copy link
Contributor

closing/reopening to trigger CI

@eolivelli eolivelli closed this Apr 28, 2024
@eolivelli eolivelli reopened this Apr 28, 2024
Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

thanks

@dlg99
Copy link
Contributor

dlg99 commented Apr 28, 2024

Please fix the checkstyle


[INFO] There are 6 errors reported by Checkstyle 9.3 with buildtools/src/main/resources/bookkeeper/checkstyle.xml ruleset.
Error:  src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongHashMapTest.java:[224,29] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
Error:  src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongPairHashMapTest.java:[41,1] (imports) ImportOrder: Extra separation in import group before 'org.apache.bookkeeper.util.collections.ConcurrentLongLongPairHashMap.LongPair'
Error:  src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongHashSetTest.java:[40,1] (imports) ImportOrder: Extra separation in import group before 'org.junit.Test'
Error:  src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongHashMapTest.java:[42,1] (imports) ImportOrder: Extra separation in import group before 'org.apache.bookkeeper.util.collections.ConcurrentLongLongHashMap.LongLongFunction'
Error:  src/test/java/org/apache/bookkeeper/util/collections/ConcurrentOpenHashMapTest.java:[220,32] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
Error:  src/test/java/org/apache/bookkeeper/util/collections/ConcurrentOpenHashSetTest.java:[39,1] (imports) ImportOrder: Extra separation in import group before 'org.junit.Test'

@thetumbled
Copy link
Member Author

Please fix the checkstyle


[INFO] There are 6 errors reported by Checkstyle 9.3 with buildtools/src/main/resources/bookkeeper/checkstyle.xml ruleset.
Error:  src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongHashMapTest.java:[224,29] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
Error:  src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongPairHashMapTest.java:[41,1] (imports) ImportOrder: Extra separation in import group before 'org.apache.bookkeeper.util.collections.ConcurrentLongLongPairHashMap.LongPair'
Error:  src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongHashSetTest.java:[40,1] (imports) ImportOrder: Extra separation in import group before 'org.junit.Test'
Error:  src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongHashMapTest.java:[42,1] (imports) ImportOrder: Extra separation in import group before 'org.apache.bookkeeper.util.collections.ConcurrentLongLongHashMap.LongLongFunction'
Error:  src/test/java/org/apache/bookkeeper/util/collections/ConcurrentOpenHashMapTest.java:[220,32] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
Error:  src/test/java/org/apache/bookkeeper/util/collections/ConcurrentOpenHashSetTest.java:[39,1] (imports) ImportOrder: Extra separation in import group before 'org.junit.Test'

fixed, please help to re-trigger the CI, thanks.

@dlg99 dlg99 merged commit e4faf25 into apache:master Apr 28, 2024
20 checks passed
dlg99 pushed a commit to datastax/bookkeeper that referenced this pull request Apr 29, 2024
@lhotari
Copy link
Member

lhotari commented Apr 30, 2024

@dlg99 @eolivelli Please cherry-pick this PR to branch-4.16.

@shoothzj
Copy link
Member

shoothzj commented May 5, 2024

@lhotari done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants