sstablescrub
The sstablescrub utility is an offline version of nodetool scrub.
It attempts to remove the corrupted parts while preserving non-corrupted data.
Because sstablescrub runs offline, it can correct errors that nodetool scrub cannot.
If an SSTable cannot be read due to corruption, it is left on disk.
If scrubbing results in dropping rows, new SSTables become unrepaired.
However, if no bad rows are detected, the SSTable keeps its original repairedAt field, which denotes the time of the repair.
Procedure
-
Before using
sstablescrub, try rebuilding the tables usingnodetool scrub.If
nodetool scrubdoes not fix the problem, usesstablescrub. -
Run the utility:
sstablescrub [--debug] [-e arg] [-h] [-j arg] [-m] [-n] [-r] [-s] [-t arg] [-v] keyspace_name table_name--debug-
Display stack traces.
-e,--header-fix argument-
Check SSTable serialization-headers and repair issues. Takes the following arguments:
-
validate-onlyValidate serialization-headers only. Do not attempt any repairs and do not continue with the scrub once the validation is complete.
-
validateValidate serialization-headers and continue with the scrub once the validation is complete. (Default)
-
fix-onlyValidate and repair only the serialization-headers. Do not continue with the scrub once serialization-header validation and repairs are complete.
-
fixValidate and repair serialization-headers and perform a normal scrub. Do not repair and do not continue with the scrub if serialization-header validation encounters errors.
-
offDo not perform serialization-header validation checks.
-
-h,--helpDisplay help.
-
-j,--jobsNumber of sstables to scrub simultaneously. Defaults to the minimum between either the number of available processors and 8.
-
-m,--manifest-checkOnly check and repair the leveled manifest, without actually scrubbing the SSTables.
-
--reinsert-overflowed-ttlRewrites SSTables containing rows with overflowed expiration time with the maximum expiration date of
2038-01-19T03:14:06+00:00using the original timestamp + 1 (ms). -
-s,--skip-corruptedSkip corrupt rows in counter tables.
-
-tGiven a number of days from
1to1000, examines all deletion times and changes the timestamp andlocal-deletion-timetonowif any deletion times are at least the number of days in the future specified by the argument.This is a destructive operation and should only be used under the guidance of DataStax support.
-
-v,--verboseVerbose output.
-