[PATCH v3 2/5] test: errinj for pause relay_send

Vladimir Davydov vdavydov.dev at gmail.com
Thu Dec 6 18:44:14 MSK 2018


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.



More information about the Tarantool-patches mailing list