Skip to content

Commit

Permalink
ENG-3910: Clear intent compaction filter explicitly when tablet_do_co…
Browse files Browse the repository at this point in the history
…mpaction_cleanup_for_intents is false.

Summary: Clear intent compaction filter explicitly when tablet_do_compaction_cleanup_for_intents is false. Without the filter set to false explicitly, the original compaction filter for the tablet's main records would be used to compact transaction provision records and led to a FATAL error when decoding the records.

Test Plan: Run CassandraSecondaryIndex workload with tablet_do_compaction_cleanup_for_intents is set to false.

Reviewers: venkatesh

Reviewed By: venkatesh

Subscribers: ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D5480
  • Loading branch information
robertpang committed Sep 14, 2018
1 parent e84ba05 commit c605e4c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/yb/tablet/tablet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -504,10 +504,9 @@ Status Tablet::OpenKeyValueTablet() {
return std::bind(&Tablet::IntentsDbFlushFilter, this, _1);
});

if (FLAGS_tablet_do_compaction_cleanup_for_intents) {
rocksdb_options.compaction_filter_factory =
std::make_shared<docdb::DocDBIntentsCompactionFilterFactory>(this);
}
rocksdb_options.compaction_filter_factory =
FLAGS_tablet_do_compaction_cleanup_for_intents ?
std::make_shared<docdb::DocDBIntentsCompactionFilterFactory>(this) : nullptr;

rocksdb::DB* intents_db = nullptr;
RETURN_NOT_OK(rocksdb::DB::Open(rocksdb_options, db_dir + kIntentsDBSuffix, &intents_db));
Expand Down

0 comments on commit c605e4c

Please sign in to comment.