Abort verification when expected state has pending writes / db return non OK(NotFound) status (#12232)

Summary:
In the current flow, the verification will pass and continue the test when db return non Ok(NotFound) status while expected state has pending writes.

fdfd044bb2/db_stress_tool/no_batched_ops_stress.cc (L2054-L2065)

We can just abort when such a db status is ever encountered. This can prevent follow up tests like `TestCheckpoint` and `TestBackupRestore` to consider such a key as existing in the db via the `ExpectedState::Exists` API. This could be a reason for some recent test failures in this path.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/12232

Reviewed By: cbi42

Differential Revision: D52737393

Pulled By: jowlyzhang

fbshipit-source-id: f2658c5332ccd42f6190783960e2dc6fcd81ccc5
This commit is contained in:
Yu Zhang 2024-01-12 12:23:09 -08:00 committed by Facebook GitHub Bot
parent fdfd044bb2
commit 8d0c09d7e6
1 changed files with 2 additions and 1 deletions

View File

@ -2057,12 +2057,13 @@ class NonBatchedOpsStressTest : public StressTest {
Slice slice(value_from_db);
uint32_t value_base = GetValueBase(slice);
shared->SyncPut(cf, key, value_base);
return true;
} else if (s.IsNotFound()) {
// Value doesn't exist in db, update state to reflect that
shared->SyncDelete(cf, key);
}
return true;
}
}
char expected_value_data[kValueMaxLen];
size_t expected_value_data_size =
GenerateValue(expected_value.GetValueBase(), expected_value_data,