You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fluss.apache.org by "morazow (via GitHub)" <gi...@apache.org> on 2026/10/11 11:07:06 UTC

[I] [kv] KV snapshots written after the RocksDB 11.8.1 fail to read on FRocksDB 6.20.3 clients [fluss]

morazow opened a new issue, #4597:
URL: https://github.com/apache/fluss/issues/4597

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/fluss/issues) and found nothing similar.
   
   
   ### Fluss version
   
   main (development)
   
   ### Please describe the bug 🐞
   
   After #4133 (RocksDB 11.8.1), a Fluss 1.0.0 client cannot read KV snapshots written by a server built from main. The 1.0.0 client still uses FRocksDB 6.20.3. A full snapshot scan of a primary-key table fails:
   
   ```
   org.rocksdb.RocksDBException: bad block contents
       at org.apache.fluss.rocksdb.RocksIteratorWrapper.status
       at org.apache.fluss.client.table.scanner.batch.SnapshotFilesReader.hasNext
       at org.apache.fluss.client.table.scanner.batch.KvSnapshotBatchScanner.pollBatch
   ```
   
   #4133 pins format_version=5 and the kCRC32c checksum to keep snapshots readable by FRocksDB 6.20.3. One more table option breaks that compatibility.
   
   RocksJava 11.8.1 defaults `BlockBasedTableConfig.uniformCvThreshold` to `0.2`. The C++ default is `-1`. With a threshold of 0 or more, RocksDB checks how evenly the keys in each index block are spaced. It sets an `is_uniform` flag, bit 29, in the block footer when they are evenly spaced. format_version does not affect this.
   
   FRocksDB 6.20.3 knows only bit 31 of that footer, the data-block hash index flag, and reads the other bits as the restart count. A set bit 29 gives a huge restart count, so the block constructor rejects the block and the iterator reports `"bad block contents"` (table/block_based/block.cc in 6.20.3).
   
   The existing compatibility test, RocksIncrementalSnapshotTest#testSnapshotCanBeReadByFrocksDB, does not catch this. It writes two keys. An index block needs at least 3 restart keys before RocksDB checks the spacing. Sequential integer primary keys, encoded big-endian, produce evenly spaced index keys and trigger the bit.
   
   Steps to reproduce: write 10,000 sequential 8-byte big-endian keys with the server's column family options, take a snapshot, download it, and scan it with FRocksDB 6.20.3. The scan fails with bad block contents.
   
   ### Solution
   
   Set uniformCvThreshold(-1) next to the existing format_version and checksum pins in RocksDBResourceContainer, so the bit is never written. Fluss does not configure an index search type, so the threshold has no effect on reads. Turning it off costs nothing.
   
   The fix belongs on the writer. Clients already released with FRocksDB 6.20.3 cannot be changed.
   
   ### Are you willing to submit a PR?
   
   - [x] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fluss.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [kv] KV snapshots written after the RocksDB 11.8.1 fail to read on FRocksDB 6.20.3 clients [fluss]

Posted by "platinumhamburg (via GitHub)" <gi...@apache.org>.
platinumhamburg closed issue #4597: [kv] KV snapshots written after the RocksDB 11.8.1 fail to read on FRocksDB 6.20.3 clients
URL: https://github.com/apache/fluss/issues/4597


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org