From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp63.i.mail.ru (smtp63.i.mail.ru [217.69.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id CC1C64696C3 for ; Wed, 15 Apr 2020 13:16:35 +0300 (MSK) Date: Wed, 15 Apr 2020 13:16:30 +0300 From: Kirill Yukhin Message-ID: <20200415101630.mfyzxcvcq6peuzak@tarantool.org> References: <20200413103454.82207-1-sergepetrenko@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200413103454.82207-1-sergepetrenko@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v2] relay: fix segfault on replica transition from anonymous List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Serge Petrenko Cc: tarantool-patches@dev.tarantool.org Hello, On 13 апр 13:34, Serge Petrenko wrote: > relay_subscribe_f sets a recovery trigger notifying tx when a full log > is read and gc consumer corresponding to the replica may be advanced. > Since anonymous replicas do not have gc consumers, the trigger isn't > added for them. However, on relay exit, the trigger deletion depends > on replica->anon flag. This is buggy in case relay stalls on exit due to > replica disconnect. Replica has time to reconnect and register as a > normal instance, hence its replica->anon flag will be false by the time > we check whether to clear triggers or not, effectively making us to > clear unset triggers and segfault. > > Fix this by initializing the triggers with trigger_create(), which > allows a trigger_clear() call, even if the triggers are not set, and > omit the replica->anon check. > > Closes #4731 > > Acked-by: Cyrill Gorcunov > --- > https://github.com/tarantool/tarantool/tree/sp/gh-4731-anon-segfault-v2 > https://github.com/tarantool/tarantool/issues/4731 I've checked your patch into 2.3 and master. -- Regards, Kirill Yukhin