From: Aleksandr Lyapunov <alyapunov@tarantool.org>
To: Nikita Pettik <korablev@tarantool.org>,
tarantool-patches@dev.tarantool.org
Cc: v.shpilevoy@tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 1/2] vinyl: validate resulting tuple after upsert is applied
Date: Mon, 22 Jun 2020 22:28:03 +0300 [thread overview]
Message-ID: <2baa1b19-c357-754a-d13c-9ced27490e88@tarantool.org> (raw)
In-Reply-To: <cde2578032347540029c2a324d9e50d90c0af64b.1586808463.git.korablev@tarantool.org>
Hi! thank again. See my comment below.
On 4/14/20 12:55 AM, Nikita Pettik wrote:
> diff --git a/src/box/vy_upsert.c b/src/box/vy_upsert.c
> index ebea2789c..6855b9820 100644
> --- a/src/box/vy_upsert.c
> +++ b/src/box/vy_upsert.c
> @@ -134,6 +134,10 @@ vy_apply_upsert(const struct tuple *new_stmt, const struct tuple *old_stmt,
> &mp_size, 0, suppress_error,
> &column_mask);
> result_mp_end = result_mp + mp_size;
> + if (tuple_validate_raw(format, result_mp) != 0) {
> + region_truncate(region, region_svp);
> + return NULL;
> + }
That is wrong for UPSERT-UPSERT case.
The result of applying an upsert to another must be such a cumulative
upsert that being applied to anything must have the same result as
two original upserts applied sequentially.
Also in any case, inapplicable ops must be skipped and inapplicable whole
upsert must be skipped.
Suppose we have two upserts:
upsert1 = {tuple1, {ops1}} and upsert2 = {tuple2, {ops2}},
and {ops2} are not applicable to tuple1.
What cumulative upsert must we create?
1)if apllied to NULL or DELETE first upsert must insert tuple1 and upsert2
must be skipped and thus the result must be tuple1.
2)if applied to some good tuple - all ops {ops1,ops2} must be applied.
Thus the cumulative upsert must be like:
{tuple1, {ops1, ops2}}
But in your code you create:
{tuple1, {ops1}}
next prev parent reply other threads:[~2020-06-22 19:28 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 [this message]
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
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=2baa1b19-c357-754a-d13c-9ced27490e88@tarantool.org \
--to=alyapunov@tarantool.org \
--cc=korablev@tarantool.org \
--cc=tarantool-patches@dev.tarantool.org \
--cc=v.shpilevoy@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH 1/2] vinyl: validate resulting tuple after upsert is applied' \
/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