Tarantool development patches archive
 help / color / mirror / Atom feed
From: Serge Petrenko <sergepetrenko@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>,
	tarantool-patches@dev.tarantool.org, gorcunov@gmail.com
Subject: Re: [Tarantool-patches] [PATCH v2 1/4] xlog: introduce an error code for XlogGapError
Date: Tue, 15 Sep 2020 10:53:54 +0300	[thread overview]
Message-ID: <e81692bb-0d98-2a88-caf9-953846a5c7a0@tarantool.org> (raw)
In-Reply-To: <341cec180dc7ffda2f7d8cf03f8adfb03658694f.1600124767.git.v.shpilevoy@tarantool.org>


15.09.2020 02:11, Vladislav Shpilevoy пишет:
> XlogGapError object didn't have a code in ClientError code space.
> Because of that it was not possible to handle the gap error
> together with client errors in some switch-case statement.
>
> Now the gap error has a code.
>
> This is going to be used in applier code to handle XlogGapError
> among other errors using its code instead of RTTI.
>
> Needed for #5287
> ---
>   src/box/errcode.h     | 1 +
>   src/box/error.cc      | 2 ++
>   src/box/error.h       | 1 +
>   src/box/recovery.h    | 2 --
>   test/box/error.result | 1 +
>   5 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/src/box/errcode.h b/src/box/errcode.h
> index 3c21375f5..9a240a431 100644
> --- a/src/box/errcode.h
> +++ b/src/box/errcode.h
> @@ -271,6 +271,7 @@ struct errcode_record {
>           /*216 */_(ER_SYNC_QUORUM_TIMEOUT,       "Quorum collection for a synchronous transaction is timed out") \
>           /*217 */_(ER_SYNC_ROLLBACK,             "A rollback for a synchronous transaction is received") \
>   	/*218 */_(ER_TUPLE_METADATA_IS_TOO_BIG,	"Can't create tuple: metadata size %u is too big") \
> +	/*219 */_(ER_XLOG_GAP,			"%s") \
>   
>   /*
>    * !IMPORTANT! Please follow instructions at start of the file
> diff --git a/src/box/error.cc b/src/box/error.cc
> index c3c2af3ab..ca1d73e0c 100644
> --- a/src/box/error.cc
> +++ b/src/box/error.cc
> @@ -221,6 +221,8 @@ ClientError::get_errcode(const struct error *e)
>   		return ER_SYSTEM;
>   	if (type_cast(CollationError, e))
>   		return ER_CANT_CREATE_COLLATION;
> +	if (type_cast(XlogGapError, e))
> +		return ER_XLOG_GAP;
>   	return ER_PROC_LUA;
>   }
>   
> diff --git a/src/box/error.h b/src/box/error.h
> index 988b98255..338121dd9 100644
> --- a/src/box/error.h
> +++ b/src/box/error.h
> @@ -178,6 +178,7 @@ box_error_new(const char *file, unsigned line, uint32_t code,
>   
>   extern const struct type_info type_ClientError;
>   extern const struct type_info type_XlogError;
> +extern const struct type_info type_XlogGapError;
>   extern const struct type_info type_AccessDeniedError;
>   extern const struct type_info type_CustomError;
>   
> diff --git a/src/box/recovery.h b/src/box/recovery.h
> index 6e68abc0b..b8d83951a 100644
> --- a/src/box/recovery.h
> +++ b/src/box/recovery.h
> @@ -40,8 +40,6 @@
>   extern "C" {
>   #endif /* defined(__cplusplus) */
>   
> -extern const struct type_info type_XlogGapError;
> -
>   struct xrow_header;
>   struct xstream;
>   
> diff --git a/test/box/error.result b/test/box/error.result
> index cdecdb221..600517316 100644
> --- a/test/box/error.result
> +++ b/test/box/error.result
> @@ -437,6 +437,7 @@ t;
>    |   216: box.error.SYNC_QUORUM_TIMEOUT
>    |   217: box.error.SYNC_ROLLBACK
>    |   218: box.error.TUPLE_METADATA_IS_TOO_BIG
> + |   219: box.error.XLOG_GAP
>    | ...
>   
>   test_run:cmd("setopt delimiter ''");
LGTM

-- 
Serge Petrenko

  reply	other threads:[~2020-09-15  7:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-14 23:11 [Tarantool-patches] [PATCH v2 0/4] Boot with anon Vladislav Shpilevoy
2020-09-14 23:11 ` [Tarantool-patches] [PATCH v2 1/4] xlog: introduce an error code for XlogGapError Vladislav Shpilevoy
2020-09-15  7:53   ` Serge Petrenko [this message]
2020-09-14 23:11 ` [Tarantool-patches] [PATCH v2 2/4] replication: retry in case of XlogGapError Vladislav Shpilevoy
2020-09-15  7:35   ` Serge Petrenko
2020-09-15 21:23     ` Vladislav Shpilevoy
2020-09-16 10:59       ` Serge Petrenko
2020-09-14 23:11 ` [Tarantool-patches] [PATCH v2 3/4] replication: add is_anon flag to ballot Vladislav Shpilevoy
2020-09-15  7:46   ` Serge Petrenko
2020-09-15 21:22     ` Vladislav Shpilevoy
2020-09-16 10:59       ` Serge Petrenko
2020-09-14 23:11 ` [Tarantool-patches] [PATCH v2 4/4] replication: do not register outgoing connections Vladislav Shpilevoy
2020-09-15  7:50   ` Serge Petrenko
2020-09-17 12:08 ` [Tarantool-patches] [PATCH v2 0/4] Boot with anon Kirill Yukhin
2020-09-17 13:00   ` Vladislav Shpilevoy
2020-09-17 15:04     ` Kirill Yukhin
2020-09-17 16:42       ` Vladislav Shpilevoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e81692bb-0d98-2a88-caf9-953846a5c7a0@tarantool.org \
    --to=sergepetrenko@tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2 1/4] xlog: introduce an error code for XlogGapError' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox