This is an automated email from the ASF dual-hosted git repository.
brandonwilliams pushed a commit to branch cassandra-3.11
in repository https://gitbox.apache.org/repos/asf/cassandra.git
The following commit(s) were added to refs/heads/cassandra-3.11 by this push:
new ec1195b Standalone scrub validates keys
ec1195b is described below
commit ec1195bed76b17a150371810c78413e6cb9c7049
Author: Brandon Williams <[email protected]>
AuthorDate: Fri Sep 17 16:46:07 2021 -0500
Standalone scrub validates keys
Patch by brandonwilliams; reviewed by blerer for CASSANDRA-16969
---
CHANGES.txt | 1 +
src/java/org/apache/cassandra/db/compaction/Scrubber.java | 5 ++++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/CHANGES.txt b/CHANGES.txt
index e70d3d7..84f02c4 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
3.11.12
+ * Add key validation to ssstablescrub (CASSANDRA-16969)
* Update Jackson from 2.9.10 to 2.12.5 (CASSANDRA-16851)
* Include SASI components to snapshots (CASSANDRA-15134)
* Make assassinate more resilient to missing tokens (CASSANDRA-16847)
diff --git a/src/java/org/apache/cassandra/db/compaction/Scrubber.java
b/src/java/org/apache/cassandra/db/compaction/Scrubber.java
index 8767873..c5c9d78 100644
--- a/src/java/org/apache/cassandra/db/compaction/Scrubber.java
+++ b/src/java/org/apache/cassandra/db/compaction/Scrubber.java
@@ -189,7 +189,9 @@ public class Scrubber implements Closeable
DecoratedKey key = null;
try
{
- key =
sstable.decorateKey(ByteBufferUtil.readWithShortLength(dataFile));
+ ByteBuffer raw =
ByteBufferUtil.readWithShortLength(dataFile);
+ cfs.metadata.getKeyValidator().validate(raw);
+ key = sstable.decorateKey(raw);
}
catch (Throwable th)
{
@@ -247,6 +249,7 @@ public class Scrubber implements Closeable
key = sstable.decorateKey(currentIndexKey);
try
{
+
cfs.metadata.getKeyValidator().validate(key.getKey());
dataFile.seek(dataStartFromIndex);
if (tryAppend(prevKey, key, writer))
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]