smengcl opened a new pull request, #11633:
URL: https://github.com/apache/ozone/pull/11633

   Generated-by: Claude Code (Opus 5.5)
   
   ## What changes were proposed in this pull request?
   
   HDDS-14225 pinned the RocksDB block-based table `format_version` to 5 
(`ManagedBlockBasedTableConfig.FORMAT_VERSION`) in `DBProfile` and 
`RDBSstFileWriter`, so SST files stay readable by RocksDB 7.7.3 (Ozone 2.2.x) 
until finalization.
   
   `OmSnapshotManager` opens the snapshot diff DB (`db.snapdiff`) with a plain 
`ManagedColumnFamilyOptions` and bypasses `DBProfile`, so it gets RocksDB's 
default `format_version` (6 with rocksdbjni 10.10.1.1, 7 with 11.8.1). RocksDB 
older than 8.6 can read neither. After a downgrade before finalization, an OM 
that ran a snapshot diff job fails to start:
   
   ```
   java.lang.RuntimeException: org.rocksdb.RocksDBException: Corrupt or 
unsupported format_version: 7 in file /data/metadata/db.snapdiff/MANIFEST-000037
   ```
   
   This PR sets a `ManagedBlockBasedTableConfig` with `FORMAT_VERSION` on the 
`db.snapdiff` column family options. The default CF, existing CFs and newly 
created CFs are all derived from those options, and the table config is closed 
by the existing `ManagedColumnFamilyOptions.closeDeeply`. All other RocksDB 
writers were checked; `db.snapdiff` is the only DB that bypasses the pin.
   
   A `db.snapdiff` written before this fix keeps its format 6/7 files until 
they are rewritten.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-17151
   
   ## How was this patch tested?
   
   Added `TestOmSnapshotManager#testSnapshotDiffDbFormatVersion`, which checks 
that every `format_version` in the latest `db.snapdiff` OPTIONS file equals 
`FORMAT_VERSION`. It fails without the fix (`["format_version=6", 
"format_version=6", "format_version=6", "format_version=6"]`). With the fix, 
all 18 tests in `TestOmSnapshotManager` pass.
   
   The issue was found by a manual downgrade test in the `upgrade/compose/ha` 
cluster (2.2.1 to master with RocksDB 11.8.1, pre-finalized, back to 2.2.1), 
where the OM that had run a snapshot diff failed to start.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to