未验证 提交 3885d765 编写于 作者: C Changyu Bi 提交者: GitHub

8.5.1 bug fix (#11783)

* Check iterator status.

* change log and version
上级 89a3958b
# Rocksdb Change Log # Rocksdb Change Log
> NOTE: Entries for next release do not go here. Follow instructions in `unreleased_history/README.txt` > NOTE: Entries for next release do not go here. Follow instructions in `unreleased_history/README.txt`
## 8.5.1 (08/31/2023)
### Bug fixes
* Fix a bug where if there is an error reading from offset 0 of a file from L1+ and that the file is not the first file in the sorted run, data can be lost in compaction and read/scan can return incorrect results.
## 8.5.0 (07/21/2023) ## 8.5.0 (07/21/2023)
### Public API Changes ### Public API Changes
* Removed recently added APIs `GeneralCache` and `MakeSharedGeneralCache()` as our plan changed to stop exposing a general-purpose cache interface. The old forms of these APIs, `Cache` and `NewLRUCache()`, are still available, although general-purpose caching support will be dropped eventually. * Removed recently added APIs `GeneralCache` and `MakeSharedGeneralCache()` as our plan changed to stop exposing a general-purpose cache interface. The old forms of these APIs, `Cache` and `NewLRUCache()`, are still available, although general-purpose caching support will be dropped eventually.
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
// minor or major version number planned for release. // minor or major version number planned for release.
#define ROCKSDB_MAJOR 8 #define ROCKSDB_MAJOR 8
#define ROCKSDB_MINOR 5 #define ROCKSDB_MINOR 5
#define ROCKSDB_PATCH 0 #define ROCKSDB_PATCH 1
// Do not use these. We made the mistake of declaring macros starting with // Do not use these. We made the mistake of declaring macros starting with
// double underscore. Now we have to live with our choice. We'll deprecate these // double underscore. Now we have to live with our choice. We'll deprecate these
......
...@@ -329,6 +329,7 @@ void CompactionMergingIterator::FindNextVisibleKey() { ...@@ -329,6 +329,7 @@ void CompactionMergingIterator::FindNextVisibleKey() {
assert(current->iter.status().ok()); assert(current->iter.status().ok());
minHeap_.replace_top(current); minHeap_.replace_top(current);
} else { } else {
considerStatus(current->iter.status());
minHeap_.pop(); minHeap_.pop();
} }
if (range_tombstone_iters_[current->level]) { if (range_tombstone_iters_[current->level]) {
......
...@@ -931,6 +931,7 @@ bool MergingIterator::SkipNextDeleted() { ...@@ -931,6 +931,7 @@ bool MergingIterator::SkipNextDeleted() {
InsertRangeTombstoneToMinHeap(current->level, true /* start_key */, InsertRangeTombstoneToMinHeap(current->level, true /* start_key */,
true /* replace_top */); true /* replace_top */);
} else { } else {
// TruncatedRangeDelIterator does not have status
minHeap_.pop(); minHeap_.pop();
} }
return true /* current key deleted */; return true /* current key deleted */;
...@@ -988,6 +989,9 @@ bool MergingIterator::SkipNextDeleted() { ...@@ -988,6 +989,9 @@ bool MergingIterator::SkipNextDeleted() {
if (current->iter.Valid()) { if (current->iter.Valid()) {
assert(current->iter.status().ok()); assert(current->iter.status().ok());
minHeap_.push(current); minHeap_.push(current);
} else {
// TODO(cbi): check status and early return if non-ok.
considerStatus(current->iter.status());
} }
// Invariants (rti) and (phi) // Invariants (rti) and (phi)
if (range_tombstone_iters_[current->level] && if (range_tombstone_iters_[current->level] &&
...@@ -1027,6 +1031,7 @@ bool MergingIterator::SkipNextDeleted() { ...@@ -1027,6 +1031,7 @@ bool MergingIterator::SkipNextDeleted() {
if (current->iter.Valid()) { if (current->iter.Valid()) {
minHeap_.replace_top(current); minHeap_.replace_top(current);
} else { } else {
considerStatus(current->iter.status());
minHeap_.pop(); minHeap_.pop();
} }
return true /* current key deleted */; return true /* current key deleted */;
...@@ -1199,6 +1204,8 @@ bool MergingIterator::SkipPrevDeleted() { ...@@ -1199,6 +1204,8 @@ bool MergingIterator::SkipPrevDeleted() {
if (current->iter.Valid()) { if (current->iter.Valid()) {
assert(current->iter.status().ok()); assert(current->iter.status().ok());
maxHeap_->push(current); maxHeap_->push(current);
} else {
considerStatus(current->iter.status());
} }
if (range_tombstone_iters_[current->level] && if (range_tombstone_iters_[current->level] &&
...@@ -1241,6 +1248,7 @@ bool MergingIterator::SkipPrevDeleted() { ...@@ -1241,6 +1248,7 @@ bool MergingIterator::SkipPrevDeleted() {
if (current->iter.Valid()) { if (current->iter.Valid()) {
maxHeap_->replace_top(current); maxHeap_->replace_top(current);
} else { } else {
considerStatus(current->iter.status());
maxHeap_->pop(); maxHeap_->pop();
} }
return true /* current key deleted */; return true /* current key deleted */;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册