Commit Graph

31217 Commits

Author SHA1 Message Date
Maxim Muzafarov 94b251f3ce
Migrate all nodetool commands from airline to picocli
Replace io.airlift:airline dependency with info.picocli:picocli across
all nodetool command implementations. This migration includes:

- Convert 160+ nodetool command classes from airline to picocli
- Add AbstractCommand base class for commands and utility methods
- Add NodetoolCommand top-level class for the cli utility
- Update all command classes to use @Command, @Option, and @Parameters
- Add plain text files to test command help output
- Add mock test classes for improved test coverage and parse validation
- Modify test infrastructure to work with picocli-based commands
- Add new layouts for cli formatting to preserve backwards compatibility

The migration maintains backward compatibility while providing improved
command-line parsing, better help system, and more robust argument
validation through picocli enhanced features.

patch by Maxim Muzafarov; reviewed by Caleb Rackliffe, Dmitry Konstantinov, Stefan Miklosovic for CASSANDRA-17445
2025-07-26 18:19:18 +02:00
Maxim Muzafarov f18d5ad851
ninja: remove unused imports in JournalGCTest and AccordCommandStore to pass checkstyle 2025-07-26 00:45:21 +02:00
David Capwell e48d0dcd2c Journal.TopologyUpdate should not store the local topology as it can be inferred from the global on
patch by David Capwell; reviewed by Benedict Elliott Smith for CASSANDRA-20785
2025-07-24 18:51:24 -07:00
Benedict Elliott Smith 49b99c9319 Fix DurableBefore updates:
- DurableBefore.fullyContainedIn should compare txnId
Also fix:
 - Messages with nullable state should check if they are cancelled after reading the state but before using it
 - Don't snapshot during replay
 - CFK.updateRedundantBefore incorrectly updating mayExecute and sharing byId in some cases
 - Refine GC with global durability bound
 - Fix JournalGCTest

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20786
2025-07-24 20:54:35 +01:00
Benedict Elliott Smith fbe12e6291 Accord Query Tracing
Also improve:
 - Metric listeners

patch by Benedict; reviewed by David Capwell for CASSANDRA-20773
2025-07-24 20:20:17 +01:00
Ariel Weisberg 88805177d2 Fix AccordWriteInteroperability message validation
Patch by Ariel Weisberg; Reviewed by David Capwell for CASSANDRA-20770
2025-07-24 11:07:22 -04:00
Stefan Miklosovic e8e312b4d1
Merge branch 'cassandra-5.0' into trunk 2025-07-24 10:27:58 +02:00
Stefan Miklosovic 922819dc08
Merge branch 'cassandra-4.1' into cassandra-5.0 2025-07-24 10:25:54 +02:00
Stefan Miklosovic f5f71b7fae
Rework / simplification of nodetool get/setguardrailsconfig commands
patch by Stefan Miklosovic; reviewed by Maxim Muzafarov for CASSANDRA-20778
2025-07-24 10:22:55 +02:00
Alex Petrov 53eb2fdac8 Improve GC testing; fix durability startup order
Patch by Alex Petrov; reviewed by Benedict Elliott Smith for CASSANDRA-20767
2025-07-23 14:59:12 +02:00
Benedict Elliott Smith 54e39a90b0 Limit replay to those records not durably persisted to both command store and data store
Also fix:
 - Limit truncation to TruncatedApplyWithOutcome until data is persisted durably to local store
 - IntervalUpdater not invoking super.close()
 - Do not invoke preRunExclusive without holding lock
 - IntervalUpdater not correctly initialise BranchBuilder.inUse
 - AccordExecutor should notify if more work on unlock of caches
 - Relax paranoid CFK validation during restart
Also improve:
 - Flush logs before System.exit
 - Start/stop progress log explicitly
 - Limit progress log concurrency
 - Clear heavy fields in some messages once processed

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20780
2025-07-23 12:19:06 +01:00
Alex Petrov 260c9c9334 Add a way to patch accord journal commands via virtual tables
Patch by Alex Petrov; reviewed by Benedict Elliott Smith for CASSANDRA-20765
2025-07-23 11:06:33 +01:00
David Capwell 0574db7bd9 Accord Route Index does not filter based off txn_id range which causes segments which cant contain the data to be queried
patch by David Capwell; reviewed by Benedict Elliott Smith for CASSANDRA-20772
2025-07-22 15:21:14 -07:00
David Capwell 8014eec7aa Merge branch 'cassandra-5.0' into trunk 2025-07-18 16:06:36 -07:00
David Capwell 169c37b030 Merge branch 'cassandra-4.1' into cassandra-5.0 2025-07-18 16:04:46 -07:00
Yuqi Yan 4962f3da3f IntrusiveStack.accumulate is not accumulating correctly
patch by Yuqi Yan; reviewed by Benedict Elliott Smith, David Capwell for CASSANDRA-20670
2025-07-18 16:02:17 -07:00
Benedict Elliott Smith d229eaf667 ninja: remove accidental file 2025-07-18 13:10:38 +01:00
Stefan Miklosovic 418e3a4899
Merge branch 'cassandra-5.0' into trunk 2025-07-18 07:52:31 +02:00
Stefan Miklosovic 5fb3ae4473
Merge branch 'cassandra-4.1' into cassandra-5.0 2025-07-18 07:41:32 +02:00
Yuqi Yan 5c94bc8820
Add nodetool get/setguardrailsconfig commands
patch by Yuqi Yan; reviewed by Brandon Williams, Maxwell Guo, Stefan Miklosovic for CASSANDRA-19552

Co-authored-by: Stefan Miklosovic <smiklosovic@apache.org>
2025-07-18 07:25:17 +02:00
Benedict Elliott Smith 0e9f0fab78 Improve:
- PreLoadContext descriptions
 - Introduce LoadKeysFor so we can avoid loading range transactions except where necessary

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20758
2025-07-17 07:21:04 +01:00
Benedict Elliott Smith 9df548109c Accord: Update CommandsForRanges.Manager interval tree asynchronously
patch by Benedict; reviewed by David Capwell for CASSANDRA-20764
2025-07-17 07:13:35 +01:00
Benedict Elliott Smith 37b6ade9c9 Accord: Fix minDecidedId calculation
Also fix:
 - slowCoordinatorDelay calculation for locally truncated command throws ISE
 - Bad cast of Truncated during replay
 - Don't throw IllegalStateException in Invariants.expect if accord.testing == false
 - Replay of empty segment throws NPE
Also improve:
 - Support tracing of recovery and home progress

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20771
2025-07-16 19:37:26 +01:00
Ariel Weisberg e06b8eabb1 Ninja fix .gitmodules 2025-07-16 12:50:19 -04:00
Ariel Weisberg e6cf2132ab Add testing of consensus live migration to simulator
Patch by Ariel Weisberg; Reviewed by Benedict Elliott Smith for CASSANDRA-20587
2025-07-16 11:31:54 -04:00
Alex Petrov 54a9c407bd Improve Interval B-Tree test coverage; add pprinter for B-Trees
Patch by Alex Petrov; reviewed by Benedict Elliott Smith for CASSANDRA-20766
2025-07-16 11:32:51 +02:00
Benedict Elliott Smith e8bd2319f4 Accord Fixes:
- Don't try to update metrics when no TxnId (e.g. GetMaxConflict)
 - maybeExecuteImmediately did not guarantee mutual exclusivity
 - Cancellation of a running 'plain' task could corrupt AccordExecutor state
 - GetLatestDeps message serializer
 - txn_blocked_by StackOverflowError
 - Not updating CommandsForKey in all cases on restart
Also Improve:
 - TableId.from/toString
 - Route toString methods
 - Tracing coverage of FetchRoute
 - Replay command store parallelism

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20763
2025-07-14 23:22:45 +01:00
Alex Petrov ccf12ef845 Add accord journal standalone dump tool
Patch by Alex Petrov; reviewed by Benedict Elliott Smith for CASSANDRA-20738
2025-07-12 13:38:53 +02:00
Benedict Elliott Smith 674b8d5100 Deduplicate ranges in WatermarkCollector
Also: collect ranges before submitting to TopologyManager to avoid quadratic complexity

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20757
2025-07-12 10:36:53 +01:00
David Capwell 28edf72bce Fix flakey test org.apache.cassandra.utils.SimpleBitSetSerializerTest
patch by David Capwell; reviewed by Benedict Elliott Smith, David Capwell for CASSANDRA-20759
2025-07-11 14:09:50 -07:00
Benedict Elliott Smith 7e32d92d06 Fix/Improve IntervalBTree
- Use AsymmetricComparator for seeking
 - Reimplement AbstractTransformer for more efficienct operation when only transforming a subset (i.e. Subtraction)
 - Reuse source node IntervalMaxIndex calculations for first branch level (to save iterating leaves)

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20756
2025-07-11 19:42:03 +01:00
Benedict Elliott Smith 92cbde1fde Introduce PseudoUtf8Type for virtual tables to search on types that are otherwise treated as strings for pretty printing;
Use this facility to make Accord debug virtual tables more useful

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20755
2025-07-11 19:00:26 +01:00
Benedict Elliott Smith fd2e11f0d2 Accord Fixes:
- WatermarkCollector should not report same closed/retired epoch N times
 - AccordSyncPropagator can merge pending requests and back-off retries
 - AccordCommandLoader should notify listeners
 - AccordSegmentCompactor should estimate number of keys to ensure bloom filters work
 - txn_blocked_by table should report what it can, not throw IllegalStateException
 - Permit uncompressed system tables

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20754
2025-07-11 15:19:36 +01:00
David Capwell 8289bb4cde Accord: Topology serializer has a lot of repeated data, can dedup to shrink the cost
patch by David Capwell; reviewed by Benedict Elliott Smith for CASSANDRA-20715
2025-07-10 20:06:02 -07:00
Marcus Eriksson f6c1002e44 Stream individual files in their own transactions and hand over ownership to a parent transaction on completion
patch by Marcus Eriksson; reviewed by Caleb Rackliffe and Jon Meredith for CASSANDRA-20728
2025-07-10 12:57:51 -05:00
Caleb Rackliffe 7b140f6a01 Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0:
  SSTableIndexWriter#abort() should log more quietly in cases where an exception is not provided
2025-07-09 13:49:02 -05:00
Caleb Rackliffe f9d759dc38 SSTableIndexWriter#abort() should log more quietly in cases where an exception is not provided
patch by Caleb Rackliffe; reviewed by Jon Meredith for CASSANDRA-20695
2025-07-09 13:41:40 -05:00
Benedict Elliott Smith cba4208568 Standardise Replay logic to ensure SafeCommandStore.update is called
Also Fix:
 - Initialise home state when calling waiting() if not already initialised
 - Don't reportClosed/reportRetired for epochs that are already closed/retired
Also Improve:
 - Implement waitForQuiescence in AccordExecutor
 - Permit replay parallelism

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20750
2025-07-08 21:23:47 +01:00
Benedict Elliott Smith a866f92fcf Improve:
- Journal debugging vtable support
 - Background task tracing support
Fix:
 - HLC_BOUND only valid for strictly lower HLC
 - HAS_UNIQUE_HLC can only be safely computed if READY_TO_EXECUTE
 - Break recursion in CommandStore.ensureReadyToCoordinate
 - Fix find intersecting shard scheduler
 - Separate adhoc ShardScheduler from normal to avoid overwriting
 - Should still use execution listeners to detect invalid reads for certain transactions even with dataStoreDetectsFutureReads

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20746
2025-07-04 09:08:50 +01:00
Caleb Rackliffe 30f094080f Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0:
  Ensure CassandraIndexTest sets up properly when using SAI in the wake of CASSANDRA-20732
2025-07-02 12:04:23 -05:00
Caleb Rackliffe 81fcacdfa4 Ensure CassandraIndexTest sets up properly when using SAI in the wake of CASSANDRA-20732
patch by Caleb Rackliffe; reviewed by Stefan Miklosovic for CASSANDRA-20740
2025-07-02 11:52:34 -05:00
Benedict Elliott Smith c9e52399e6 Fix:
- Lock inversion when restarting durability for erased sync point
 - Initialise durability cycle start time
Improve:
 - Improve durability reporting
 - Timeout durability requests
 - DurabilityQueue concurrency should limit only until quorum is achieved
 - Some exceptions that may be thrown when starting coordination may not be propagated

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20328
2025-07-02 14:09:45 +01:00
Igor Kamyshnikov 7bf6eef9d4
Limit the number of held heap dumps to not consume disk space excessively
patch by Igor Kamyshnikov; reviewed by Dmitry Konstantinov, Stefan Miklosovic for CASSANDRA-20457
2025-06-30 11:34:23 +02:00
Benedict Elliott Smith 0a7797ca85 Fix:
- Cannot shrink CommandsForKey if loading pruned
 - NoSpamLogger to suppress AccordSyncPropagator repeats
 - Minor performance improvement to BTree.Subtraction
 - EphemeralReads should retry in a later epoch if replication factor changes
 - Fix no local epoch for NotAccept
 - Invalidate a command with no route but for which we know we own some key that has applied locally
 - Don't pre-merge existing DurableBefore, to reduce duplicate/redundant persistence
 - Misc purging bugs and improve testing of purging

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20739
2025-06-29 12:59:09 +01:00
David Capwell 78d6892dfb Fix flakey test AbstractTypeTest#meaninglessEmptyness why is equality so hard
patch by David Capwell; reviewed by Caleb Rackliffe for CASSANDRA-20733
2025-06-27 12:29:00 -07:00
Caleb Rackliffe 1c2307bd62 Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0:
  Avoid availability gap between UP and queryability marking for already built SAI indexes on bounce
2025-06-27 11:38:25 -05:00
Caleb Rackliffe f553acea3e Avoid availability gap between UP and queryability marking for already built SAI indexes on bounce
patch by Caleb Rackliffe; reviewed by David Capwell and Dmitry Konstantinov for CASSANDRA-20732
2025-06-27 11:30:13 -05:00
Alex Petrov d516ea2f0f Fix topology reporting bugs
- remove the immediate topology reporting for single-node clusters before subscribing to TCM events
- move the TCM listener subscription to occur before reporting the current topology
- add topology reporting after subscribing to TCM events with proper conditional logic
- add gap-filling failsafe to fetch any missing topologies

Patch by Alex Petov; reviewed by Benedict Elliott Smith for CASSANDRA-20730
2025-06-27 09:45:29 +02:00
Benedict Elliott Smith 115c553984 Follow-up to CASSANDRA-20726:
- Fix shouldCleanup handling of erase/expunge
 - Fix CommandChange handling of minUniqueHlc being cleared
 - Don't clear minUniqueHlc when fast applying; instead simply validate !isWaiting

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20726
2025-06-26 20:31:19 +01:00
Pranav Shenoy 4437fa4fd4 Ensuring Row reference is only used for IS Null/IS Not Null expressions
patch by Pranav Shenoy; reviewed by David Capwell and Maxwell Guo for CASSANDRA-20596
2025-06-26 09:32:32 +08:00