Skip to content

Commit 5139ff5

Browse files
mszeszko-metafacebook-github-bot
authored andcommitted
Conditional check reordering (#13415)
Summary: This change is addressing a valid concern raised in #13408 (comment). Pull Request resolved: #13415 Test Plan: Existing test collateral. Reviewed By: cbi42 Differential Revision: D69999071 Pulled By: mszeszko-meta fbshipit-source-id: 5ebb195b2b83701e06c33bfcb19c57d9ac1c1dc6
1 parent d7aea69 commit 5139ff5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

db/arena_wrapped_db_iter.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ void ArenaWrappedDBIter::Init(
6767
void ArenaWrappedDBIter::MaybeAutoRefresh(bool is_seek,
6868
DBIter::Direction direction) {
6969
if (cfh_ != nullptr && read_options_.snapshot != nullptr && allow_refresh_ &&
70-
read_options_.auto_refresh_iterator_with_snapshot && status().ok()) {
70+
read_options_.auto_refresh_iterator_with_snapshot) {
7171
// The intent here is to capture the superversion number change
7272
// reasonably soon from the time it actually happened. As such,
7373
// we're fine with weaker synchronization / ordering guarantees
7474
// provided by relaxed atomic (in favor of less CPU / mem overhead).
7575
uint64_t cur_sv_number = cfh_->cfd()->GetSuperVersionNumberRelaxed();
76-
if (sv_number_ != cur_sv_number) {
76+
if ((sv_number_ != cur_sv_number) && status().ok()) {
7777
// Changing iterators' direction is pretty heavy-weight operation and
7878
// could have unintended consequences when it comes to prefix seek.
7979
// Therefore, we need an efficient implementation that does not duplicate

0 commit comments

Comments
 (0)