mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Fix slow no-io iterator
Summary: This fixes #3130525. Dhruba's suggestion and Tnovak's implementation :) The issue was with SkipEmptyDataBlocksForward(), but I also changed SkipEmptyDataBlocksBackward(). Is that OK? Test Plan: Run the logdevice test Reviewers: dhruba Reviewed By: dhruba CC: leveldb Differential Revision: https://reviews.facebook.net/D13911
This commit is contained in:
@@ -139,7 +139,8 @@ void TwoLevelIterator::Prev() {
|
||||
|
||||
|
||||
void TwoLevelIterator::SkipEmptyDataBlocksForward() {
|
||||
while (data_iter_.iter() == nullptr || !data_iter_.Valid()) {
|
||||
while (data_iter_.iter() == nullptr || (!data_iter_.Valid() &&
|
||||
!data_iter_.status().IsIncomplete())) {
|
||||
// Move to next block
|
||||
if (!index_iter_.Valid()) {
|
||||
SetDataIterator(nullptr);
|
||||
@@ -152,7 +153,8 @@ void TwoLevelIterator::SkipEmptyDataBlocksForward() {
|
||||
}
|
||||
|
||||
void TwoLevelIterator::SkipEmptyDataBlocksBackward() {
|
||||
while (data_iter_.iter() == nullptr || !data_iter_.Valid()) {
|
||||
while (data_iter_.iter() == nullptr || (!data_iter_.Valid() &&
|
||||
!data_iter_.status().IsIncomplete())) {
|
||||
// Move to next block
|
||||
if (!index_iter_.Valid()) {
|
||||
SetDataIterator(nullptr);
|
||||
|
||||
Reference in New Issue
Block a user