rocksdb/db_stress_tool
Yu Zhang af7872ffd1 Fix a TestGet failure when user defined timestamp is enabled (#11249)
Summary:
Stressing small DB with small number of keys and user-defined timestamp enabled usually fails pretty quickly in TestGet.

Example command to reproduce the failure:

` tools/db_crashtest.py blackbox --enable_ts --simple --delrangepercent=0 --delpercent=5 --max_key=100 --interval=3 --write_buffer_size=262144 --target_file_size_base=262144 --max_bytes_for_level_base=262144 --subcompactions=1`

Example failure: `error : inconsistent values for key 0000000000000009000000000000000A7878: expected state has the key, Get() returns NotFound.`

Fixes this test failure by refreshing the read up to timestamp to the most up to date timestamp, a.k.a now, after a key is locked.  Without this, things could happen in this order and cause a test failure:

<table>
  <tr>
    <th>TestGet thread</th>
    <th> A writing thread</th>
  </tr>
  <tr>
    <td>read_opts.timestamp = GetNow()</td>
    <td></td>
  </tr>
  <tr>
    <td></td>
    <td>Lock key, do write</td>
  </tr>
  <tr>
    <td>Lock key, read(read_opts) return NotFound</td>
    <td></td>
  </tr>
</table>

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

Reviewed By: ltamasi

Differential Revision: D43551302

Pulled By: jowlyzhang

fbshipit-source-id: 26877ab379bdb97acd2682a2632bc29718427f38
2023-02-23 17:00:04 -08:00
..
CMakeLists.txt
batched_ops_stress.cc Adjust value generation in batched ops stress tests (#10872) 2022-10-25 17:51:20 -07:00
cf_consistency_stress.cc Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
db_stress.cc Disable tiered storage + BlobDB stress test (#10699) 2022-09-19 15:39:31 -07:00
db_stress_common.cc Verify columns in NonBatchedOpsStressTest::VerifyDb (#10783) 2022-10-06 15:07:16 -07:00
db_stress_common.h Revert enabling IO uring in db_stress (#11242) 2023-02-21 12:53:55 -08:00
db_stress_compaction_filter.h
db_stress_driver.cc fix shared state used after free (#11059) 2023-01-04 19:35:34 -08:00
db_stress_driver.h fix shared state used after free (#11059) 2023-01-04 19:35:34 -08:00
db_stress_env_wrapper.h Enable ReadAsync testing and fault injection in db_stress (#11037) 2022-12-15 15:48:50 -08:00
db_stress_gflags.cc Revert enabling IO uring in db_stress (#11242) 2023-02-21 12:53:55 -08:00
db_stress_listener.cc Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
db_stress_listener.h Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
db_stress_shared_state.cc
db_stress_shared_state.h Run clang format against files under tools/ and db_stress_tool/ (#10868) 2022-10-25 14:29:41 -07:00
db_stress_stat.cc
db_stress_stat.h
db_stress_table_properties_collector.h
db_stress_test_base.cc Support iter_start_ts in integrated BlobDB (#11244) 2023-02-22 15:44:59 -08:00
db_stress_test_base.h Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
db_stress_tool.cc Revert enabling IO uring in db_stress (#11242) 2023-02-21 12:53:55 -08:00
expected_state.cc Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
expected_state.h
multi_ops_txns_stress.cc Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
multi_ops_txns_stress.h Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
no_batched_ops_stress.cc Fix a TestGet failure when user defined timestamp is enabled (#11249) 2023-02-23 17:00:04 -08:00