]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
Calculate `injected_error_count` even when `SharedState::ignore_read_error` (#12800)
authorHui Xiao <huixiao@fb.com>
Mon, 24 Jun 2024 04:54:27 +0000 (21:54 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Mon, 24 Jun 2024 04:54:27 +0000 (21:54 -0700)
commite90e9153d5169f9df8ddd3cf0bf693572768a7b5
treebe0e6c81dbae9c704e0277f1381ad741a2a69e67
parent9d64ca55b760e0d7386c3cc170ff84495d825238
Calculate `injected_error_count` even when `SharedState::ignore_read_error` (#12800)

Summary:
**Context/Summary:**

`injected_error_count` is needed to verify read error injection. For example, when injected_error_count == 0, the read call should not return error. https://github.com/facebook/rocksdb/commit/981fd432fa2441fc10a59a462bd14906ccb1c0e0 only calculated `injected_error_count` under `SharedState::ignore_read_error=false` so `injected_error_count==0` when `SharedState::ignore_read_error=true`. However  we can still inject read error in critical read path under `SharedState::ignore_read_error=true` so the read call is expected to return injected error. This contradicts to the  `injected_error_count == 0` as we skipped its calculation. As a consequence, we see

```
TestPrefixScan error: IO error: injected read error;
Verification failed
```
in code paths
```
if (s.ok()) {
    thread->stats.AddPrefixes(1, count);
  } else if (injected_error_count > 0 && IsRetryableInjectedError(s)) {
    fprintf(stdout, "TestPrefixScan error: %s\n", s.ToString().c_str());
  } else {
    fprintf(stderr, "TestPrefixScan error: %s\n", s.ToString().c_str());
    thread->shared->SetVerificationFailure();
}
```

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

Test Plan: CI

Reviewed By: cbi42

Differential Revision: D58918014

Pulled By: hx235

fbshipit-source-id: d73139c114fb3f61003dedca116f7ec36309eca4
db_stress_tool/no_batched_ops_stress.cc