Skip to content
Snippets Groups Projects
Commit 9bd64449 authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

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.
parent cbfb7e8c
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment