From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 13 Mar 2019 15:05:20 +0300 From: Konstantin Osipov Subject: Re: [PATCH v2 09/14] vinyl: clean up write iterator source destruction Message-ID: <20190313120520.GI25066@chai> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: To: Vladimir Davydov Cc: tarantool-patches@freelists.org List-ID: * Vladimir Davydov [19/03/13 11:58]: > By convention we have two methods in each write iterator stream > implementation (including the write iterator itself as it implements > the interface too): 'stop' and 'close'. The 'stop' method is called > in a worker thread. It reverses the effect of 'start'. We need it > unreference all tuples referenced during the iteration (we must do > it in the worker thread, where the tuples were referenced in the first > place so as not to unreference tuple formats, see vy_tuple_delete). > The 'close' method is called from the tx thread to unreference tuple > formats if necessary and release memory. > > For the write iterator itself we follow this convention. However, > for individual sources, for vy_slice_stream source to be more exact, > we do not - the write iterator calls both 'stop' and 'close' from > its own 'stop method. Let's cleanup this mess and make the write > iterator follow the convention. We'll need it in the next patch. OK to push. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov