Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
partition_snapshot_reader.hh: fix iterator invalidation in do_refresh…
…_state do_refresh_state() keeps iterators to rows_entry in a vector. This vector might be resized during the procedure, triggering memory reclaim and invalidating the iterators, which can cause arbitrarily long loops and/or a segmentation fault during make_heap(). To fix this, do_refresh_state has to always be called from the allocating section. Additionally, it turns out that the first do_refresh_state is useless, because reset_state() doesn't set _change_mark. This causes do_refresh_state to be needlessly repeated during a next_row() or next_range_tombstone() which happens immediately after it. Therefore this patch moves the _change_mark assignment from maybe_refresh_state to do_refresh_state, so that the change mark is properly set even after the first refresh. Fixes #14696 Closes #14697 (cherry picked from commit 41aef6d)
- Loading branch information