Skip to content

Commit

Permalink
Prevent compactions in leveldb
Browse files Browse the repository at this point in the history
  • Loading branch information
haraldF committed Apr 17, 2024
1 parent e205ffe commit 77e2b44
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ set (LEVELDB_REQUIRED_FLAGS
ExternalProject_Add(leveldb_external
GIT_REPOSITORY ${LEVELDB_URL}
GIT_TAG ${LEVELDB_TAG}
PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/leveldb.compaction.patch
CMAKE_ARGS ${CMAKE_ARGS}
${LEVELDB_CMAKE_ARGS}
"-DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_DIR}"
Expand Down
15 changes: 15 additions & 0 deletions external/leveldb.compaction.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/db/db_impl.cc b/db/db_impl.cc
index 3468862..aa95d7c 100644
--- a/db/db_impl.cc
+++ b/db/db_impl.cc
@@ -662,8 +662,8 @@ void DBImpl::MaybeScheduleCompaction() {
!versions_->NeedsCompaction()) {
// No work to be done
} else {
- background_compaction_scheduled_ = true;
- env_->Schedule(&DBImpl::BGWork, this);
+// background_compaction_scheduled_ = true;
+// env_->Schedule(&DBImpl::BGWork, this);
}
}

0 comments on commit 77e2b44

Please sign in to comment.