From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 3 Aug 2018 18:43:06 +0300 From: Vladimir Davydov Subject: Re: [PATCH] replication: fix a failing assert in replica_on_applier_disconnect() Message-ID: <20180803154306.u5xbf7rjv4fizjbh@esperanza> References: <20180803055905.69108-1-sergepetrenko@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180803055905.69108-1-sergepetrenko@tarantool.org> To: Serge Petrenko Cc: tarantool-patches@freelists.org List-ID: Looks good. On Fri, Aug 03, 2018 at 08:59:05AM +0300, Serge Petrenko wrote: > One possible case when two applier errors happen one after another > wasn't handled in replica_on_applier_disconnect(), which lead to > occasional test failures and crashes. Handle this case. > > Part of #3510 > --- > This patch fixes an assertion fail, submitted by @locker in issue comments. > I wasn't able to reproduce 2 failures reported in the issue itself, and asked > for comments, but got no answer. I also couldn't fix the latter 2 > failures just by looking at code. > > https://github.com/tarantool/tarantool/tree/sergepetrenko/gh-3510-replication-asserts-fail > https://github.com/tarantool/tarantool/issues/3510 > > src/box/replication.cc | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/src/box/replication.cc b/src/box/replication.cc > index 26bbbe32a..0efbd7c0e 100644 > --- a/src/box/replication.cc > +++ b/src/box/replication.cc > @@ -350,6 +350,10 @@ replica_on_applier_disconnect(struct replica *replica) > assert(replicaset.applier.connected > 0); > replicaset.applier.connected--; > break; > + case APPLIER_LOADING: > + assert(replicaset.applier.loading > 0); > + replicaset.applier.loading--; > + break; > case APPLIER_DISCONNECTED: > break; > default: