From: Konstantin Osipov <kostja@scylladb.com>
To: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: tarantool-patches@freelists.org
Subject: Re: [PATCH v2 1/3] memtx: fix txn_on_yield for DDL transactions
Date: Fri, 12 Jul 2019 18:16:14 +0300 [thread overview]
Message-ID: <20190712151614.GC8020@atlas> (raw)
In-Reply-To: <20190712145419.2mesthmxtxxnt32l@esperanza>
* Vladimir Davydov <vdavydov.dev@gmail.com> [19/07/12 17:57]:
This is a very nice patch. Thank you for addressing my comments.
The bit fields is going to be trivial, so go ahead and don't
postpone it - it doesn't need a review.
One more comment below.
> diff --git a/src/box/vinyl.c b/src/box/vinyl.c
> index e0de65d0..7635c84c 100644
> --- a/src/box/vinyl.c
> +++ b/src/box/vinyl.c
> @@ -1093,6 +1093,7 @@ static int
> vinyl_space_check_format(struct space *space, struct tuple_format *format)
> {
> struct vy_env *env = vy_env(space->engine);
> + struct txn *txn = in_txn();
>
> /*
> * If this is local recovery, the space was checked before
> @@ -1121,6 +1122,8 @@ vinyl_space_check_format(struct space *space, struct tuple_format *format)
> bool need_wal_sync;
> tx_manager_abort_writers_for_ddl(env->xm, space, &need_wal_sync);
>
> + txn_can_yield(txn, true);
I keep forgetting how this can happen, and then remember it's a
*memtx* transaction.
Please add this comment:
/*
* Tarantool doesn't allow multi-engine transactions, and DDL
* system tables are memtx tables. Memtx transactions,
* generally, can't yield.
* So here we're in the middle of a *memtx* transaction. We don't
* start a hidden vinyl transaction for DDL either, to avoid its
* overhead. But some long DDL operations can yield, like
* checking a format or building an index.
* Unless we switch off memtx yield rollback triggers, such
* yield leads to memtx transaction rollback. It is safe to switch
* the trigger off though: it protects subsequent memtx
* transactions from reading a dirty state, and at this phase
* vinyl DDL does not change the data * dictionary, so there is
* no dirty state that can be observed.
*/
--
Konstantin Osipov, Moscow, Russia
next prev parent reply other threads:[~2019-07-12 15:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-10 13:09 [PATCH v2 0/3] Transactional DDL Vladimir Davydov
2019-07-10 13:09 ` [PATCH v2 1/3] memtx: fix txn_on_yield for DDL transactions Vladimir Davydov
2019-07-10 20:34 ` Konstantin Osipov
2019-07-12 14:54 ` Vladimir Davydov
2019-07-12 15:16 ` Konstantin Osipov [this message]
2019-07-10 13:09 ` [PATCH v2 2/3] ddl: don't use space_index from AlterSpaceOp::commit,rollback Vladimir Davydov
2019-07-15 15:05 ` Konstantin Osipov
2019-07-10 13:09 ` [PATCH v2 3/3] ddl: allow to execute non-yielding DDL statements in transactions Vladimir Davydov
2019-07-10 20:43 ` Konstantin Osipov
2019-07-12 14:55 ` Vladimir Davydov
2019-07-10 21:07 ` Konstantin Osipov
2019-07-15 15:03 ` Konstantin Osipov
2019-07-15 16:23 ` [PATCH v2 0/3] Transactional DDL Vladimir Davydov
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=20190712151614.GC8020@atlas \
--to=kostja@scylladb.com \
--cc=tarantool-patches@freelists.org \
--cc=vdavydov.dev@gmail.com \
--subject='Re: [PATCH v2 1/3] memtx: fix txn_on_yield for DDL transactions' \
/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