Remove a check for merge operator in builder.cc

Summary:
Previously, builder.cc has a check for merge operator which prevents
RocksDB from crash when reopening a DB w/o properly specifying the merge
operator.  However, currently we observed a memory leak on failing in
RocksDB recovery.  This diff removes such check and let it crash instead of
causing memory leak for now before we have identified the real cause of
the memory leak.

Test Plan: make all check

Reviewers: sdong

Subscribers: ljin, igor

Differential Revision: https://reviews.facebook.net/D20913
This commit is contained in:
Yueh-Hsuan Chiang 2014-07-31 12:58:16 -07:00
parent 2105ecac4d
commit 67dae255a9

View file

@ -113,10 +113,13 @@ Status BuildTable(const std::string& dbname, Env* env, const Options& options,
is_first_key = false;
if (this_ikey.type == kTypeMerge) {
if (!merge.HasOperator()) {
return Status::InvalidArgument(
"merge_operator is not properly initialized.");
}
// TODO(tbd): Add a check here to prevent RocksDB from crash when
// reopening a DB w/o properly specifying the merge operator. But
// currently we observed a memory leak on failing in RocksDB
// recovery, so we decide to let it crash instead of causing
// memory leak for now before we have identified the real cause
// of the memory leak.
// Handle merge-type keys using the MergeHelper
// TODO: pass statistics to MergeUntil
merge.MergeUntil(iter, 0 /* don't worry about snapshot */);