Browse Source

fix unnormal size bug

xxy
小人鱼 9 months ago
parent
commit
55ec6b7c54
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      db/db_impl.cc

+ 7
- 2
db/db_impl.cc View File

@ -1312,7 +1312,7 @@ Status DBImpl::Write(const WriteOptions& options, WriteBatch* updates) {
} }
// May temporarily unlock and wait. // May temporarily unlock and wait.
Status status = MakeRoomForWrite(updates == nullptr);
Status status = MakeRoomForWrite(updates == nullptr&&!options.valuelog_write);
uint64_t last_sequence = versions_->LastSequence(); uint64_t last_sequence = versions_->LastSequence();
Writer* last_writer = &w; Writer* last_writer = &w;
if (status.ok() && updates != nullptr) { // nullptr batch is for compactions if (status.ok() && updates != nullptr) { // nullptr batch is for compactions
@ -1863,7 +1863,12 @@ void DBImpl::GarbageCollect() {
valuelog_finding_key=key; valuelog_finding_key=key;
spj_mutex_.Unlock(); spj_mutex_.Unlock();
//wait for current writer queue to do all their thing //wait for current writer queue to do all their thing
Write(leveldb::WriteOptions(), nullptr);
{
auto op=leveldb::WriteOptions();
op.valuelog_write=true;
Write(op, nullptr);
}
auto option=leveldb::ReadOptions(); auto option=leveldb::ReadOptions();
option.find_value_log_for_gc = true; option.find_value_log_for_gc = true;

Loading…
Cancel
Save