Tarantool development patches archive
 help / color / mirror / Atom feed
* [PATCH] Revert "Add more tests for DDL outside autocommit mode."
@ 2019-04-05 21:32 Alexander Turenko
  2019-04-07  6:34 ` Alexander Turenko
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Turenko @ 2019-04-05 21:32 UTC (permalink / raw)
  To: Konstantin Osipov, Kirill Yukhin, Vladimir Davydov
  Cc: Alexander Turenko, tarantool-patches

This reverts commit 14a87bb712277ab49db564914ed33de538437250.

The test cases generate corrupted xlog files (see #4093) and don't allow
other tests to proceed successfully, so we need to temporary disable
these cases. They should be enabled back in the scope of #4093.
---

https://github.com/tarantool/tarantool/issues/4093
https://github.com/tarantool/tarantool/tree/Totktonada/revert-ddl-txn-test

 test/box/transaction.result   | 172 ----------------------------------
 test/box/transaction.test.lua | 107 ---------------------
 2 files changed, 279 deletions(-)

diff --git a/test/box/transaction.result b/test/box/transaction.result
index bc50735b7..807cd5c7c 100644
--- a/test/box/transaction.result
+++ b/test/box/transaction.result
@@ -526,175 +526,3 @@ space:select()
 space:drop()
 ---
 ...
--- In order to implement a transactional applier, we  lifted a
--- restriction that DDL must always run in autocommit mode. The
--- applier always starts a multi-statement transaction, even for
--- single-statement transactions received from the master. Now
--- we only require a DDL statement to be the first statement in a
--- transaction. We even allow DDL to be followed by DML, since
--- it's harmless: if DML yields, the entire transaction is rolled
--- back by a yield trigger. Test that.
-_ = box.schema.space.create('memtx', {engine='memtx'})
----
-...
-_ = box.space.memtx:create_index('pk')
----
-...
-box.space.memtx:insert{1, 'memtx'}
----
-- [1, 'memtx']
-...
-_ = box.schema.space.create('vinyl', {engine='vinyl'})
----
-...
-_ = box.space.vinyl:create_index('pk')
----
-...
-box.space.vinyl:insert{1, 'vinyl'}
----
-- [1, 'vinyl']
-...
-_ = box.schema.space.create('test')
----
-...
-test_run:cmd("setopt delimiter ';'")
----
-- true
-...
---
--- Test DDL object creation and deletion should leave no
--- effects after rollback
---
-box.begin()
-box.space.test:create_index('pk')
-box.rollback();
----
-...
-box.space.test.index.pk;
----
-- null
-...
---
---
-_ = box.space.test:create_index('pk');
----
-...
-box.space.test:insert{1}
-
-box.begin()
-box.space.test:truncate()
-box.rollback();
----
-...
-box.space.test:select{};
----
-- - [1]
-...
---
---
--- DDL followed by a select from memtx space. Such
--- a select doesn't yield.
---
-box.begin()
-box.space.test:truncate()
-box.space.memtx:select{}
-box.commit();
----
-...
--- DDL and select from a vinyl space. Multi-engine transaction
--- is not allowed.
--- A transaction is left open due to an exception in the Lua fragment
-box.begin()
-box.space.test:truncate()
-box.space.vinyl:select{}
-
-box.rollback();
----
-- error: A multi-statement transaction can not use multiple storage engines
-...
--- DDL as a second statement - doesn't work
-box.begin()
-box.space.memtx:insert{2, 'truncate'}
-box.space.test:truncate();
----
-- error: 'Operation is not permitted when there is an active transaction '
-...
--- A transaction is left open due to an exception in the Lua fragment
-box.rollback();
----
-...
-box.space.memtx:select{};
----
-- - [1, 'memtx']
-...
--- DML as a second statement - works if the engine is the same
-box.begin()
-box.space.test:truncate()
-box.space.memtx:insert{2, 'truncate'}
-box.commit();
----
-...
-box.space.memtx:select{};
----
-- - [1, 'memtx']
-  - [2, 'truncate']
-...
--- DML as a second statement - works if the engine is the same
-box.begin()
-box.space.test:truncate()
-box.space.vinyl:insert{2, 'truncate'};
----
-- error: A multi-statement transaction can not use multiple storage engines
-...
--- A transaction is left open due to an exception in the above fragment
-box.rollback();
----
-...
-box.space.vinyl:select{};
----
-- - [1, 'vinyl']
-...
--- Two DDL satements in a row
-box.begin()
-box.space.test:truncate()
-box.space.test:truncate();
----
-- error: Space _truncate does not support multi-statement transactions
-...
--- A transaction is left open due to an exception in the above fragment
-box.rollback();
----
-...
--- Two DDL stateemnts on different engines
-box.begin()
-box.space.memtx:truncate()
-box.space.vinyl:truncate();
----
-- error: Space _truncate does not support multi-statement transactions
-...
-box.rollback();
----
-...
-box.space.memtx:select{};
----
-- - [1, 'memtx']
-  - [2, 'truncate']
-...
-box.space.vinyl:select{};
----
-- - [1, 'vinyl']
-...
--- cleanup
-test_run:cmd("setopt delimiter ''");
----
-- true
-...
-if box.space.test then box.space.test:drop() end
----
-...
-box.space.memtx:drop()
----
-...
-box.space.vinyl:drop()
----
-...
diff --git a/test/box/transaction.test.lua b/test/box/transaction.test.lua
index a6789316c..0d212ca29 100644
--- a/test/box/transaction.test.lua
+++ b/test/box/transaction.test.lua
@@ -256,110 +256,3 @@ test_run:cmd("setopt delimiter ''");
 
 space:select()
 space:drop()
-
--- In order to implement a transactional applier, we  lifted a
--- restriction that DDL must always run in autocommit mode. The
--- applier always starts a multi-statement transaction, even for
--- single-statement transactions received from the master. Now
--- we only require a DDL statement to be the first statement in a
--- transaction. We even allow DDL to be followed by DML, since
--- it's harmless: if DML yields, the entire transaction is rolled
--- back by a yield trigger. Test that.
-_ = box.schema.space.create('memtx', {engine='memtx'})
-_ = box.space.memtx:create_index('pk')
-box.space.memtx:insert{1, 'memtx'}
-_ = box.schema.space.create('vinyl', {engine='vinyl'})
-_ = box.space.vinyl:create_index('pk')
-box.space.vinyl:insert{1, 'vinyl'}
-_ = box.schema.space.create('test')
-
-test_run:cmd("setopt delimiter ';'")
---
--- Test DDL object creation and deletion should leave no
--- effects after rollback
---
-box.begin()
-box.space.test:create_index('pk')
-box.rollback();
-box.space.test.index.pk;
---
---
-_ = box.space.test:create_index('pk');
-box.space.test:insert{1}
-
-box.begin()
-box.space.test:truncate()
-box.rollback();
-box.space.test:select{};
---
---
--- DDL followed by a select from memtx space. Such
--- a select doesn't yield.
---
-box.begin()
-box.space.test:truncate()
-box.space.memtx:select{}
-box.commit();
-
--- DDL and select from a vinyl space. Multi-engine transaction
--- is not allowed.
-box.begin()
-box.space.test:truncate()
-box.space.vinyl:select{}
-
--- A transaction is left open due to an exception in the Lua fragment
-box.rollback();
-
--- DDL as a second statement - doesn't work
-box.begin()
-box.space.memtx:insert{2, 'truncate'}
-box.space.test:truncate();
-
--- A transaction is left open due to an exception in the Lua fragment
-box.rollback();
-
-box.space.memtx:select{};
-
--- DML as a second statement - works if the engine is the same
-box.begin()
-box.space.test:truncate()
-box.space.memtx:insert{2, 'truncate'}
-box.commit();
-
-box.space.memtx:select{};
-
--- DML as a second statement - works if the engine is the same
-box.begin()
-box.space.test:truncate()
-box.space.vinyl:insert{2, 'truncate'};
-
--- A transaction is left open due to an exception in the above fragment
-box.rollback();
-
-box.space.vinyl:select{};
-
--- Two DDL satements in a row
-box.begin()
-box.space.test:truncate()
-box.space.test:truncate();
-
--- A transaction is left open due to an exception in the above fragment
-box.rollback();
-
--- Two DDL stateemnts on different engines
-box.begin()
-box.space.memtx:truncate()
-box.space.vinyl:truncate();
-
-box.rollback();
-
-box.space.memtx:select{};
-box.space.vinyl:select{};
-
--- cleanup
-test_run:cmd("setopt delimiter ''");
-
-if box.space.test then box.space.test:drop() end
-box.space.memtx:drop()
-box.space.vinyl:drop()
-
-- 
2.20.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Revert "Add more tests for DDL outside autocommit mode."
  2019-04-05 21:32 [PATCH] Revert "Add more tests for DDL outside autocommit mode." Alexander Turenko
@ 2019-04-07  6:34 ` Alexander Turenko
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Turenko @ 2019-04-07  6:34 UTC (permalink / raw)
  To: Konstantin Osipov, Kirill Yukhin, Vladimir Davydov; +Cc: tarantool-patches

Konstantin says 'ok' privately.

Pushed to master. Updated the issue (#4093) to don't forget to enable
these test cases back.

WBR, Alexander Turenko.

On Sat, Apr 06, 2019 at 12:32:26AM +0300, Alexander Turenko wrote:
> This reverts commit 14a87bb712277ab49db564914ed33de538437250.
> 
> The test cases generate corrupted xlog files (see #4093) and don't allow
> other tests to proceed successfully, so we need to temporary disable
> these cases. They should be enabled back in the scope of #4093.
> ---
> 
> https://github.com/tarantool/tarantool/issues/4093
> https://github.com/tarantool/tarantool/tree/Totktonada/revert-ddl-txn-test
> 
>  test/box/transaction.result   | 172 ----------------------------------
>  test/box/transaction.test.lua | 107 ---------------------
>  2 files changed, 279 deletions(-)
> 
> diff --git a/test/box/transaction.result b/test/box/transaction.result
> index bc50735b7..807cd5c7c 100644
> --- a/test/box/transaction.result
> +++ b/test/box/transaction.result
> @@ -526,175 +526,3 @@ space:select()
>  space:drop()
>  ---
>  ...
> --- In order to implement a transactional applier, we  lifted a
> --- restriction that DDL must always run in autocommit mode. The
> --- applier always starts a multi-statement transaction, even for
> --- single-statement transactions received from the master. Now
> --- we only require a DDL statement to be the first statement in a
> --- transaction. We even allow DDL to be followed by DML, since
> --- it's harmless: if DML yields, the entire transaction is rolled
> --- back by a yield trigger. Test that.
> -_ = box.schema.space.create('memtx', {engine='memtx'})
> ----
> -...
> -_ = box.space.memtx:create_index('pk')
> ----
> -...
> -box.space.memtx:insert{1, 'memtx'}
> ----
> -- [1, 'memtx']
> -...
> -_ = box.schema.space.create('vinyl', {engine='vinyl'})
> ----
> -...
> -_ = box.space.vinyl:create_index('pk')
> ----
> -...
> -box.space.vinyl:insert{1, 'vinyl'}
> ----
> -- [1, 'vinyl']
> -...
> -_ = box.schema.space.create('test')
> ----
> -...
> -test_run:cmd("setopt delimiter ';'")
> ----
> -- true
> -...
> ---
> --- Test DDL object creation and deletion should leave no
> --- effects after rollback
> ---
> -box.begin()
> -box.space.test:create_index('pk')
> -box.rollback();
> ----
> -...
> -box.space.test.index.pk;
> ----
> -- null
> -...
> ---
> ---
> -_ = box.space.test:create_index('pk');
> ----
> -...
> -box.space.test:insert{1}
> -
> -box.begin()
> -box.space.test:truncate()
> -box.rollback();
> ----
> -...
> -box.space.test:select{};
> ----
> -- - [1]
> -...
> ---
> ---
> --- DDL followed by a select from memtx space. Such
> --- a select doesn't yield.
> ---
> -box.begin()
> -box.space.test:truncate()
> -box.space.memtx:select{}
> -box.commit();
> ----
> -...
> --- DDL and select from a vinyl space. Multi-engine transaction
> --- is not allowed.
> --- A transaction is left open due to an exception in the Lua fragment
> -box.begin()
> -box.space.test:truncate()
> -box.space.vinyl:select{}
> -
> -box.rollback();
> ----
> -- error: A multi-statement transaction can not use multiple storage engines
> -...
> --- DDL as a second statement - doesn't work
> -box.begin()
> -box.space.memtx:insert{2, 'truncate'}
> -box.space.test:truncate();
> ----
> -- error: 'Operation is not permitted when there is an active transaction '
> -...
> --- A transaction is left open due to an exception in the Lua fragment
> -box.rollback();
> ----
> -...
> -box.space.memtx:select{};
> ----
> -- - [1, 'memtx']
> -...
> --- DML as a second statement - works if the engine is the same
> -box.begin()
> -box.space.test:truncate()
> -box.space.memtx:insert{2, 'truncate'}
> -box.commit();
> ----
> -...
> -box.space.memtx:select{};
> ----
> -- - [1, 'memtx']
> -  - [2, 'truncate']
> -...
> --- DML as a second statement - works if the engine is the same
> -box.begin()
> -box.space.test:truncate()
> -box.space.vinyl:insert{2, 'truncate'};
> ----
> -- error: A multi-statement transaction can not use multiple storage engines
> -...
> --- A transaction is left open due to an exception in the above fragment
> -box.rollback();
> ----
> -...
> -box.space.vinyl:select{};
> ----
> -- - [1, 'vinyl']
> -...
> --- Two DDL satements in a row
> -box.begin()
> -box.space.test:truncate()
> -box.space.test:truncate();
> ----
> -- error: Space _truncate does not support multi-statement transactions
> -...
> --- A transaction is left open due to an exception in the above fragment
> -box.rollback();
> ----
> -...
> --- Two DDL stateemnts on different engines
> -box.begin()
> -box.space.memtx:truncate()
> -box.space.vinyl:truncate();
> ----
> -- error: Space _truncate does not support multi-statement transactions
> -...
> -box.rollback();
> ----
> -...
> -box.space.memtx:select{};
> ----
> -- - [1, 'memtx']
> -  - [2, 'truncate']
> -...
> -box.space.vinyl:select{};
> ----
> -- - [1, 'vinyl']
> -...
> --- cleanup
> -test_run:cmd("setopt delimiter ''");
> ----
> -- true
> -...
> -if box.space.test then box.space.test:drop() end
> ----
> -...
> -box.space.memtx:drop()
> ----
> -...
> -box.space.vinyl:drop()
> ----
> -...
> diff --git a/test/box/transaction.test.lua b/test/box/transaction.test.lua
> index a6789316c..0d212ca29 100644
> --- a/test/box/transaction.test.lua
> +++ b/test/box/transaction.test.lua
> @@ -256,110 +256,3 @@ test_run:cmd("setopt delimiter ''");
>  
>  space:select()
>  space:drop()
> -
> --- In order to implement a transactional applier, we  lifted a
> --- restriction that DDL must always run in autocommit mode. The
> --- applier always starts a multi-statement transaction, even for
> --- single-statement transactions received from the master. Now
> --- we only require a DDL statement to be the first statement in a
> --- transaction. We even allow DDL to be followed by DML, since
> --- it's harmless: if DML yields, the entire transaction is rolled
> --- back by a yield trigger. Test that.
> -_ = box.schema.space.create('memtx', {engine='memtx'})
> -_ = box.space.memtx:create_index('pk')
> -box.space.memtx:insert{1, 'memtx'}
> -_ = box.schema.space.create('vinyl', {engine='vinyl'})
> -_ = box.space.vinyl:create_index('pk')
> -box.space.vinyl:insert{1, 'vinyl'}
> -_ = box.schema.space.create('test')
> -
> -test_run:cmd("setopt delimiter ';'")
> ---
> --- Test DDL object creation and deletion should leave no
> --- effects after rollback
> ---
> -box.begin()
> -box.space.test:create_index('pk')
> -box.rollback();
> -box.space.test.index.pk;
> ---
> ---
> -_ = box.space.test:create_index('pk');
> -box.space.test:insert{1}
> -
> -box.begin()
> -box.space.test:truncate()
> -box.rollback();
> -box.space.test:select{};
> ---
> ---
> --- DDL followed by a select from memtx space. Such
> --- a select doesn't yield.
> ---
> -box.begin()
> -box.space.test:truncate()
> -box.space.memtx:select{}
> -box.commit();
> -
> --- DDL and select from a vinyl space. Multi-engine transaction
> --- is not allowed.
> -box.begin()
> -box.space.test:truncate()
> -box.space.vinyl:select{}
> -
> --- A transaction is left open due to an exception in the Lua fragment
> -box.rollback();
> -
> --- DDL as a second statement - doesn't work
> -box.begin()
> -box.space.memtx:insert{2, 'truncate'}
> -box.space.test:truncate();
> -
> --- A transaction is left open due to an exception in the Lua fragment
> -box.rollback();
> -
> -box.space.memtx:select{};
> -
> --- DML as a second statement - works if the engine is the same
> -box.begin()
> -box.space.test:truncate()
> -box.space.memtx:insert{2, 'truncate'}
> -box.commit();
> -
> -box.space.memtx:select{};
> -
> --- DML as a second statement - works if the engine is the same
> -box.begin()
> -box.space.test:truncate()
> -box.space.vinyl:insert{2, 'truncate'};
> -
> --- A transaction is left open due to an exception in the above fragment
> -box.rollback();
> -
> -box.space.vinyl:select{};
> -
> --- Two DDL satements in a row
> -box.begin()
> -box.space.test:truncate()
> -box.space.test:truncate();
> -
> --- A transaction is left open due to an exception in the above fragment
> -box.rollback();
> -
> --- Two DDL stateemnts on different engines
> -box.begin()
> -box.space.memtx:truncate()
> -box.space.vinyl:truncate();
> -
> -box.rollback();
> -
> -box.space.memtx:select{};
> -box.space.vinyl:select{};
> -
> --- cleanup
> -test_run:cmd("setopt delimiter ''");
> -
> -if box.space.test then box.space.test:drop() end
> -box.space.memtx:drop()
> -box.space.vinyl:drop()
> -
> -- 
> 2.20.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-07  6:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-05 21:32 [PATCH] Revert "Add more tests for DDL outside autocommit mode." Alexander Turenko
2019-04-07  6:34 ` Alexander Turenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox