mirror of https://github.com/apache/cassandra
fix intermittent failures in nodetool toppartitions caused by failure to validate invalid bytes
Patch by Jordan West; Reviewed by Brandon Williams and Cheng Wang for CASSANDRA-17254
This commit is contained in:
parent
d9ef794ef6
commit
13d495aa7d
|
|
@ -1,5 +1,6 @@
|
|||
3.0.29
|
||||
* Fix running Ant rat targets without git (CASSANDRA-17974)
|
||||
* Fix intermittent failure in nodetool toppartitions (CASSANDRA-17254)
|
||||
|
||||
|
||||
3.0.28
|
||||
|
|
|
|||
|
|
@ -1625,12 +1625,14 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
|
|||
TabularDataSupport result = new TabularDataSupport(COUNTER_TYPE);
|
||||
for (Counter<ByteBuffer> counter : samplerResults.topK)
|
||||
{
|
||||
byte[] key = counter.getItem().array();
|
||||
//Not duplicating the buffer for safety because AbstractSerializer and ByteBufferUtil.bytesToHex
|
||||
//don't modify position or limit
|
||||
ByteBuffer key = counter.getItem();
|
||||
result.put(new CompositeDataSupport(COUNTER_COMPOSITE_TYPE, COUNTER_NAMES, new Object[] {
|
||||
Hex.bytesToHex(key), // raw
|
||||
counter.getCount(), // count
|
||||
counter.getError(), // error
|
||||
metadata.getKeyValidator().getString(ByteBuffer.wrap(key)) })); // string
|
||||
ByteBufferUtil.bytesToHex(key), // raw
|
||||
counter.getCount(), // count
|
||||
counter.getError(), // error
|
||||
metadata.getKeyValidator().getString(key) })); // string
|
||||
}
|
||||
return new CompositeDataSupport(SAMPLING_RESULT, SAMPLER_NAMES, new Object[]{
|
||||
samplerResults.cardinality, result});
|
||||
|
|
|
|||
Loading…
Reference in New Issue