Fix write_unprepared_transaction_test crash on debug version. (#6574)
Summary: The last key may hit index of out bound exception when id = 9. Pull Request resolved: https://github.com/facebook/rocksdb/pull/6574 Reviewed By: riversand963 Differential Revision: D20699791 Pulled By: cheng-chang fbshipit-source-id: 8e2c5be5ff0e53e9857cfd59cea97cff21446819
This commit is contained in:
parent
e91d1a21a6
commit
8abd41a544
@ -182,8 +182,8 @@ TEST_P(WriteUnpreparedStressTest, ReadYourOwnWriteStress) {
|
||||
ReadOptions read_options;
|
||||
|
||||
for (uint32_t i = 0; i < kNumIter; i++) {
|
||||
std::set<std::string> owned_keys(&keys[id * kNumKeys],
|
||||
&keys[(id + 1) * kNumKeys]);
|
||||
std::set<std::string> owned_keys(keys.begin() + id * kNumKeys,
|
||||
keys.begin() + (id + 1) * kNumKeys);
|
||||
// Add unowned keys to make the workload more interesting, but this
|
||||
// increases row lock contention, so just do it sometimes.
|
||||
if (rnd.OneIn(2)) {
|
||||
|
Loading…
Reference in New Issue
Block a user