Skip to content

Commit f4d984f

Browse files
author
Evan Stade
committed
Revert "Check return value of TableBuilder::Add() in compaction routine."
This reverts commit 80d6c09.
1 parent 71dfa45 commit f4d984f

3 files changed

Lines changed: 4 additions & 12 deletions

File tree

db/db_impl.cc

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,12 +1004,7 @@ Status DBImpl::DoCompactionWork(CompactionState* compact) {
10041004
compact->current_output()->smallest.DecodeFrom(key);
10051005
}
10061006
compact->current_output()->largest.DecodeFrom(key);
1007-
1008-
status = compact->builder->Add(key, input->value());
1009-
if (!status.ok()) {
1010-
FinishCompactionOutputFile(compact, input);
1011-
break;
1012-
}
1007+
compact->builder->Add(key, input->value());
10131008

10141009
// Close output file if it is big enough
10151010
if (compact->builder->FileSize() >=

include/leveldb/table_builder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class LEVELDB_EXPORT TableBuilder {
4949
// Add key,value to the table being constructed.
5050
// REQUIRES: key is after any previously added key according to comparator.
5151
// REQUIRES: Finish(), Abandon() have not been called
52-
Status Add(const Slice& key, const Slice& value);
52+
void Add(const Slice& key, const Slice& value);
5353

5454
// Advanced operation: flush any buffered key/value pairs to file.
5555
// Can be used to ensure that two adjacent entries never live in

table/table_builder.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,10 @@ Status TableBuilder::ChangeOptions(const Options& options) {
9191
return Status::OK();
9292
}
9393

94-
Status TableBuilder::Add(const Slice& key, const Slice& value) {
94+
void TableBuilder::Add(const Slice& key, const Slice& value) {
9595
Rep* r = rep_;
9696
assert(!r->closed);
97-
if (!ok()) {
98-
return status();
99-
}
97+
if (!ok()) return;
10098
if (r->num_entries > 0) {
10199
assert(r->options.comparator->Compare(key, Slice(r->last_key)) > 0);
102100
}
@@ -122,7 +120,6 @@ Status TableBuilder::Add(const Slice& key, const Slice& value) {
122120
if (estimated_block_size >= r->options.block_size) {
123121
Flush();
124122
}
125-
return status();
126123
}
127124

128125
void TableBuilder::Flush() {

0 commit comments

Comments
 (0)