Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Nikita Pettik <korablev@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 3/3] upgrade: fix generated sequence upgrade from 2.1
Date: Sat, 22 Feb 2020 17:16:41 +0100	[thread overview]
Message-ID: <1be103a9-a27a-5f17-1780-7877981f91cd@tarantool.org> (raw)
In-Reply-To: <20200221154244.GE51816@tarantool.org>

Thanks for the review!

On 21/02/2020 16:42, Nikita Pettik wrote:
> On 17 Feb 21:57, Vladislav Shpilevoy wrote:
>> The bug was in an attempt to update a record in _space_sequence
>> in-place, to add field path and number. This was not properly
>> supported by the system space's trigger, and was banned in the
>> previous patch of this series.
>>
>> But delete + tuple update + insert work fine. The patch uses them.
>>
>> To test it the old disabled and heavily outdated
>> xlog/upgrade.test.lua was replaced with a smaller analogue, which
>> is supposed to be created separately for each upgrade bug.
>> According to the new policy of creating test files.
>>
>> The patch tries to make it easy to add new upgrade tests and
>> snapshots. A new test should consist of fill.lua script to
>> populate spaces, snapshot, needed xlogs, and a .test.lua file.
>> Fill script and binaries should be in the same folder as test file
>> name, which is located in version folder. Like this:
> 
> I'm okay with this approach but could you document it somewhere
> (e.g. on our wiki github page)?

Ok, added a file with instructions to xlog/upgrade. I decided not to
add it to wiki, because anyway no one reads it, when just wants to add
a test. There is a higher chance, that this file will be noticed.

diff --git a/test/xlog/upgrade/how_to_add_new_test.md b/test/xlog/upgrade/how_to_add_new_test.md
new file mode 100644
index 000000000..3fa3c2d44
--- /dev/null
+++ b/test/xlog/upgrade/how_to_add_new_test.md
@@ -0,0 +1,36 @@
+## How to add a new upgrade test
+
+Firstly, for a new test should be prepared a `fill.lua` file. Here
+should be code to populate needed spaces, create xlogs, snapshots.
+
+`Fill.lua` should be run in an old Tarantool version, upgrade from
+which is going to be tested. This will produce `.xlog` and `.snap`
+files. They should be saved into
+`xlog/upgrade/<version>/<test_name>/` folder. Snapshot is usually
+enough. Version is the old Tarantool version. Test name is a name
+of test file, which will test recovery from these xlogs. It should
+obey to the same rules as other test file names.
+
+Secondly, it is necessary to add a `<test_name>.test.lua` file to
+`xlog/` folder, to all the other tests. It should start a new
+instance of Tarantool with workdir set to
+`xlog/upgrade/<version>/<test_name>/`. Then this file should
+ensure, that `box.upgrade()` works fine, and all data is recovered
+correctly.
+
+The following directory structure should be in the result:
+```
+ xlog/
+ |
+ +- <test_name>.test.lua
+ |
+ +- upgrade/
+    |
+    +- <version>/
+        |
+        +- <test_name>/
+           |
+           +- fill.lua
+           +- *.snap
+           +- *.xlog
+```

  reply	other threads:[~2020-02-22 16:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-17 20:57 [Tarantool-patches] [PATCH 0/3] Fix upgrade from 2.1 sequence Vladislav Shpilevoy
2020-02-17 20:57 ` [Tarantool-patches] [PATCH 1/3] upgrade: add missing sys triggers off and erasure Vladislav Shpilevoy
2020-02-21 15:20   ` Nikita Pettik
2020-02-22 16:17     ` Vladislav Shpilevoy
2020-02-17 20:57 ` [Tarantool-patches] [PATCH 2/3] box: forbid to update/replace _space_sequence Vladislav Shpilevoy
2020-02-21 15:29   ` Nikita Pettik
2020-02-22 16:16     ` Vladislav Shpilevoy
2020-02-17 20:57 ` [Tarantool-patches] [PATCH 3/3] upgrade: fix generated sequence upgrade from 2.1 Vladislav Shpilevoy
2020-02-21 15:42   ` Nikita Pettik
2020-02-22 16:16     ` Vladislav Shpilevoy [this message]
2020-02-24 19:48 ` [Tarantool-patches] [PATCH 0/3] Fix upgrade from 2.1 sequence Kirill Yukhin

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=1be103a9-a27a-5f17-1780-7877981f91cd@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=korablev@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 3/3] upgrade: fix generated sequence upgrade from 2.1' \
    /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