Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing the data-loss issue described in issue #230 #231

Open
wants to merge 1 commit into
base: unstable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
option(NEW_ROCKSDB "new rocksdb version" ON)
if(NEW_ROCKSDB)
message("using rocksdb-6.23.3")
set(patchCommand "cd ${PROJECT_SOURCE_DIR}/src/thirdparty/rocksdb/rocksdb\; git am -s ../../patch/0001-add-property-rocksdb.levelstatsex-in-rocksdb.patch\; git am -s ../../patch/0002-add-tendis-latency-extension.patch\; git am -s ../../patch/0003-add-property-rocksdb.levelstatsex-in-rocksdb.patch\;")
set(patchCommand "cd ${PROJECT_SOURCE_DIR}/src/thirdparty/rocksdb/rocksdb\; git am -s ../../patch/0001-add-property-rocksdb.levelstatsex-in-rocksdb.patch\; git am -s ../../patch/0002-add-tendis-latency-extension.patch\; git am -s ../../patch/0003-add-property-rocksdb.levelstatsex-in-rocksdb.patch\; git am -s ../../patch/0001-Reset-the-blob_value_.patch\;")
message("RocksDB git patch, we apply add-property-rocksdb.levelstatsex-in-rocksdb")
execute_process(COMMAND bash "-c" ${patchCommand})
set(ROCKSDB_DIR "${PROJECT_SOURCE_DIR}/src/thirdparty/rocksdb")
Expand Down
33 changes: 33 additions & 0 deletions src/thirdparty/patch/0001-Reset-the-blob_value_.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From eab2cc3f70885fa86333dca6daa902e40fd94f2a Mon Sep 17 00:00:00 2001
From: leonliao <[email protected]>
Date: Thu, 13 Apr 2023 12:04:12 +0800
Subject: [PATCH 1/1] Reset the blob_value_

---
db/compaction/compaction_iterator.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/db/compaction/compaction_iterator.cc b/db/compaction/compaction_iterator.cc
index 3ce38f90b..e9efb55c7 100644
--- a/db/compaction/compaction_iterator.cc
+++ b/db/compaction/compaction_iterator.cc
@@ -234,7 +234,6 @@ bool CompactionIterator::InvokeFilterIfNeeded(bool* need_skip,
{
StopWatchNano timer(clock_, report_detailed_time_);
if (kTypeBlobIndex == ikey_.type) {
- blob_value_.Reset();
filter = compaction_filter_->FilterBlobByKey(
level_, filter_key, &compaction_filter_value_,
compaction_filter_skip_until_.rep());
@@ -364,6 +363,8 @@ void CompactionIterator::NextFromInput() {
!IsShuttingDown()) {
key_ = input_.key();
value_ = input_.value();
+ blob_value_.Reset();
+
iter_stats_.num_input_records++;

Status pik_status = ParseInternalKey(key_, &ikey_, allow_data_in_errors_);
--
2.23.0