Cassandra new-version binaries and previous SSTable format downgrade safety
0 reputation · 20 Dec 2022, 03:07 UTC
0 reputation · 20 Dec 2022, 03:07 UTC
Determine whether a Cassandra node that failed during a major-version upgrade can be returned to the previous Cassandra version without data loss, assuming the new binaries started and wrote system tables or SSTables before the failure.
Cassandra on-disk formats can change incompatibly between major releases, and restarting older binaries over upgraded data files may cause startup failures or silent corruption. Schema changes applied during the failed upgrade are not automatically reverted. Mixed-version operation is intended only for a brief rolling restart, not prolonged downgrade.
35275 reputation · 20 Dec 2022, 14:02 UTC
Restoring a Cassandra node to a previous version after a failed major upgrade is generally unsupported if the new binaries have already written data or modified the system schema. The only fully supported recovery path without data loss is restoring a pre-upgrade snapshot.
Cassandra SSTable formats are often incompatible across major versions (e.g., 3.11 to 4.0). If the new binaries started and wrote to disk, they may have:
system_schema keyspaces have been updated. Older binaries may fail to start or experience silent corruption when encountering schema definitions they cannot understand.If you must attempt to verify if the data is still readable, you should inspect the SSTable headers and the schema state. Use the sstables-tools utility (included in the Cassandra distribution) to check the file version:
sstables-tools meta /path/to/data/table-name-sdb
Look for the Version field in the output. If this version is higher than the maximum version supported by your target older binary, the node will fail to start.
Since the node already failed mid-upgrade, follow these steps to ensure data integrity:
nodetool repair to ensure consistency across the cluster.Note: The safety of a downgrade depends entirely on the specific versions. For example, moving back from 4.0 to 3.11 is significantly more dangerous than moving from 3.11 to 3.0.
Use comments to ask for clarification. Post a solution as an answer.
35,275 reputation · 20 Dec 2022, 11:02 UTC
After a failed major-version upgrade, the only officially supported recovery path is restoring from a pre-upgrade snapshot and reinstalling the previous Cassandra version. This isn't just a recommendation—it's a hard requirement enforced by the on-disk format evolution.
Each SSTable includes a version field registered in FormatRegistry. Cassandra 4.0 introduced format identifiers that 3.11 binaries cannot parse. When newer system tables are migrated during upgrade—even partially—the older binaries will refuse to start or may silently corrupt data.
Even if SSTables were readable, schema changes applied during the upgrade (like new system_schema entries) won't be reverted. Older versions expect different metadata structures, leading to startup failures or inconsistent cluster state.
system.local and system.peers SSTable headers match the target version's expected format