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 6/6] Replace schema lock with fine-grained locking
Date: Thu, 4 Jul 2019 11:09:09 +0300	[thread overview]
Message-ID: <20190704080909.GB24820@atlas> (raw)
In-Reply-To: <20190703195605.dhuoxv7xrxqzklug@esperanza>

* Vladimir Davydov <vdavydov.dev@gmail.com> [19/07/03 23:00]:
> TBO I don't think you follow. It isn't a lock, actually. It's just a
> flag saying the space is busy building an index. If someone tries to do
> something with a space that is busy, they will fail. This is consistent
> with vinyl tx manager behavior. No deadlock is possible by design.

It's a kind of locking called optimistic locking. Any lock can be acquired in
optimistic mode (_trylock()) and in pessimistic mode. Once you
have normal locks you can trylock them ad nausea, the only
question is whether users will like it. Imagine I have a DDL
script which I use to update/upgrade my data on production. Do I really
want to add re-tries to this DDL script now that I know it worked
in my test environment? Most users don't. 

With transactional data dictionary multiple metadata locks are
around the corner. 

Imagine this:

box.begin()
box.space.foo:rename('tmp')
box.space.bar:rename('foo')
box.space.foo:rename('bar')
box.commit()

the same can will soon be possible to do in SQL as well. 

all these locks will have to stay around till commit, so leave
through WAL yield.

In other words, we either need to switch the data dictionary to
MVCC or to use locks, or better yet, have both mechanisms
available so that we can use whichever we need when we need it.


-- 
Konstantin Osipov, Moscow, Russia

  reply	other threads:[~2019-07-04  8:09 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-30 19:40 [PATCH 0/6] Get rid of the schema lock Vladimir Davydov
2019-06-30 19:40 ` [PATCH 1/6] Add ERROR_INJECT_YIELD and ERROR_INJECT_SLEEP helpers Vladimir Davydov
2019-07-03 19:12   ` Konstantin Osipov
2019-07-04 15:50     ` Vladimir Davydov
2019-06-30 19:40 ` [PATCH 2/6] Replace ERRINJ_SNAP_WRITE_ROW_TIMEOUT with ERRINJ_SNAP_WRITE_DELAY Vladimir Davydov
2019-07-03 19:13   ` Konstantin Osipov
2019-07-04 15:51     ` Vladimir Davydov
2019-06-30 19:40 ` [PATCH 3/6] Don't take schema lock for checkpointing Vladimir Davydov
2019-07-03 19:21   ` Konstantin Osipov
2019-07-03 20:05     ` Vladimir Davydov
2019-06-30 19:40 ` [PATCH 4/6] test: make vinyl/replica_rejoin more stable Vladimir Davydov
2019-07-03 19:23   ` Konstantin Osipov
2019-07-04 15:51     ` Vladimir Davydov
2019-06-30 19:40 ` [PATCH 5/6] vinyl: don't yield while logging index creation Vladimir Davydov
2019-06-30 19:40 ` [PATCH 6/6] Replace schema lock with fine-grained locking Vladimir Davydov
2019-07-03 19:35   ` Konstantin Osipov
2019-07-03 19:56     ` Vladimir Davydov
2019-07-04  8:09       ` Konstantin Osipov [this message]
2019-07-04 17:06         ` Vladimir Davydov
2019-07-08  7:40           ` Konstantin Osipov
2019-07-08  8:41             ` Vladimir Davydov
2019-07-05  8:53 ` [PATCH 0/6] Get rid of the schema lock 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=20190704080909.GB24820@atlas \
    --to=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [PATCH 6/6] Replace schema lock with fine-grained locking' \
    /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