From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 6 Dec 2018 18:44:14 +0300 From: Vladimir Davydov Subject: Re: [PATCH v3 2/5] test: errinj for pause relay_send Message-ID: <20181206154414.ej26xggkyxdk42gq@esperanza> References: <1544088837.816260678@f398.i.mail.ru> <20181206133852.75633-1-sergw@tarantool.org> <20181206133852.75633-3-sergw@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181206133852.75633-3-sergw@tarantool.org> To: Sergei Voronezhskii Cc: tarantool-patches@freelists.org List-ID: On Thu, Dec 06, 2018 at 04:38:49PM +0300, Sergei Voronezhskii wrote: > diff --git a/src/box/relay.cc b/src/box/relay.cc > index 0034f99a0..17daf76bf 100644 > --- a/src/box/relay.cc > +++ b/src/box/relay.cc > @@ -635,12 +635,17 @@ relay_subscribe(struct replica *replica, int fd, uint64_t sync, > static void > relay_send(struct relay *relay, struct xrow_header *packet) > { > + struct errinj *inj = errinj(ERRINJ_RELAY_SEND_DELAY, ERRINJ_BOOL); > + while (inj != NULL && inj->bparam) { > + fiber_sleep(0.01); > + inj = errinj(ERRINJ_RELAY_SEND_DELAY, ERRINJ_BOOL); > + } No need to update 'inj' here. I removed this line. > @@ -304,11 +331,14 @@ box.snapshot() > --- > - ok > ... > -#box.info.gc().checkpoints == 1 or box.info.gc() > +wait_gc(1) or box.info.gc() > --- > - true > ... > -#fio.glob('./master/*.xlog') == 2 or fio.listdir('./master') ^^^^^^ 2 > +-- The replica may have managed to download all data > +-- from xlog #1 before it was stopped, in which case > +-- it's OK to collect xlog #1. > +wait_xlog({2, 3}) or fio.listdir('./master') ^^^^^^ 2 or 3 If you did the rebase more thoroughly, you'd notice that now there can't be 3 xlogs here, only 2. I fixed it (removed value_in; made wait_xlog always take a number). Anyway, all this refactoring (I mean wait_xlog, wait_gc helpers) doesn't have anything to do with the goal pursued by this patch. I left it as is for now, but in future please avoid squashing gratuitous changes in your patches - this complicates review.