From: Konstantin Osipov <kostja@tarantool.org>
To: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: tarantool-patches@freelists.org
Subject: Re: [PATCH v2 3/3] ddl: allow to execute non-yielding DDL statements in transactions
Date: Thu, 11 Jul 2019 00:07:11 +0300	[thread overview]
Message-ID: <20190710210711.GP5619@atlas> (raw)
In-Reply-To: <9bc3823f622c5f4f1bd5defe0ad96b96f2217f25.1562763283.git.vdavydov.dev@gmail.com>
* Vladimir Davydov <vdavydov.dev@gmail.com> [19/07/10 16:13]:
A test plan for this feature:
1. A transaction which swaps two spaces by name.
name = foo.name;
foo.name = bar.name
bar.name = name
2. A transaction which creates a space, formats it to have an
   integer column, changes the format to 'any', changes the values
   to 'string', changes the format to 'string'
3. A transaction which creates a space, a user, and grants all privileges
   on this space to the user.Then sudoes to the user and tries to
   use the space.
4. A transaction, which revokes all privileges from a user and drops
   the space.
5. A transaction which creates a space and secondary indexes
6. A transaction which creates a space with a sequence.
7. Transactional drop a) empty b) nonempty space with all its belongings:
   secondary indexes, check constraints, sequences.
5. A transaction which creates a space and sets space triggers, as
   well as on_rollback trigger, then inserts a bunch of data and then
   a) commits b) rolls back.
6. An error injection crash test which starts 10 fibers which perform
   a random combination of transactional DDL in a loop, then,
   after 0.1 second ER_WAL_IO is enabled, fibers are joined,
   ER_WAL_IO is disabled. The DDL is using objects which names
   clash,  so that it does something useful, e.g:
   function name(object_type)
        return object_type_name ..  math.random(1, NUM_NAMES)
    end
    function ddl(object_type, object_name) 
        -- this function actually checks if the name exists 
        --  at the moment and only returns valid statements
        if object_type is user or role then
            return random("grant", "revoke", "create", "drop")
        end
        if object_type is table then 
            return random("create ", "format", "rename", "add
            index", "drop index", "rename index", "change index
            keys", "change unique -> non_unique", "add
            constraint", "drop constraint", "drop")
        end
    function gen_test()
        for each object type:
            eval = "box.begin()"
            eval = eval .. ddl(object_type, name(object_type))
            eval = eval .. "box.commit()"
        end
        return eval
    end
    function fiber()
        while true do
            eval(gen_test)
        end
    end
    for i in 1.. NUM_FIBERS do
        fibers[i] = fiber.create(fiber)
    end
    fiber.sleep(0.1)
    errinj.enable(er_wal_io)
    for i in 1.. NUM_FIBERS do
        fiber.join(fibers[i])
    end
    (cleanup all objects matching the name..$i pattern)
-- 
Konstantin Osipov, Moscow, Russia
next prev parent reply	other threads:[~2019-07-10 21:07 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
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 [this message]
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=20190710210711.GP5619@atlas \
    --to=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [PATCH v2 3/3] ddl: allow to execute non-yielding DDL statements in 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