rocksdb/java
Peter Dillinger 87c554b492
Some checks failed
clang-tidy / clang-tidy (push) Has been cancelled
facebook/rocksdb/pr-jobs / config (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-gcc-14-no_test_run (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-unity-and-headers (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-mini-crashtest (240, blackbox_crash_test) (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-mini-crashtest (480, blackbox_crash_test_with_atomic_flush) (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-macos-cmake (3) (push) Has been cancelled
facebook/rocksdb/pr-jobs / check-format-and-targets (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-cmake-mingw (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-make-with-folly (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-make-with-folly-lite-no-test (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-cmake-with-folly-coroutines (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-cmake-with-benchmark-no-thread-status (0) (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-cmake-with-benchmark-no-thread-status (1) (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-cmake-with-benchmark-no-thread-status (2) (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-cmake-with-benchmark-no-thread-status (3) (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-encrypted_env-no_compression (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-release (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-clang-13-no_test_run (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-clang-21-no_test_run (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-clang21-asan-ubsan (0) (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-clang21-asan-ubsan (1) (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-clang21-asan-ubsan (2) (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-clang21-mini-tsan (0) (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-clang21-mini-tsan (1) (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-macos-cmake (0) (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-clang21-mini-tsan (2) (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-static_lib-alt_namespace-status_checked (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-macos (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-macos-cmake (1) (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-macos-cmake (2) (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-windows-vs2022 (false, arena_test,db_basic_test,db_test2,db_merge_operand_test,bloom_test,c_test,coding_test,crc32c_test,dynamic_bloom_test,env_basic_test,env_test,hash_test,random_test, other) (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-windows-vs2022 (false, db_test, db_test) (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-windows-vs2022 (true, , java) (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-java (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-java-static (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-macos-java (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-macos-java-static (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-macos-java-static-universal (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-java-pmd (push) Has been cancelled
facebook/rocksdb/pr-jobs / build-linux-arm (push) Has been cancelled
Persist compacted manifest size for auto-tuning across DB::Open (#14725)
Summary:
last_compacted_manifest_file_size_ drives TuneMaxManifestFileSize() to compute the manifest rotation threshold, but it started at 0 on every DB::Open and was only populated after the first manifest rotation. This is really only a problem with reuse_manifest_on_open, because no fresh manifest is created on open.

Add a new forward-compatible (safe-to-ignore) MANIFEST tag kLastCompactedManifestFileSize that records the approximate compacted manifest size at the end of WriteCurrentStateToManifest. During recovery, the value is loaded and used to immediately tune the rotation threshold.

The record includes a rough estimate of its own overhead (~15 bytes) and must be the last record written by WriteCurrentStateToManifest for accurate estimation.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/14725

Test Plan:
Extended AutoTuneManifestSize in db_etc3_test to close and reopen with reuse_manifest_on_open after establishing a known auto-tuning state. Verifies that the manifest file number is preserved (no spurious rotation) and that subsequent CF additions don't trigger rotation -- proving the persisted compacted size keeps the tuned threshold correct. Verified the test fails when the recovery loading is disabled.

Relax a fragile Java test that was dependent on the exact size of the manifest file.

SHORT_TEST=1 ./tools/check_format_compatible.sh

Reviewed By: anand1976

Differential Revision: D104464522

Pulled By: pdillinger

fbshipit-source-id: 4f5d22d2e149bd40a523ee11780e5e3344803c19
2026-05-13 18:31:49 -07:00
..
benchmark/src/main/java/org/rocksdb/benchmark Remove deprecated Options::access_hint_on_compaction_start (#11654) 2024-02-05 13:35:19 -08:00
crossbuild Pass build parallelism flag to Docker builds (#12392) 2024-02-28 12:51:00 -08:00
jmh JNI get_helper code sharing / multiGet() use efficient batch C++ support (#12344) 2024-03-12 12:42:08 -07:00
rocksjni Add MANIFEST_VALIDATION_FAILURE_COUNT statistic (#14657) 2026-04-24 15:22:15 -07:00
samples/src/main/java Remove compressed block cache (#11117) 2023-01-24 17:09:19 -08:00
src Persist compacted manifest size for auto-tuning across DB::Open (#14725) 2026-05-13 18:31:49 -07:00
CMakeLists.txt Add interpolation search as an alternative to binary search (#14247) 2026-02-13 17:15:10 -08:00
GetPutBenchmarks.md Java API consistency between RocksDB.put() , .merge() and Transaction.put() , .merge() (#11019) 2023-12-11 11:03:17 -08:00
HISTORY-JAVA.md Update JAVA-HISTORY.md for v3.13 2015-08-04 18:12:58 -07:00
jdb_bench.sh Add copyright headers per FB open-source checkup tool. (#5199) 2019-04-18 10:55:01 -07:00
Makefile Add native logger support to RocksJava (#12213) 2024-01-17 17:51:36 -08:00
pmd-rules.xml Java API consistency between RocksDB.put() , .merge() and Transaction.put() , .merge() (#11019) 2023-12-11 11:03:17 -08:00
pom.xml.template Perform java static checks in CI (#11221) 2023-10-17 10:04:35 -07:00
RELEASE.md Add shared library for musl-libc (#3143) 2019-11-26 18:24:09 -08:00
spotbugs-exclude.xml Perform java static checks in CI (#11221) 2023-10-17 10:04:35 -07:00
understanding_options.md New-style blob option bindings, Java option getter and improve/fix option parsing (#8999) 2021-10-19 09:21:52 -07:00