-
Notifications
You must be signed in to change notification settings - Fork 3.8k
CASSANDRA-21065: Fix ConcurrentModificationException in performGarbageCollection with only_purge_repaired_tombstones #4571
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
base: trunk
Are you sure you want to change the base?
Conversation
… by copying transaction.originals()
michaelsembwever
left a comment
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.
lgtm, just nits for readability (and redundant docker approach)
test/unit/org/apache/cassandra/db/compaction/GarbageCollectRepairedSSTablesTest.java
Outdated
Show resolved
Hide resolved
test/unit/org/apache/cassandra/db/compaction/GarbageCollectRepairedSSTablesTest.java
Outdated
Show resolved
Hide resolved
test/unit/org/apache/cassandra/db/compaction/GarbageCollectRepairedSSTablesTest.java
Outdated
Show resolved
Hide resolved
test/unit/org/apache/cassandra/db/compaction/GarbageCollectRepairedSSTablesTest.java
Outdated
Show resolved
Hide resolved
test/unit/org/apache/cassandra/db/compaction/GarbageCollectRepairedSSTablesTest.java
Outdated
Show resolved
Hide resolved
test/unit/org/apache/cassandra/db/compaction/GarbageCollectRepairedSSTablesTest.java
Outdated
Show resolved
Hide resolved
test/unit/org/apache/cassandra/db/compaction/GarbageCollectRepairedSSTablesTest.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/db/compaction/CompactionManager.java
Outdated
Show resolved
Hide resolved
Co-authored-by: mck <mck@apache.org>
Remove redundant comments in the garbage collection test.
@michaelsembwever thank you for the review! All requested changes have been implemented. |
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.
above, and against the test methods there's repeated mention of the ConcurrentModificationException.
but that's not the only value of these test methods. and four of these methods don't even break without the patch, so have nothing to do with the ConcurrentModificationException bug– the test methods still add value, but their value-add can be documented more accurately.
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 think the first sentence above is more than enough.
but if you want to keep the second part and stacktrace snippet, at least do
| * Before CASSANDRA-21065 this would fail with: |
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.
what is the method actually testing then ?
Better to be direct about what the test method's value actually is. (Rather than describe what it is not.)
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.
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.
👍
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.
replace System.err with LOGGER.error
(all 11 occurrences in this file)
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.
curious) do you know how to reproduce this ?
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.
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.
Fix ConcurrentModificationException in performGarbageCollection with only_purge_repaired_tombstones
When running
nodetool garbagecollecton a table with mixed repaired/unrepaired SSTables andonly_purge_repaired_tombstones=true, a ConcurrentModificationException was thrown because the code iterated directly overtransaction.originals()while callingtransaction.cancel()inside the loop, modifying the underlying collection.The fix copies the collection before iterating:
new ArrayList<>(transaction.originals())Tests run via: