-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
storage: investigate busy loop in split queue #18646
Comments
We don't double the split target size if an error is returned from Removing the engine snapshot from |
Use an explicit iterator instead of Reader.Iterate() in order to reduce allocations. Specifically, we can avoid 2 allocations per key/value. Do not create a snapshot when calling MVCCFindSplitKey as internally it uses a single iterator which has an implicit snapshot. Remove the unused rangeID parameter to MVCCFindSplitKey. This parameter was only being used to lookup the range stats to log them under V(2). name old time/op new time/op delta MVCCFindSplitKey_RocksDB/valueSize=32-8 341ms ±23% 269ms ± 8% -21.29% (p=0.000 n=10+10) name old speed new speed delta MVCCFindSplitKey_RocksDB/valueSize=32-8 198MB/s ±19% 250MB/s ± 8% +26.34% (p=0.000 n=10+10) name old alloc/op new alloc/op delta MVCCFindSplitKey_RocksDB/valueSize=32-8 36.6MB ± 0% 0.0MB ± 0% -100.00% (p=0.000 n=9+10) name old allocs/op new allocs/op delta MVCCFindSplitKey_RocksDB/valueSize=32-8 1.16M ± 0% 0.00M ± 0% -100.00% (p=0.000 n=9+10) See cockroachdb#18646
Use an explicit iterator instead of Reader.Iterate() in order to reduce allocations. Specifically, we can avoid 2 allocations per key/value. Do not create a snapshot when calling MVCCFindSplitKey as internally it uses a single iterator which has an implicit snapshot. Remove the unused rangeID parameter to MVCCFindSplitKey. This parameter was only being used to lookup the range stats to log them under V(2). name old time/op new time/op delta MVCCFindSplitKey_RocksDB/valueSize=32-8 341ms ±23% 269ms ± 8% -21.29% (p=0.000 n=10+10) name old speed new speed delta MVCCFindSplitKey_RocksDB/valueSize=32-8 198MB/s ±19% 250MB/s ± 8% +26.34% (p=0.000 n=10+10) name old alloc/op new alloc/op delta MVCCFindSplitKey_RocksDB/valueSize=32-8 36.6MB ± 0% 0.0MB ± 0% -100.00% (p=0.000 n=9+10) name old allocs/op new allocs/op delta MVCCFindSplitKey_RocksDB/valueSize=32-8 1.16M ± 0% 0.00M ± 0% -100.00% (p=0.000 n=9+10) See cockroachdb#18646
Both #18199 and #15997 observed the split queue showing up in profiles/participating in obvious contention.
In #15997 we were writing a range chock full of illegal split keys. The split operation should back off more and more (owing to the doubling of the in-memory split target size), but this perhaps doesn't happen. Also, reading an engine snapshot in a tight loop appears to have interfered pretty severely with Raft handling in my testing, leading to up to 50s instances of
handleRaftReady
.The text was updated successfully, but these errors were encountered: