[Tarantool-patches] [PATCH v7 4/5] errinj: add ERRINJ_REPLICA_TXN_WRITE

Konstantin Osipov kostja.osipov at gmail.com
Wed Feb 5 01:45:29 MSK 2020


* Cyrill Gorcunov <gorcunov at gmail.com> [20/01/28 22:58]:
> To test rollback error nil dereference
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
> ---
>  src/box/applier.cc     |    6 +
>  src/lib/core/errinj.h  |    1 +
>  test/box/errinj.result | 2614 +++++++++++++++++++++-------------------
>  3 files changed, 1365 insertions(+), 1256 deletions(-)
> 
> diff --git a/src/box/applier.cc b/src/box/applier.cc
> index 967dc91de..e739f23e2 100644
> --- a/src/box/applier.cc
> +++ b/src/box/applier.cc
> @@ -51,6 +51,7 @@
>  #include "txn.h"
>  #include "box.h"
>  #include "scoped_guard.h"
> +#include "errinj.h"
>  
>  STRS(applier_state, applier_STATE);
>  
> @@ -830,6 +831,11 @@ applier_apply_tx(struct stailq *rows)
>  	trigger_create(on_commit, applier_txn_commit_cb, NULL, NULL);
>  	txn_on_commit(txn, on_commit);
>  
> +	ERROR_INJECT(ERRINJ_REPLICA_TXN_WRITE, {
> +		diag_set(ClientError, ER_INJECTION, "replica txn write injection");
> +		goto rollback;
> +	});

if the source of error is in txn_prepare(), I think the injection
should be moved in it. but I see no way txn_prepare() could fail
inside an applier, as long as we deal with memtx spaces.


-- 
Konstantin Osipov, Moscow, Russia


More information about the Tarantool-patches mailing list