Fix the status overwrite

This commit is contained in:
Zhichao Cao 2020-04-30 11:45:59 -07:00
parent 931b7f6785
commit e89f9ef839
2 changed files with 8 additions and 2 deletions

View File

@ -1,5 +1,7 @@
# Rocksdb Change Log
## Unreleased
### Bug Fixes
* Fix a bug caused by overwrite the status with io status in block based table builder when writing data blocks. If status stores the error message (e.g., failure of verify block compression), the bug will make the io status overwrite the status.
## 6.9.3 (04/28/2020)
### Bug Fixes

View File

@ -788,7 +788,9 @@ void BlockBasedTableBuilder::WriteRawBlock(const Slice& block_contents,
}
}
}
r->status = r->io_status;
if (r->status.ok()) {
r->status = r->io_status;
}
}
Status BlockBasedTableBuilder::status() const { return rep_->status; }
@ -1064,7 +1066,9 @@ void BlockBasedTableBuilder::WriteFooter(BlockHandle& metaindex_block_handle,
if (r->io_status.ok()) {
r->offset += footer_encoding.size();
}
r->status = r->io_status;
if (r->status.ok()) {
r->status = r->io_status;
}
}
void BlockBasedTableBuilder::EnterUnbuffered() {