Skip to content

Commit

Permalink
Support Non-Blocking Manual Compactions (CompactRange) (#597)
Browse files Browse the repository at this point in the history
Add a new option to CompactRangeOptions, a callback object. By defaut,
the callback is empty so CompactRange() will be blocking (as it is now).
If the callback is set, the callback object's callback method will be
called upon completion with the completion status.
  • Loading branch information
udi-speedb committed Aug 29, 2023
1 parent 4209cf5 commit fac7588
Show file tree
Hide file tree
Showing 29 changed files with 1,430 additions and 241 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,7 @@ set(SOURCES
db/db_impl/db_impl_experimental.cc
db/db_impl/db_impl_readonly.cc
db/db_impl/db_impl_secondary.cc
db/db_impl/compact_range_threads_mngr.cc
db/db_info_dumper.cc
db/db_iter.cc
db/dbformat.cc
Expand Down
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

### New Features
* Non-Blocking Manual Compaction (CompactRange()) - Support non-blocking manual compactions by setting a new CompactRangeOptions option (async_completion_cb). When set, the CompactRange() call will return control to the caller immediately. The manual compaction iteslf will be performed in an internally created thread. The manual compaction will ALWAYS call the specified callback upon completion and provide the completion status (#597).

### Enhancements

Expand Down
2 changes: 2 additions & 0 deletions TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ cpp_library_wrapper(name="rocksdb_lib", srcs=[
"db/compaction/subcompaction_state.cc",
"db/convenience.cc",
"db/db_filesnapshot.cc",
"db/db_impl/compact_range_threads_mngr.cc",
"db/db_impl/compacted_db_impl.cc",
"db/db_impl/db_impl.cc",
"db/db_impl/db_impl_compaction_flush.cc",
Expand Down Expand Up @@ -404,6 +405,7 @@ cpp_library_wrapper(name="rocksdb_whole_archive_lib", srcs=[
"db/compaction/subcompaction_state.cc",
"db/convenience.cc",
"db/db_filesnapshot.cc",
"db/db_impl/compact_range_threads_mngr.cc",
"db/db_impl/compacted_db_impl.cc",
"db/db_impl/db_impl.cc",
"db/db_impl/db_impl_compaction_flush.cc",
Expand Down
Loading

0 comments on commit fac7588

Please sign in to comment.