sstabledowngrade
Downgrades the SSTables in the given table or snapshot to the version of Apache Cassandra® that is compatible with the current version of Hyper-Converged Database (HCD) while the HCD node is offline.
Downgrades the SSTables in the given table or snapshot to the version of Cassandra that is compatible with the current version of HCD while the HCD node is offline.
The |
Stop HCD before you run this command. |
The default location of this SSTable tool depends on your installation type:
-
Package installations:
/usr/bin/
-
Tarball installations:
<installation_location>/resources/cassandra/tools/bin
Synopsis
sstabledowngrade
[--debug]
[-h | --help]
[[-k | --keep-source] | [--keep-generation]]
[-b | --backups]
[-o | --output-dir <output-dir>]
[--schema <schema-file> [--schema <schema-file2> ... ]]
[--sstable-files <sstable>]
[-t | --throughput <rate-limit>]
[--temp-storage <tmp-dir>]
<keyspace_name>
<table_name>
[<snapshot_name>]
SSTable versions
For details on SSTable versions and compatibility, see HCD, Apache Cassandra, CQL, and SSTable compatibility.
Definition
The short- and long-form options are comma-separated.
Command arguments
- --debug
-
Display stack traces.
- -h, --help
-
Print the usage and listing of the commands.
- -k, --keep-source
-
Don’t delete the source SSTables. Don’t use with the
--keep-generation
option. - -b, --backups
-
Rewrite incremental backups for the given table. Cannot be combined with the
snapshot_name
option. - --keep-generation
-
Keep the generated SSTables. Don’t use with the
--keep-source
option. - -o, --output-dir
-
Rewritten files are placed in
output-dir/keyspace-name/table-name-and-id
. - --schema
-
Allows upgrading and downgrading SSTables using the schema of the table in a CQL file containing the DDL statements to re-create the schema. Must be a DDL file that allows the recreation of the table including dropped columns. Repeat the option to specify multiple DDL schema files.
Always use the
schema.cql
from a snapshot of the table so that the DDL has all of the information omitted byDESCRIBE TABLE
, including dropped columns. - --sstable-files
-
Instead of processing all SSTables in the default data directories, process only the tables specified via this option. If a single SSTable file, only that SSTable is processed. If a directory is specified, all SSTables within that directory are processed. Snapshots and backups are not supported with this option.
- -t, --throughput
-
Set to limit the maximum disk read rate in MB/s.
- --temp-storage
-
When used with
--schema
, specifies location of temporary data. Directory and contents are deleted when the tool terminates. Directory must not be shared with other tools and must be empty. If not specified the default directory is/tmp
. - keyspace_name
-
Keyspace name. Required.
- table_name
-
Table name. Required.
- snapshot_name
-
Snapshot name.
-
Rewrites only the specified snapshot.
-
Replaces files in the given snapshot and breaks any hard links to live SSTables.
-
Required when attempting to restore a snapshot taken in a different HCD version than the one that is currently running.
-
Examples
The following example demonstrates how to use the sstabledowngrade
command.
Stop HCD before you run this command. |
Downgrade events
table in the cycling
keyspace:
sstabledowngrade cycling events
Found 1 sstables to rewrite.
Rewriting TrieIndexSSTableReader(path='/var/lib/cassandra/data/cycling/events-2118bc7054af11e987feb76774f7ab56/aa-1-bti-Data.db') to BIG/mc.
Rewrite of TrieIndexSSTableReader(path='/var/lib/cassandra/data/cycling/events-2118bc7054af11e987feb76774f7ab56/aa-1-bti-Data.db') to BIG/mc complete.