[Tarantool-patches] [PATCH 2/2] vinyl: clean-up read views if *_build_history() fails
Nikita Pettik
korablev at tarantool.org
Thu Apr 9 14:09:32 MSK 2020
On 09 Apr 11:19, Konstantin Osipov wrote:
> * Nikita Pettik <korablev at tarantool.org> [20/04/09 00:39]:
> > if (vy_write_iterator_build_history(stream, &raw_count,
> > - &is_first_insert) != 0)
> > + &is_first_insert) != 0) {
> > + for (int i = 0; i < stream->rv_count; ++i)
> > + stream->read_views[i].history = NULL;
>
> This violates stream encapsulation and should be a method of the
> stream.
read_views is a member of write_iterator, not stream. Stream has
only for methods: start, next, stop, close.
vy_write_iterator_build_history() is a part of next method. So it
is likely to be already encapsulated, isn't it? Access to truncated
region memory occurs in stop() method (i.e. write_iterator_stop()).
> Otherwise lgtm.
>
>
> --
> Konstantin Osipov, Moscow, Russia
More information about the Tarantool-patches
mailing list