You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Brandon Williams (Jira)" <ji...@apache.org> on 2022/11/07 19:13:00 UTC

[jira] [Commented] (CASSANDRA-17254) nodetool toppartitions can fail because ByteBuffer.array() returns more bytes than would be considered valid by UTF8Serializer.validate

    [ https://issues.apache.org/jira/browse/CASSANDRA-17254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17629971#comment-17629971 ] 

Brandon Williams commented on CASSANDRA-17254:
----------------------------------------------

Can we add a test for this?

> nodetool toppartitions can fail because ByteBuffer.array() returns more bytes than would be considered valid by UTF8Serializer.validate
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-17254
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17254
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tool/nodetool
>            Reporter: Jordan West
>            Assignee: Jordan West
>            Priority: Normal
>             Fix For: 3.0.x, 3.11.x
>
>
> The error below is caused by the use of [{{ByteBuffer.array()}}|https://github.com/apache/cassandra/blob/cassandra-3.0/src/java/org/apache/cassandra/db/ColumnFamilyStore.java#L1628]. Doing so not only makes the hex key potentially incorrect but causes invalid data to be passed to {{AbstractType.getString}} and ultimately {{UTF8Validator.validate}}. 
> {code}
> error: String didn't validate.
> -- StackTrace --
> org.apache.cassandra.serializers.MarshalException: String didn't validate.
> 	at org.apache.cassandra.serializers.UTF8Serializer.validate(UTF8Serializer.java:35)
> 	at org.apache.cassandra.db.marshal.AbstractType.getString(AbstractType.java:129)
> 	at org.apache.cassandra.db.ColumnFamilyStore.finishLocalSampling(ColumnFamilyStore.java:1633)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org