Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Nikita Pettik <korablev@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 2/2] vinyl: skip invalid upserts during squash
Date: Fri, 29 May 2020 23:47:14 +0200	[thread overview]
Message-ID: <7039aa7a-035a-8499-ff2c-de2b7509b788@tarantool.org> (raw)
In-Reply-To: <20200527200506.GC17325@tarantool.org>

Thanks for the fixes!

>>> diff --git a/src/box/vy_write_iterator.c b/src/box/vy_write_iterator.c
>>> index 7a6a20627..4d34d96c8 100644
>>> --- a/src/box/vy_write_iterator.c
>>> +++ b/src/box/vy_write_iterator.c
>>> @@ -850,10 +850,23 @@ vy_read_view_merge(struct vy_write_iterator *stream, struct tuple *hint,
>>>  		       vy_stmt_type(hint) != IPROTO_UPSERT);
>>>  		struct tuple *applied = vy_apply_upsert(h->tuple, hint,
>>>  				stream->cmp_def, stream->format, false);
>>> -		if (applied == NULL)
>>> -			return -1;
>>> -		vy_stmt_unref_if_possible(h->tuple);
>>> -		h->tuple = applied;
>>> +		if (applied == NULL) {
>>> +			/*
>>> +			 * Current upsert can't be applied.
>>> +			 * Let's skip it and log error.
>>> +			 */
>>> +			struct error *e = diag_last_error(diag_get());
>>> +			assert(e != NULL);
>>> +			if (e->type != &type_ClientError)
>>> +				return -1;
>>> +			say_info("upsert %s is not applied due to the error: %s",
>>> +				 vy_stmt_str(h->tuple), e->errmsg);
>>> +			vy_stmt_unref_if_possible(h->tuple);
>>
>> *. Why here we use sometimes say_info() and sometimes error_log()? Why
>> not something one?
> 
> Indeed, let's use here say_error():

Now in some places we use diag_log() and in other say_error() + vy_stmt_str().
How is it chosen when what to use?

  reply	other threads:[~2020-05-29 21:47 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-13 21:55 [Tarantool-patches] [PATCH 0/2] Validate result of upserts squash & skip invalid upserts which can't be applied Nikita Pettik
2020-04-13 21:55 ` [Tarantool-patches] [PATCH 1/2] vinyl: validate resulting tuple after upsert is applied Nikita Pettik
2020-06-22 19:28   ` Aleksandr Lyapunov
2020-04-13 21:55 ` [Tarantool-patches] [PATCH 2/2] vinyl: skip invalid upserts during squash Nikita Pettik
2020-04-13 22:12   ` Konstantin Osipov
2020-05-14  2:11     ` Nikita Pettik
2020-05-14  6:56       ` Konstantin Osipov
2020-05-19 19:10         ` Nikita Pettik
2020-05-19 19:39           ` Konstantin Osipov
2020-05-21  2:51             ` Nikita Pettik
2020-05-21  8:36               ` Konstantin Osipov
2020-05-01  0:31   ` Vladislav Shpilevoy
2020-05-14  2:21     ` Nikita Pettik
2020-05-14 21:32       ` Vladislav Shpilevoy
2020-05-19 18:18         ` Nikita Pettik
2020-05-20 22:13           ` Vladislav Shpilevoy
2020-05-26 21:33     ` Vladislav Shpilevoy
2020-05-27 20:05       ` Nikita Pettik
2020-05-29 21:47         ` Vladislav Shpilevoy [this message]
2020-06-01 19:24           ` Nikita Pettik
2020-05-20 22:13 ` [Tarantool-patches] [PATCH 0/2] Validate result of upserts squash & skip invalid upserts which can't be applied Vladislav Shpilevoy
2020-05-22  2:42   ` Nikita Pettik
2020-05-26 21:33     ` Vladislav Shpilevoy
2020-05-27 20:10       ` Nikita Pettik
2020-06-22 14:13     ` Aleksandr Lyapunov
2020-06-22 20:21       ` Nikita Pettik
2020-06-23 12:32         ` Aleksandr Lyapunov
2020-06-02 21:36 ` Vladislav Shpilevoy
2020-06-02 21:37   ` 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=7039aa7a-035a-8499-ff2c-de2b7509b788@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=korablev@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 2/2] vinyl: skip invalid upserts during squash' \
    /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