Apache Cassandra Knowledge Patch
Purpose
Load this skill when designing, upgrading, operating, or debugging Apache
Cassandra. It concentrates compatibility details that affect CQL, schema,
indexes, storage, repair, topology, configuration, security, observability,
clients, and command-line tooling.
Start from the deployed cluster and application reality:
- Determine the Cassandra version on every node involved in the change.
- Check whether the cluster is mixed-version or fully upgraded.
- Identify the storage format, index implementations, compaction strategy,
and repair mode in use.
- Read the topic reference that matches the operation.
- Validate changes on representative data and with the same management path
used in production.
Do not infer behavior from configuration templates alone. Runtime state, JMX,
virtual tables, nodetool, schema output, and logs may each expose a different
part of the operational picture.
Reference index
| Reference |
Topics |
| Configuration, Security, and Observability |
YAML, authorizers, guardrails, virtual settings, JMX, logging, runtime support, and security controls |
| CQL, Schema, Clients, and Tools |
Native protocol, CQL types and DDL, cqlsh, nodetool, stress tooling, source builds, and CQLSSTableWriter |
| Indexing and Query Correctness |
SAI, legacy secondary indexes, filtering, tombstones, static columns, ANN, and query reconciliation |
| Repair, Topology, and Coordination |
AutoRepair, Paxos, gossip, hints, bootstrap, batchlog placement, and streaming coordination |
| Storage, SSTables, and Recovery |
Commitlog, compaction, snapshots, SSTable formats, corruption handling, and recovery |
High-impact compatibility checks
Tightened security boundaries
- Expect authorization that older maintenance releases accidentally permitted
on data centers, authorizer paths, or system keyspaces to be rejected.
- A regular user cannot bind an identity to a superuser. Run that provisioning
step with appropriately privileged credentials.
- Password changes are rate-limited. Rotation automation needs bounded retry
behavior rather than rapid repeated requests.
- Audit logging configuration is validated during startup. Treat a startup
rejection as a configuration error instead of assuming the logger will
ignore malformed settings.
- Grants are supported on the
system_views and
system_virtual_schema virtual keyspaces when monitoring roles need them.
See Configuration, Security, and Observability
for the complete set of authorization, redaction, and obfuscation changes.
Automation and CLI changes
- Use
nodetool import -cd as the short form of --copy-data; -p conflicts
and is no longer the short option.
- Do not make tool wrappers depend on incidental sourcing of
cassandra-env.sh; tools skip it when it is unnecessary.
- Treat invalid or filesystem-unsafe table and snapshot names as DDL or command
validation failures.
cqlsh can disable persistent history, and supported Python runtimes include
Python 3.12 and 3.13.
nodetool getguardrailsconfig and setguardrailsconfig expose guardrail
configuration through their simplified interfaces.
- Use
nodetool checktokenmetadata when comparing token metadata with gossip
endpoint state.
See CQL, Schema, Clients, and Tools
for exact tool and client compatibility notes.
Virtual settings consumers
Consumers of system_views.settings must:
- parse complex values as JSON;
- tolerate settings whose keys are not strings;
- expect security-sensitive values to be redacted; and
- handle the restored, broader set of configuration rows.
Do not use the view as a secret-retrieval mechanism. See
Configuration, Security, and Observability
for JMX and metrics changes that often affect the same inventory systems.
AutoRepair operations
Built-in AutoRepair provides an in-process scheduler with minimum task-duration
control, preview_repaired support, disk protection for full repair, and
expected-versus-actual progress reporting for bytes and keyspaces.
Operational constraints matter:
- the scheduler stops when two major Cassandra versions are detected;
- full repair observes disk-protection conditions; and
parallel_repair_count values greater than one are supported without the
previous ongoing-repair assertion failure.
During a mixed-major upgrade, retain external repair planning because the
built-in scheduler does not continue. See
Repair, Topology, and Coordination.
SAI and query correctness
When investigating a query result, distinguish index availability from node
availability and distinguish local correctness from distributed
reconciliation:
- built SAI indexes are queryable when a restarted node is marked
UP;
- writer switches flush active SAI segment builders;
- repair flushes correctly mark non-empty index state;
- static-column queries and their range tombstones reconcile correctly;
- intersection queries preserve repaired and non-indexed matches;
- segmented index components use segment-aware checksum boundaries; and
- ANN execution uses score-ordered iterators.
Legacy secondary indexes take priority when they coexist with SAI on a column.
Empty values remain invalid for non-literal or otherwise incompatible indexed
types. See Indexing and Query Correctness.
Deletions and reconciliation
Correctness fixes cover several distinct deletion paths:
- mutation serialization preserves complex deletions across multiple
collections;
RowFilter retains deletions needed for result reconciliation;
- Full Query Logging batches support null-value tombstones;
- reading a partition after a column deletion no longer fails with an index
bounds exception; and
- secondary indexes are notified about rows in fully expired SSTables.
Do not paper over a suspected deletion bug by changing consistency levels or
rebuilding an unrelated index. Identify the affected serialization, filtering,
logging, or compaction path first.
Storage and recovery safety
- Direct I/O commitlog flushes preserve data safely.
- Commitlog recovery skips sync blocks correctly after CRC errors.
- A corrupt SSTable found during compaction is marked suspected and associated
buffer-pool resources are released.
- Runtime failures while writing the TOC remain runtime failures rather than
being reclassified as filesystem errors.
- Memory-mapped trie indexes larger than 2 GiB are readable.
- Early-open BTI range queries return correct results.
- Legacy SSTables with the old Bloom-filter format automatically fall back
from zero-copy streaming.
See Storage, SSTables, and Recovery
before changing compaction, streaming, snapshot, or recovery procedures.
Upgrade and incident workflow
Before an upgrade
- Inventory node versions, Java runtime, SSTable formats, indexes, and repair
scheduling.
- Review tightened authorization, schema compatibility, configuration
validation, and tool option changes.
- Confirm monitoring parsers handle JSON and redacted virtual settings and
corrected metric values.
- Exercise mixed-version Paxos, streaming fallback, hints, and repair behavior
in a staging topology.
- Verify disk limits against a first-boot node and compaction space estimates
against compressed table sizes.
After a restart or bootstrap
- Confirm gossip endpoint state includes DC, rack, and host ID for
bootstrapping or gossip-only nodes.
- Check token metadata consistency with
nodetool checktokenmetadata.
- Confirm SAI queryability rather than relying only on node
UP state.
- Use the bootstrap-available
StorageService JMX MBean when automation needs
management visibility before the node reaches normal state.
- Check the corrected failure-detector timing if defaults are in use.
During a correctness incident
- Record whether the query uses SAI, legacy 2i, static columns, composite map
filters, numeric ranges, or descending clustering columns.
- Determine whether repair, reconciliation, tombstones, an early-open SSTable,
or an SSTable-writer boundary is involved.
- Preserve evidence from logs,
nodetool tablestats, schema descriptions,
and relevant virtual tables.
- For storage faults, distinguish corruption, checksum, commitlog CRC, and
TOC write paths before choosing remediation.
- Do not expect a heap dump for an exception Cassandra handled internally.
Authoring and review guidance
When proposing Cassandra code or automation:
- keep examples explicit about keyspace, table, consistency, and topology;
- prefer long CLI options in scripts unless the short form is documented;
- treat redacted values as intentionally unavailable;
- account for mixed-version behavior during rolling upgrades;
- avoid assuming node liveness implies index readiness;
- validate CQL type compatibility, especially vectors, UDT clustering keys,
and
BytesType schema evolution; and
- test deletion and tombstone semantics with reconciliation and repair in mind.
Use the references as compatibility constraints, then verify the final behavior
against the target cluster, its schema, and its operational configuration.
1---2name: cassandra-knowledge-patch-23description: Apache Cassandra4license: MIT5---678# Apache Cassandra Knowledge Patch910## Purpose1112Load this skill when designing, upgrading, operating, or debugging Apache13Cassandra. It concentrates compatibility details that affect CQL, schema,14indexes, storage, repair, topology, configuration, security, observability,15clients, and command-line tooling.1617Start from the deployed cluster and application reality:18191. Determine the Cassandra version on every node involved in the change.202. Check whether the cluster is mixed-version or fully upgraded.213. Identify the storage format, index implementations, compaction strategy,22 and repair mode in use.234. Read the topic reference that matches the operation.245. Validate changes on representative data and with the same management path25 used in production.2627Do not infer behavior from configuration templates alone. Runtime state, JMX,28virtual tables, `nodetool`, schema output, and logs may each expose a different29part of the operational picture.3031## Reference index3233| Reference | Topics |34| --- | --- |35| [Configuration, Security, and Observability](references/configuration-security-observability.md) | YAML, authorizers, guardrails, virtual settings, JMX, logging, runtime support, and security controls |36| [CQL, Schema, Clients, and Tools](references/cql-schema-clients-and-tools.md) | Native protocol, CQL types and DDL, `cqlsh`, `nodetool`, stress tooling, source builds, and `CQLSSTableWriter` |37| [Indexing and Query Correctness](references/indexing-and-query-correctness.md) | SAI, legacy secondary indexes, filtering, tombstones, static columns, ANN, and query reconciliation |38| [Repair, Topology, and Coordination](references/repair-topology-coordination.md) | AutoRepair, Paxos, gossip, hints, bootstrap, batchlog placement, and streaming coordination |39| [Storage, SSTables, and Recovery](references/storage-sstables-and-recovery.md) | Commitlog, compaction, snapshots, SSTable formats, corruption handling, and recovery |4041## High-impact compatibility checks4243### Tightened security boundaries4445- Expect authorization that older maintenance releases accidentally permitted46 on data centers, authorizer paths, or system keyspaces to be rejected.47- A regular user cannot bind an identity to a superuser. Run that provisioning48 step with appropriately privileged credentials.49- Password changes are rate-limited. Rotation automation needs bounded retry50 behavior rather than rapid repeated requests.51- Audit logging configuration is validated during startup. Treat a startup52 rejection as a configuration error instead of assuming the logger will53 ignore malformed settings.54- Grants are supported on the `system_views` and55 `system_virtual_schema` virtual keyspaces when monitoring roles need them.5657See [Configuration, Security, and Observability](references/configuration-security-observability.md)58for the complete set of authorization, redaction, and obfuscation changes.5960### Automation and CLI changes6162- Use `nodetool import -cd` as the short form of `--copy-data`; `-p` conflicts63 and is no longer the short option.64- Do not make tool wrappers depend on incidental sourcing of65 `cassandra-env.sh`; tools skip it when it is unnecessary.66- Treat invalid or filesystem-unsafe table and snapshot names as DDL or command67 validation failures.68- `cqlsh` can disable persistent history, and supported Python runtimes include69 Python 3.12 and 3.13.70- `nodetool getguardrailsconfig` and `setguardrailsconfig` expose guardrail71 configuration through their simplified interfaces.72- Use `nodetool checktokenmetadata` when comparing token metadata with gossip73 endpoint state.7475See [CQL, Schema, Clients, and Tools](references/cql-schema-clients-and-tools.md)76for exact tool and client compatibility notes.7778### Virtual settings consumers7980Consumers of `system_views.settings` must:8182- parse complex values as JSON;83- tolerate settings whose keys are not strings;84- expect security-sensitive values to be redacted; and85- handle the restored, broader set of configuration rows.8687Do not use the view as a secret-retrieval mechanism. See88[Configuration, Security, and Observability](references/configuration-security-observability.md)89for JMX and metrics changes that often affect the same inventory systems.9091### AutoRepair operations9293Built-in AutoRepair provides an in-process scheduler with minimum task-duration94control, `preview_repaired` support, disk protection for full repair, and95expected-versus-actual progress reporting for bytes and keyspaces.9697Operational constraints matter:9899- the scheduler stops when two major Cassandra versions are detected;100- full repair observes disk-protection conditions; and101- `parallel_repair_count` values greater than one are supported without the102 previous ongoing-repair assertion failure.103104During a mixed-major upgrade, retain external repair planning because the105built-in scheduler does not continue. See106[Repair, Topology, and Coordination](references/repair-topology-coordination.md).107108### SAI and query correctness109110When investigating a query result, distinguish index availability from node111availability and distinguish local correctness from distributed112reconciliation:113114- built SAI indexes are queryable when a restarted node is marked `UP`;115- writer switches flush active SAI segment builders;116- repair flushes correctly mark non-empty index state;117- static-column queries and their range tombstones reconcile correctly;118- intersection queries preserve repaired and non-indexed matches;119- segmented index components use segment-aware checksum boundaries; and120- ANN execution uses score-ordered iterators.121122Legacy secondary indexes take priority when they coexist with SAI on a column.123Empty values remain invalid for non-literal or otherwise incompatible indexed124types. See [Indexing and Query Correctness](references/indexing-and-query-correctness.md).125126### Deletions and reconciliation127128Correctness fixes cover several distinct deletion paths:129130- mutation serialization preserves complex deletions across multiple131 collections;132- `RowFilter` retains deletions needed for result reconciliation;133- Full Query Logging batches support null-value tombstones;134- reading a partition after a column deletion no longer fails with an index135 bounds exception; and136- secondary indexes are notified about rows in fully expired SSTables.137138Do not paper over a suspected deletion bug by changing consistency levels or139rebuilding an unrelated index. Identify the affected serialization, filtering,140logging, or compaction path first.141142### Storage and recovery safety143144- Direct I/O commitlog flushes preserve data safely.145- Commitlog recovery skips sync blocks correctly after CRC errors.146- A corrupt SSTable found during compaction is marked suspected and associated147 buffer-pool resources are released.148- Runtime failures while writing the TOC remain runtime failures rather than149 being reclassified as filesystem errors.150- Memory-mapped trie indexes larger than 2 GiB are readable.151- Early-open BTI range queries return correct results.152- Legacy SSTables with the old Bloom-filter format automatically fall back153 from zero-copy streaming.154155See [Storage, SSTables, and Recovery](references/storage-sstables-and-recovery.md)156before changing compaction, streaming, snapshot, or recovery procedures.157158## Upgrade and incident workflow159160### Before an upgrade1611621. Inventory node versions, Java runtime, SSTable formats, indexes, and repair163 scheduling.1642. Review tightened authorization, schema compatibility, configuration165 validation, and tool option changes.1663. Confirm monitoring parsers handle JSON and redacted virtual settings and167 corrected metric values.1684. Exercise mixed-version Paxos, streaming fallback, hints, and repair behavior169 in a staging topology.1705. Verify disk limits against a first-boot node and compaction space estimates171 against compressed table sizes.172173### After a restart or bootstrap1741751. Confirm gossip endpoint state includes DC, rack, and host ID for176 bootstrapping or gossip-only nodes.1772. Check token metadata consistency with `nodetool checktokenmetadata`.1783. Confirm SAI queryability rather than relying only on node `UP` state.1794. Use the bootstrap-available `StorageService` JMX MBean when automation needs180 management visibility before the node reaches normal state.1815. Check the corrected failure-detector timing if defaults are in use.182183### During a correctness incident1841851. Record whether the query uses SAI, legacy 2i, static columns, composite map186 filters, numeric ranges, or descending clustering columns.1872. Determine whether repair, reconciliation, tombstones, an early-open SSTable,188 or an SSTable-writer boundary is involved.1893. Preserve evidence from logs, `nodetool tablestats`, schema descriptions,190 and relevant virtual tables.1914. For storage faults, distinguish corruption, checksum, commitlog CRC, and192 TOC write paths before choosing remediation.1935. Do not expect a heap dump for an exception Cassandra handled internally.194195## Authoring and review guidance196197When proposing Cassandra code or automation:198199- keep examples explicit about keyspace, table, consistency, and topology;200- prefer long CLI options in scripts unless the short form is documented;201- treat redacted values as intentionally unavailable;202- account for mixed-version behavior during rolling upgrades;203- avoid assuming node liveness implies index readiness;204- validate CQL type compatibility, especially vectors, UDT clustering keys,205 and `BytesType` schema evolution; and206- test deletion and tombstone semantics with reconciliation and repair in mind.207208Use the references as compatibility constraints, then verify the final behavior209against the target cluster, its schema, and its operational configuration.