|
Ran
|
Files
514
|
Run time
33s
|
Badge
README BADGES
|
push
github
vinyl: fix race between manual compaction and range splitting To force compaction, index:compact() sets the needs_compaction flag on all ranges of the target LSM tree. When a range is split, the new ranges inherit this flag. The problem is that there's a yield caused by vy_log_tx_commit() between setting the flag in vy_lsm_split_range() and adding the new ranges to the LSM tree. If vinyl_index_compact() is called while vy_lsm_split_range() is waiting for vy_log_tx_commit() to complete, the needs_compaction flag will be set for the old range but not for the new ranges hence compaction won't be triggered for them. This breaks assumptions made by some tests (select_consistency_test, for example). Fix this issue by setting the needs_compaction flag right before modifying the LSM tree, after the vylog record is committed. Note that vy_lsm_coalesce_range() isn't affected because it already sets the flag after the vylog write. Closes #11019 NO_DOC=bug fix NO_TEST=checked by existing tests; difficult to reproduce NO_CHANGELOG=minor issue; unlikely to happen; no adverse effects; easy to work around (just call index:compact() again) (cherry picked from commit 501ef6165)
68805 of 122095 branches covered (56.35%)
101492 of 116211 relevant lines covered (87.33%)
1962454.01 hits per line
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
|---|