nodetool stop
Stops compaction operations.
Synopsis
Section titled “Synopsis”nodetool [connection_options] stop [options] <compaction_type>See connection options for connection options.
Description
Section titled “Description”nodetool stop interrupts running compaction operations. This is useful when compaction is impacting cluster performance or when emergency intervention is needed.
Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
compaction_type | Type of compaction to stop |
Options
Section titled “Options”| Option | Description |
|---|---|
-id, --compaction-id <id> | Stop a specific compaction by its ID (from compactionstats) |
Compaction Types
Section titled “Compaction Types”| Type | Description |
|---|---|
COMPACTION | Regular compaction |
VALIDATION | Repair validation (Merkle tree) |
CLEANUP | Cleanup after topology change |
SCRUB | Scrub operation |
UPGRADE_SSTABLES | SSTable upgrade |
INDEX_BUILD | Secondary index builds |
VIEW_BUILD | Materialized view builds |
INDEX_SUMMARY | Index summary redistribution |
TOMBSTONE_COMPACTION | Tombstone-only compaction |
ANTICOMPACTION | Post-repair anticompaction |
VERIFY | Verification operations |
RELOCATE | SSTable relocation |
GARBAGE_COLLECT | Garbage collection compaction |
Examples
Section titled “Examples”Stop Regular Compaction
Section titled “Stop Regular Compaction”nodetool stop COMPACTIONStop Validation (During Repair)
Section titled “Stop Validation (During Repair)”nodetool stop VALIDATIONStop Cleanup
Section titled “Stop Cleanup”nodetool stop CLEANUPStop Index Build
Section titled “Stop Index Build”nodetool stop INDEX_BUILDStop View Build
Section titled “Stop View Build”nodetool stop VIEW_BUILDStop Specific Compaction by ID
Section titled “Stop Specific Compaction by ID”# First, get the compaction ID from compactionstatsnodetool compactionstats
# Stop specific compaction by IDnodetool stop -id 12345678-1234-1234-1234-123456789abc COMPACTIONStop All Types
Section titled “Stop All Types”nodetool stop COMPACTIONnodetool stop VALIDATIONnodetool stop CLEANUPWhen to Use
Section titled “When to Use”Emergency: High Latency
Section titled “Emergency: High Latency”When compaction is causing unacceptable latency:
# Check if compaction is the causenodetool compactionstats
# Stop compactionnodetool stop COMPACTIONDisk Full
Section titled “Disk Full”When disk is critically low:
# Stop compaction immediatelynodetool stop COMPACTION
# Free spacenodetool clearsnapshot
# Consider reducing compaction throughput before resumingnodetool setcompactionthroughput 32Slow Repair
Section titled “Slow Repair”When repair validation is taking too long:
# Check repair statusnodetool repair_admin list
# Stop the validationnodetool stop VALIDATION
# Cancel the repairnodetool repair_admin cancel <id>Behavior
Section titled “Behavior”Stop Behavior
When stopped:
- Current compaction is interrupted
- Partial work is discarded
- Compaction will restart automatically
- Manual compaction needs to be re-run
Auto-Resume
Section titled “Auto-Resume”Automatic compactions resume based on the compaction strategy. To prevent immediate restart:
# Stop compactionnodetool stop COMPACTION
# Disable auto-compaction for specific tablenodetool disableautocompaction my_keyspace my_tableVerification
Section titled “Verification”Before Stop
Section titled “Before Stop”# See what's runningnodetool compactionstatsAfter Stop
Section titled “After Stop”# Verify stoppednodetool compactionstats# Should show fewer or no active compactionsImpact
Section titled “Impact”| Stop Type | Impact |
|---|---|
| COMPACTION | SSTable count may grow |
| VALIDATION | Repair incomplete |
| CLEANUP | Extra data remains temporarily |
| INDEX_BUILD | Index incomplete |
| VIEW_BUILD | Materialized view incomplete |
| GARBAGE_COLLECT | Garbage not collected |
Workflow: Performance Issue
Section titled “Workflow: Performance Issue”# 1. Identify compaction causing issuesnodetool compactionstats
# 2. Stop the compaction typenodetool stop COMPACTION
# 3. Reduce throughputnodetool setcompactionthroughput 32
# 4. Allow compaction to resume at lower rate# (auto-compaction restarts automatically)
# 5. Monitorwatch nodetool compactionstatsCommon Scenarios
Section titled “Common Scenarios”Scenario: Large Compaction Blocking Operations
Section titled “Scenario: Large Compaction Blocking Operations”# Stop the compactionnodetool stop COMPACTION
# Reduce compaction impactnodetool setcompactionthroughput 32nodetool setconcurrentcompactors 1Scenario: Repair Taking Too Long
Section titled “Scenario: Repair Taking Too Long”# Stop validationnodetool stop VALIDATION
# Wait for current segment to finishsleep 30
# Restart with smaller scopenodetool repair -pr my_keyspaceImportant Considerations
Section titled “Important Considerations”Stopping Compaction
- Does not prevent future compactions
- SSTable count will grow
- Read performance may degrade
- Disk usage may increase
- Should be temporary
Don't Use For
Section titled “Don't Use For”- Routine operations (use throughput tuning instead)
- Long-term compaction control (use strategy tuning)
- Disk space issues (will make worse long-term)
Related Commands
Section titled “Related Commands”| Command | Relationship |
|---|---|
| compactionstats | View running compactions |
| setcompactionthroughput | Control compaction speed |
| compact | Force compaction |
| repair_admin | Manage repair sessions |