Tarantool development patches archive
 help / color / mirror / Atom feed
From: Konstantin Osipov <kostja@tarantool.org>
To: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: tarantool-patches@freelists.org
Subject: Re: [PATCH 4/5] memtx: fix txn_on_yield for DDL transactions
Date: Mon, 8 Jul 2019 15:22:48 +0300	[thread overview]
Message-ID: <20190708122248.GC11062@atlas> (raw)
In-Reply-To: <9fb58e54aee22309ba87fd2d6bed6bd658ab2e6d.1562357452.git.vdavydov.dev@gmail.com>

* Vladimir Davydov <vdavydov.dev@gmail.com> [19/07/05 23:27]:
> Memtx engine doesn't allow yielding inside a transaction. To achieve
> that, it installs fiber->on_yield trigger that aborts the current
> transaction (rolls it back, but leaves it be so that commit fails).
> 
> There's an exception though - DDL statements are allowed to yield.
> This is required so as not to block the event loop while a new index
> is built or a space format is checked. Currently, we handle this
> exception by checking space id and omitting installation of the
> trigger for system spaces. This isn't entirely correct, because we
> may yield after a DDL statement is complete, in which case the
> transaction won't be aborted though it should:
> 
>   box.begin()
>   box.space.my_space:create_index('my_index')
>   fiber.sleep(0) -- doesn't abort the transaction!
> 
> This patch fixes the problem by making the memtx engine install the
> on_yield trigger unconditionally, for all kinds of transactions, and
> instead explicitly disabling the trigger for yielding DDL operations.

Nit: I think since we set up triggers in memtx_* methods, we
should clear them inside memtx_* subsystem as well.

so it's not txn_*, it's memtx_{enable|disable}_yields

another way to do it is to clear fiber->txn key whenever
check_format /build_index functions yield. Basically these
functions run in the background, in a transaction that is
temporarily detached from the main fiber so should not pollute the
caller fiber key.

this is perhaps an over engineering at this stage, but I still
would want you to consider this.

-- 
Konstantin Osipov, Moscow, Russia

  reply	other threads:[~2019-07-08 12:22 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-05 20:25 [PATCH 0/5] Transactional DDL Vladimir Davydov
2019-07-05 20:25 ` [PATCH 1/5] vinyl: don't sync WAL on space alter if not necessary Vladimir Davydov
2019-07-08  9:29   ` Konstantin Osipov
2019-07-08  9:50     ` Vladimir Davydov
2019-07-08 15:01   ` Vladimir Davydov
2019-07-05 20:25 ` [PATCH 2/5] txn: run on_rollback triggers on txn_abort Vladimir Davydov
2019-07-08  9:32   ` Konstantin Osipov
2019-07-08  9:57     ` Vladimir Davydov
2019-07-08 12:14       ` Konstantin Osipov
2019-07-08 16:37         ` Vladimir Davydov
2019-07-08 21:56           ` Konstantin Osipov
2019-07-09  8:49             ` Vladimir Davydov
2019-07-05 20:25 ` [PATCH 3/5] txn: fix execution order of commit triggers Vladimir Davydov
2019-07-08 12:17   ` Konstantin Osipov
2019-07-08 15:01   ` Vladimir Davydov
2019-07-05 20:25 ` [PATCH 4/5] memtx: fix txn_on_yield for DDL transactions Vladimir Davydov
2019-07-08 12:22   ` Konstantin Osipov [this message]
2019-07-08 16:41     ` Vladimir Davydov
2019-07-08 16:58       ` Vladimir Davydov
2019-07-09 10:12         ` Vladimir Davydov
2019-07-08 21:57       ` Konstantin Osipov
2019-07-09  7:51         ` Vladimir Davydov
2019-07-05 20:25 ` [PATCH 5/5] Allow to execute non-yielding DDL statements in transactions Vladimir Davydov
2019-07-05 22:56   ` Konstantin Osipov
2019-07-08  8:09     ` Vladimir Davydov
2019-07-08  8:21       ` Konstantin Osipov
2019-07-08  8:43         ` Vladimir Davydov
2019-07-08  9:25           ` Konstantin Osipov
2019-07-08 16:46             ` Vladimir Davydov
2019-07-08 21:59               ` Konstantin Osipov
2019-07-08 12:26   ` Konstantin Osipov
2019-07-08 16:51     ` Vladimir Davydov
2019-07-08 22:02       ` Konstantin Osipov
2019-07-09  8:11         ` Vladimir Davydov
2019-07-09 11:03           ` Vladimir Davydov
2019-07-08 12:31   ` Konstantin Osipov
2019-07-08 17:00     ` 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=20190708122248.GC11062@atlas \
    --to=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [PATCH 4/5] 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