vinyl: run size is a function of range size; fix races
Make run size a function of range size. This makes the races still inherent in vinyl easily exposable. Fix the race by better tracking index version in vy_dump() and protecting vy_read_iterator_open with a read lock over entire index. @todo: * vy_read_iterator_open() is entirely useless exactly because of the race it opens up a window for, a race between open() and get(): get() has to invoke vy_read_check_versions() and *reopen* the iterator again! The iterator API must be reworked to remove a useless call, which has to be invoked on demand anyway. * the race is caused by a broken assertion in the vy_range_tree (range index), because vy_dump adds a new run to a range and updates run page index, which is used for range comparison in the tree. If we change the comparator to use range->minkey, the race will be completely gone, because manipulation with the run list will not affect range->minkey.
Loading
Please register or sign in to comment