diff --git a/HISTORY.md b/HISTORY.md index 7d667d9620..91f28f3e2e 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,6 +1,38 @@ # Rocksdb Change Log > NOTE: Entries for next release do not go here. Follow instructions in `unreleased_history/README.txt` +## 8.4.0 (06/26/2023) +### New Features +* Add FSReadRequest::fs_scratch which is a data buffer allocated and provided by underlying FileSystem to RocksDB during reads, when FS wants to provide its own buffer with data instead of using RocksDB provided FSReadRequest::scratch. This can help in cpu optimization by avoiding copy from file system's buffer to RocksDB buffer. More details on how to use/enable it in file_system.h. Right now its supported only for MultiReads(async + sync) with non direct io. +* Start logging non-zero user-defined timestamp sizes in WAL to signal user key format in subsequent records and use it during recovery. This change will break recovery from WAL files written by early versions that contain user-defined timestamps. The workaround is to ensure there are no WAL files to recover (i.e. by flushing before close) before upgrade. +* Added new property "rocksdb.obsolete-sst-files-size-property" that reports the size of SST files that have become obsolete but have not yet been deleted or scheduled for deletion +* Start to record the value of the flag `AdvancedColumnFamilyOptions.persist_user_defined_timestamps` in the Manifest and table properties for a SST file when it is created. And use the recorded flag when creating a table reader for the SST file. This flag is only explicitly record if it's false. +* Add a new option OptimisticTransactionDBOptions::shared_lock_buckets that enables sharing mutexes for validating transactions between DB instances, for better balancing memory efficiency and validation contention across DB instances. Different column families and DBs also now use different hash seeds in this validation, so that the same set of key names will not contend across DBs or column families. +* Add a new ticker `rocksdb.files.marked.trash.deleted` to track the number of trash files deleted by background thread from the trash queue. +* Add an API NewTieredVolatileCache() in include/rocksdb/cache.h to allocate an instance of a block cache with a primary block cache tier and a compressed secondary cache tier. A cache of this type distributes memory reservations against the block cache, such as WriteBufferManager, table reader memory etc., proportionally across both the primary and compressed secondary cache. +* Add `WaitForCompact()` to wait for all flush and compactions jobs to finish. Jobs to wait include the unscheduled (queued, but not scheduled yet). +* Add `WriteBatch::Release()` that releases the batch's serialized data to the caller. + +### Public API Changes +* Add parameter `deletion_ratio` to C API `rocksdb_options_add_compact_on_deletion_collector_factory`. +* change the FileSystem::use_async_io() API to SupportedOps API in order to extend it to various operations supported by underlying FileSystem. Right now it contains FSSupportedOps::kAsyncIO and FSSupportedOps::kFSBuffer. More details about FSSupportedOps in filesystem.h +* Add new tickers: `rocksdb.error.handler.bg.error.count`, `rocksdb.error.handler.bg.io.error.count`, `rocksdb.error.handler.bg.retryable.io.error.count` to replace the misspelled ones: `rocksdb.error.handler.bg.errro.count`, `rocksdb.error.handler.bg.io.errro.count`, `rocksdb.error.handler.bg.retryable.io.errro.count` ('error' instead of 'errro'). Users should switch to use the new tickers before 9.0 release as the misspelled old tickers will be completely removed then. +* Overload the API CreateColumnFamilyWithImport() to support creating ColumnFamily by importing multiple ColumnFamilies It requires that CFs should not overlap in user key range. + +### Behavior Changes +* Change the default value for option `level_compaction_dynamic_level_bytes` to true. This affects users who use leveled compaction and do not set this option explicitly. These users may see additional background compactions following DB open. These compactions help to shape the LSM according to `level_compaction_dynamic_level_bytes` such that the size of each level Ln is approximately size of Ln-1 * `max_bytes_for_level_multiplier`. Turning on this option has other benefits too: see more detail in wiki: https://github.com/facebook/rocksdb/wiki/Leveled-Compaction#option-level_compaction_dynamic_level_bytes-and-levels-target-size and in option comment in advanced_options.h (#11525). +* For Leveled Compaction users, `CompactRange()` will now always try to compact to the last non-empty level. (#11468) +For Leveled Compaction users, `CompactRange()` with `bottommost_level_compaction = BottommostLevelCompaction::kIfHaveCompactionFilter` will behave similar to `kForceOptimized` in that it will skip files created during this manual compaction when compacting files in the bottommost level. (#11468) +* RocksDB will try to drop range tombstones during non-bottommost compaction when it is safe to do so. (#11459) +* When a DB is openend with `allow_ingest_behind=true` (currently only Universal compaction is supported), files in the last level, i.e. the ingested files, will not be included in any compaction. (#11489) +* Statistics `rocksdb.sst.read.micros` scope is expanded to all SST reads except for file ingestion and column family import (some compaction reads were previously excluded). + +### Bug Fixes +* Reduced cases of illegally using Env::Default() during static destruction by never destroying the internal PosixEnv itself (except for builds checking for memory leaks). (#11538) +* Fix extra prefetching during seek in async_io when BlockBasedTableOptions.num_file_reads_for_auto_readahead is 1 leading to extra reads than required. +* Fix a bug where compactions that are qualified to be run as 2 subcompactions were only run as one subcompaction. +* Fix a use-after-move bug in block.cc. + ## 8.3.0 (05/19/2023) ### New Features * Introduced a new option `block_protection_bytes_per_key`, which can be used to enable per key-value integrity protection for in-memory blocks in block cache (#11287). diff --git a/include/rocksdb/version.h b/include/rocksdb/version.h index d2cf4eb082..1b934a79f5 100644 --- a/include/rocksdb/version.h +++ b/include/rocksdb/version.h @@ -12,7 +12,7 @@ // NOTE: in 'main' development branch, this should be the *next* // minor or major version number planned for release. #define ROCKSDB_MAJOR 8 -#define ROCKSDB_MINOR 4 +#define ROCKSDB_MINOR 5 #define ROCKSDB_PATCH 0 // Do not use these. We made the mistake of declaring macros starting with diff --git a/tools/check_format_compatible.sh b/tools/check_format_compatible.sh index 290010a726..6403b2675b 100755 --- a/tools/check_format_compatible.sh +++ b/tools/check_format_compatible.sh @@ -125,7 +125,7 @@ EOF # To check for DB forward compatibility with loading options (old version # reading data from new), as well as backward compatibility -declare -a db_forward_with_options_refs=("6.27.fb" "6.28.fb" "6.29.fb" "7.0.fb" "7.1.fb" "7.2.fb" "7.3.fb" "7.4.fb" "7.5.fb" "7.6.fb" "7.7.fb" "7.8.fb" "7.9.fb" "7.10.fb" "8.0.fb" "8.1.fb" "8.2.fb" "8.3.fb") +declare -a db_forward_with_options_refs=("6.27.fb" "6.28.fb" "6.29.fb" "7.0.fb" "7.1.fb" "7.2.fb" "7.3.fb" "7.4.fb" "7.5.fb" "7.6.fb" "7.7.fb" "7.8.fb" "7.9.fb" "7.10.fb" "8.0.fb" "8.1.fb" "8.2.fb" "8.3.fb" "8.4.fb") # To check for DB forward compatibility without loading options (in addition # to the "with loading options" set), as well as backward compatibility declare -a db_forward_no_options_refs=() # N/A at the moment diff --git a/unreleased_history/behavior_changes/010_default_level_dynamic.md b/unreleased_history/behavior_changes/010_default_level_dynamic.md deleted file mode 100644 index 3382a7e4b1..0000000000 --- a/unreleased_history/behavior_changes/010_default_level_dynamic.md +++ /dev/null @@ -1 +0,0 @@ -Change the default value for option `level_compaction_dynamic_level_bytes` to true. This affects users who use leveled compaction and do not set this option explicitly. These users may see additional background compactions following DB open. These compactions help to shape the LSM according to `level_compaction_dynamic_level_bytes` such that the size of each level Ln is approximately size of Ln-1 * `max_bytes_for_level_multiplier`. Turning on this option has other benefits too: see more detail in wiki: https://github.com/facebook/rocksdb/wiki/Leveled-Compaction#option-level_compaction_dynamic_level_bytes-and-levels-target-size and in option comment in advanced_options.h (#11525). \ No newline at end of file diff --git a/unreleased_history/behavior_changes/compact_range_to_bottom.md b/unreleased_history/behavior_changes/compact_range_to_bottom.md deleted file mode 100644 index 480caed1ed..0000000000 --- a/unreleased_history/behavior_changes/compact_range_to_bottom.md +++ /dev/null @@ -1,2 +0,0 @@ -For Leveled Compaction users, `CompactRange()` will now always try to compact to the last non-empty level. (#11468) -For Leveled Compaction users, `CompactRange()` with `bottommost_level_compaction = BottommostLevelCompaction::kIfHaveCompactionFilter` will behave similar to `kForceOptimized` in that it will skip files created during this manual compaction when compacting files in the bottommost level. (#11468) \ No newline at end of file diff --git a/unreleased_history/behavior_changes/drop_range_tombstone.md b/unreleased_history/behavior_changes/drop_range_tombstone.md deleted file mode 100644 index 2577802c99..0000000000 --- a/unreleased_history/behavior_changes/drop_range_tombstone.md +++ /dev/null @@ -1 +0,0 @@ -RocksDB will try to drop range tombstones during non-bottommost compaction when it is safe to do so. (#11459) \ No newline at end of file diff --git a/unreleased_history/behavior_changes/ingest_behind_universal.md b/unreleased_history/behavior_changes/ingest_behind_universal.md deleted file mode 100644 index 50d120562e..0000000000 --- a/unreleased_history/behavior_changes/ingest_behind_universal.md +++ /dev/null @@ -1 +0,0 @@ -When a DB is openend with `allow_ingest_behind=true` (currently only Universal compaction is supported), files in the last level, i.e. the ingested files, will not be included in any compaction. (#11489) diff --git a/unreleased_history/behavior_changes/sst_read_micros.md b/unreleased_history/behavior_changes/sst_read_micros.md deleted file mode 100644 index 99924f225d..0000000000 --- a/unreleased_history/behavior_changes/sst_read_micros.md +++ /dev/null @@ -1 +0,0 @@ -* Statistics `rocksdb.sst.read.micros` scope is expanded to all SST reads except for file ingestion and column family import (some compaction reads were previously excluded). diff --git a/unreleased_history/bug_fixes/destroy_posix_env.md b/unreleased_history/bug_fixes/destroy_posix_env.md deleted file mode 100644 index 396640d6b8..0000000000 --- a/unreleased_history/bug_fixes/destroy_posix_env.md +++ /dev/null @@ -1 +0,0 @@ -Reduced cases of illegally using Env::Default() during static destruction by never destroying the internal PosixEnv itself (except for builds checking for memory leaks). (#11538) diff --git a/unreleased_history/bug_fixes/seek_extraprefetch.md b/unreleased_history/bug_fixes/seek_extraprefetch.md deleted file mode 100644 index d3310f8180..0000000000 --- a/unreleased_history/bug_fixes/seek_extraprefetch.md +++ /dev/null @@ -1 +0,0 @@ -Fix extra prefetching during seek in async_io when BlockBasedTableOptions.num_file_reads_for_auto_readahead_ = 1 leading to extra reads than required. diff --git a/unreleased_history/bug_fixes/subcompaction_2.md b/unreleased_history/bug_fixes/subcompaction_2.md deleted file mode 100644 index b56fc5deae..0000000000 --- a/unreleased_history/bug_fixes/subcompaction_2.md +++ /dev/null @@ -1 +0,0 @@ -Fix a bug where compactions that are qualified to be run as 2 subcompactions were only run as one subcompaction. \ No newline at end of file diff --git a/unreleased_history/bug_fixes/use_after_move_in_block.md b/unreleased_history/bug_fixes/use_after_move_in_block.md deleted file mode 100644 index 019ef16276..0000000000 --- a/unreleased_history/bug_fixes/use_after_move_in_block.md +++ /dev/null @@ -1 +0,0 @@ -*Fix a use-after-move bug in block.cc. \ No newline at end of file diff --git a/unreleased_history/new_features/fs_provided_buffer.md b/unreleased_history/new_features/fs_provided_buffer.md deleted file mode 100644 index 8979f5c4e0..0000000000 --- a/unreleased_history/new_features/fs_provided_buffer.md +++ /dev/null @@ -1 +0,0 @@ -Add FSReadRequest::fs_scratch which is a data buffer allocated and provided by underlying FileSystem to RocksDB during reads, when FS wants to provide its own buffer with data instead of using RocksDB provided FSReadRequest::scratch. This can help in cpu optimization by avoiding copy from file system's buffer to RocksDB buffer. More details on how to use/enable it in file_system.h. Right now its supported only for MultiReads(async + sync) with non direct io. diff --git a/unreleased_history/new_features/logging_udt_sizes.md b/unreleased_history/new_features/logging_udt_sizes.md deleted file mode 100644 index b87ec0dfd2..0000000000 --- a/unreleased_history/new_features/logging_udt_sizes.md +++ /dev/null @@ -1 +0,0 @@ -Start logging non-zero user-defined timestamp sizes in WAL to signal user key format in subsequent records and use it during recovery. This change will break recovery from WAL files written by early versions that contain user-defined timestamps. The workaround is to ensure there are no WAL files to recover (i.e. by flushing before close) before upgrade. \ No newline at end of file diff --git a/unreleased_history/new_features/obsolete_sst_files_size.md b/unreleased_history/new_features/obsolete_sst_files_size.md deleted file mode 100644 index b70c2dc014..0000000000 --- a/unreleased_history/new_features/obsolete_sst_files_size.md +++ /dev/null @@ -1 +0,0 @@ -Added new property "rocksdb.obsolete-sst-files-size-property" that reports the size of SST files that have become obsolete but have not yet been deleted or scheduled for deletion diff --git a/unreleased_history/new_features/persist_udt_flag_in_manifest.md b/unreleased_history/new_features/persist_udt_flag_in_manifest.md deleted file mode 100644 index 13c0c0a700..0000000000 --- a/unreleased_history/new_features/persist_udt_flag_in_manifest.md +++ /dev/null @@ -1 +0,0 @@ -*Start to record the value of the flag `AdvancedColumnFamilyOptions.persist_user_defined_timestamps` in the Manifest and table properties for a SST file when it is created. And use the recorded flag when creating a table reader for the SST file. This flag is only explicitly record if it's false. \ No newline at end of file diff --git a/unreleased_history/new_features/shared_lock_buckets.md b/unreleased_history/new_features/shared_lock_buckets.md deleted file mode 100644 index 5c6905333b..0000000000 --- a/unreleased_history/new_features/shared_lock_buckets.md +++ /dev/null @@ -1 +0,0 @@ -* Add a new option OptimisticTransactionDBOptions::shared_lock_buckets that enables sharing mutexes for validating transactions between DB instances, for better balancing memory efficiency and validation contention across DB instances. Different column families and DBs also now use different hash seeds in this validation, so that the same set of key names will not contend across DBs or column families. diff --git a/unreleased_history/new_features/ticker_for_deleted_trash_files.md b/unreleased_history/new_features/ticker_for_deleted_trash_files.md deleted file mode 100644 index a97164e2e6..0000000000 --- a/unreleased_history/new_features/ticker_for_deleted_trash_files.md +++ /dev/null @@ -1 +0,0 @@ -*Add a new ticker `rocksdb.files.marked.trash.deleted` to track the number of trash files deleted by background thread from the trash queue. \ No newline at end of file diff --git a/unreleased_history/new_features/tiered_volatile_cache.md b/unreleased_history/new_features/tiered_volatile_cache.md deleted file mode 100644 index 49bc1f90be..0000000000 --- a/unreleased_history/new_features/tiered_volatile_cache.md +++ /dev/null @@ -1 +0,0 @@ -Add an API NewTieredVolatileCache() in include/rocksdb/cache.h to allocate an instance of a block cache with a primary block cache tier and a compressed secondary cache tier. A cache of this type distributes memory reservations against the block cache, such as WriteBufferManager, table reader memory etc., proportionally across both the primary and compressed secondary cache. diff --git a/unreleased_history/new_features/wait_for_compact.md b/unreleased_history/new_features/wait_for_compact.md deleted file mode 100644 index 3fd7cf6f14..0000000000 --- a/unreleased_history/new_features/wait_for_compact.md +++ /dev/null @@ -1 +0,0 @@ -Add `WaitForCompact()` to wait for all flush and compactions jobs to finish. Jobs to wait include the unscheduled (queued, but not scheduled yet). diff --git a/unreleased_history/new_features/writebatchrelease.md b/unreleased_history/new_features/writebatchrelease.md deleted file mode 100644 index d0a3c015dc..0000000000 --- a/unreleased_history/new_features/writebatchrelease.md +++ /dev/null @@ -1 +0,0 @@ -Add `WriteBatch::Release()` that releases the batch's serialized data to the caller. diff --git a/unreleased_history/public_api_changes/add_new_compaction_parameter.md b/unreleased_history/public_api_changes/add_new_compaction_parameter.md deleted file mode 100644 index 4278ff4a6a..0000000000 --- a/unreleased_history/public_api_changes/add_new_compaction_parameter.md +++ /dev/null @@ -1 +0,0 @@ -Add parameter `deletion_ratio` to C API `rocksdb_options_add_compact_on_deletion_collector_factory`. \ No newline at end of file diff --git a/unreleased_history/public_api_changes/change_async_io_api.md b/unreleased_history/public_api_changes/change_async_io_api.md deleted file mode 100644 index 88f16367db..0000000000 --- a/unreleased_history/public_api_changes/change_async_io_api.md +++ /dev/null @@ -1 +0,0 @@ -change the FileSystem::use_async_io() API to SupportedOps API in order to extend it to various operations supported by underlying FileSystem. Right now it contains FSSupportedOps::kAsyncIO and FSSupportedOps::kFSBuffer. More details about FSSupportedOps in filesystem.h diff --git a/unreleased_history/public_api_changes/fix_tickers_typo.md b/unreleased_history/public_api_changes/fix_tickers_typo.md deleted file mode 100644 index eb789d5fce..0000000000 --- a/unreleased_history/public_api_changes/fix_tickers_typo.md +++ /dev/null @@ -1 +0,0 @@ -Add new tickers: `rocksdb.error.handler.bg.error.count`, `rocksdb.error.handler.bg.io.error.count`, `rocksdb.error.handler.bg.retryable.io.error.count` to replace the misspelled ones: `rocksdb.error.handler.bg.errro.count`, `rocksdb.error.handler.bg.io.errro.count`, `rocksdb.error.handler.bg.retryable.io.errro.count` ('error' instead of 'errro'). Users should switch to use the new tickers before 9.0 release as the misspelled old tickers will be completely removed then. diff --git a/unreleased_history/public_api_changes/support_create_cf_with_import_multiple_cf.md b/unreleased_history/public_api_changes/support_create_cf_with_import_multiple_cf.md deleted file mode 100644 index 4cf48de1f1..0000000000 --- a/unreleased_history/public_api_changes/support_create_cf_with_import_multiple_cf.md +++ /dev/null @@ -1 +0,0 @@ -Overload the API CreateColumnFamilyWithImport() to support creating ColumnFamily by importing multiple ColumnFamilies It requires that CFs should not overlap in user key range.