New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refresh() is not supported by vector memtable which may lead to an error in db_stress #12286
base: main
Are you sure you want to change the base?
Refresh() is not supported by vector memtable which may lead to an error in db_stress #12286
Conversation
Hi @ofriedma! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
4ab28bd
to
e231df1
Compare
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
e231df1
to
4b868da
Compare
@@ -1870,7 +1870,7 @@ class NonBatchedOpsStressTest : public StressTest { | |||
|
|||
// Write-prepared and Write-unprepared do not support Refresh() yet. | |||
if (!(FLAGS_use_txn && FLAGS_txn_write_policy != 0) && | |||
thread->rand.OneIn(2)) { | |||
thread->rand.OneIn(2) && iter->IsAllowRefresh()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we instead skip the validation when iter->Refresh()
returns NotSupported
? Then we don't need a new method in the Iterator
class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ajkr I changed the code, IMO the IsAllowRefresh() makes the code looks better, The condition is more readable (I removed the check for use_txm and txn_write_policy since both call NetItertator with allow_refresh_ = false.
trying to revert changes after iter->Refresh() in this section ,cause errors.
4b868da
to
4c6c6d2
Compare
How to reproduce:
./db_stress --clear_column_family_one_in=0 --column_families=1 --destroy_db_initially=1 --key_len_percent_dist=100 --kill_random_test=0 --max_key=102400 --max_key_len=1 --verify_iterator_with_expected_state_one_in=1 --iterpercent=13 --readpercent=20 --writepercent=67 --delpercent=0 --delrangepercent=0 --prefixpercent=0 -column_families=1 -memtablerep=vector
error is:
Verification failed. Expected state has key 0000000000008CD1, iterator is at key 0000000000008C97
Column family: default, op_logs: S 0000000000008CCC N SFP 0000000000008CD5 PRefresh S 0000000000008CD1 P
2024/01/24-17:10:03 Starting verification
Stress Test : 1194.578 micros/op 26618 ops/sec
: Wrote 0.08 MB (0.28 MB/sec) (67% of 8147 ops)
: Wrote 5496 times
: Deleted 0 times
: Single deleted 0 times
: 1606 read and 50 found the key
: Prefix scanned 0 times
: Iterator size sum is 0
: Iterated 1044 times
: Deleted 0 key-ranges
: Range deletions covered 0 keys
: Got errors 1 times
: 0 CompactFiles() succeed
: 0 CompactFiles() did not succeed
Verification failed :(
After the fix there is no error