scylladb / scylla-tools-java

Apache Cassandra, supplying tools for Scylla
Apache License 2.0
53 stars 85 forks source link

patch java tools print a message when they see a UUID generation #360

Closed tchaikov closed 11 months ago

tchaikov commented 11 months ago

since scylla 5.4, the sstables are named with a uuid-based identifier instead of integer-based one. so the java tools inherited from cassandra 3.x branch do not support it, and throw exception, like

root@df13a4d04afa:/var/lib/scylla/data/foo/bar-eb90daf0952d11ee87e220c83109c794# sstablemetadata 'me-3gbp_1glu_4e6g020ns4px173el0-big-Data.db'
Exception in thread "main" java.lang.NumberFormatException: For input string: "3gbp_1glu_4e6g020ns4px173el0"
    at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.base/java.lang.Integer.parseInt(Integer.java:652)
    at java.base/java.lang.Integer.parseInt(Integer.java:770)
    at org.apache.cassandra.io.sstable.Descriptor.fromFilename(Descriptor.java:280)
    at org.apache.cassandra.io.sstable.Descriptor.fromFilename(Descriptor.java:228)
    at org.apache.cassandra.io.sstable.Descriptor.fromFilename(Descriptor.java:217)
    at org.apache.cassandra.tools.SSTableMetadataViewer.main(SSTableMetadataViewer.java:150)
root@df13a4d04afa:/var/lib/scylla/data/foo/bar-eb90daf0952d11ee87e220c83109c794# sstabledump 'me-3gbp_1glu_4e6g020ns4px173el0-big-Data.db'
Exception in thread "main" java.lang.NumberFormatException: For input string: "3gbp_1glu_4e6g020ns4px173el0"
    at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.base/java.lang.Integer.parseInt(Integer.java:652)
    at java.base/java.lang.Integer.parseInt(Integer.java:770)
    at org.apache.cassandra.io.sstable.Descriptor.fromFilename(Descriptor.java:280)
    at org.apache.cassandra.io.sstable.Descriptor.fromFilename(Descriptor.java:228)
    at org.apache.cassandra.io.sstable.Descriptor.fromFilename(Descriptor.java:217)
    at org.apache.cassandra.tools.SSTableExport.run(SSTableExport.java:188)
    at com.scylladb.tools.SSTableExport.main(SSTableExport.java:44)

we should patch java tools print a message when they see a UUID generation, telling the user to use the native tools for sstables with UUID generation.

mykaul commented 11 months ago

This is very important to fix, as the user experience is very poor.

mykaul commented 11 months ago

I assume we'll have also a backport to 5.4 of the submodule update?

denesb commented 11 months ago

Backported to 5.4 as https://github.com/scylladb/scylla-tools-java/commit/f9cce789dab102193354f75c38b8bc6648c87b59 and https://github.com/scylladb/scylladb/commit/0518e47daf3a0e704cd8c0db1be81af7f1978958.