CommandChanges.shouldCleanup short-circuits to NO if there is no data…#4873
Open
belliottsmith wants to merge 5 commits into
Open
CommandChanges.shouldCleanup short-circuits to NO if there is no data…#4873belliottsmith wants to merge 5 commits into
belliottsmith wants to merge 5 commits into
Conversation
Contributor
|
+1 |
ifesdjeen
approved these changes
Jun 11, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent Accord journal cleanup/expunge decisions from being surfaced as NotDefined on the load path (which the PR description notes can cause linearizability violations). The visible changes in this repo primarily add/adjust tests and test utilities to reproduce and guard the behavior.
Changes:
- Add a new regression unit test (
AccordExpungeTest) coveringCleanup.EXPUNGEinteractions withCommandChangesreconstruction andjournal.loadCommand. - Extend
AccordGenerators.commandsBuilder()with an overload to allow customTxnIdgeneration (used by the new test). - Adjust distributed burn-test behavior and minor test cleanup/comment removals.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
test/unit/org/apache/cassandra/utils/AccordGenerators.java |
Adds an overload to build commands with a caller-supplied TxnId generator. |
test/unit/org/apache/cassandra/service/accord/AccordExpungeTest.java |
New regression test exercising EXPUNGE → loadCommand behavior across journal states. |
test/distributed/org/apache/cassandra/service/accord/journal/AccordJournalBurnTest.java |
Sets a global burn-test tuning parameter (CMD_BASE_CHECK_CHANCE) via static initializer. |
test/distributed/org/apache/cassandra/service/accord/AccordJournalCompactionTest.java |
Minor whitespace-only change. |
test/distributed/org/apache/cassandra/distributed/test/accord/AccordLoadTest.java |
Removes commented-out config lines. |
.gitmodules |
Points the modules/accord submodule at a personal fork/branch instead of the canonical Apache repo. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+139
to
+142
| validate((before, rb, db) -> { | ||
| CommandChanges builder = new CommandChanges(before.txnId); | ||
| builder.maybeCleanup(true, FULL, rb, db); | ||
| Command reconstructed = builder.construct(rb); |
Comment on lines
+169
to
+180
| private void loadAndValidate(Command before, Journal journal, RedundantBefore rb, DurableBefore db) | ||
| { | ||
| SoftAssertions checks = new SoftAssertions(); | ||
| Command loaded = journal.loadCommand(COMMAND_STORE_ID, before.txnId, rb, db); | ||
| checks.assertThat(loaded).as("loadCommand returned null after RedundantBefore advance for %s; " | ||
| + "AccordSafeCommand will surface this as NotDefined", loaded).isNotNull(); | ||
|
|
||
| checks.assertThat(loaded.saveStatus()) | ||
| .as("loadCommand did not return Erased for previously-written %s; " | ||
| + "loaded=%s, redundantBefore=%s", before, loaded, rb) | ||
| .isEqualTo(SaveStatus.Erased); | ||
| } |
Comment on lines
1
to
+4
| [submodule "modules/accord"] | ||
| path = modules/accord | ||
| url = https://github.com/apache/cassandra-accord.git | ||
| branch = trunk | ||
| url = https://github.com/belliottsmith/cassandra-accord.git | ||
| branch = consistent-expunge |
Comment on lines
+104
to
+107
| static | ||
| { | ||
| Cluster.RandomLoader.CMD_BASE_CHECK_CHANCE = 0.1f; | ||
| } |
…, but this is incorrect as Cleanup.EXPUNGE may have dropped the data and the record must receive cleanup EXPUNGE and be reported as ERASED. This can lead to lienarizability violations.
4d1f0a5 to
03ddba8
Compare
c05492b to
e938fcb
Compare
…s where the ownership is unknown
e938fcb to
6a05bc9
Compare
- Ensure ReadCoordinator callbacks are invoked on owning thread
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.
…, but this is incorrect as Cleanup.EXPUNGE may have dropped the data and the record must receive cleanup EXPUNGE and be reported as ERASED. This can lead to lienarizability violations.
Thanks for sending a pull request! Here are some tips if you're new here:
Commit messages should follow the following format:
The Cassandra Jira