Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH v2] Add new error injection constant ERRINJ_AUTO_UPGRADE
@ 2020-05-18 15:10 sergeyb
  2020-06-02 11:56 ` Alexander Turenko
  2020-06-04 11:35 ` Kirill Yukhin
  0 siblings, 2 replies; 3+ messages in thread
From: sergeyb @ 2020-05-18 15:10 UTC (permalink / raw)
  To: tarantool-patches; +Cc: alexander.turenko

From: Sergey Bronnikov <sergeyb@tarantool.org>

In upgrade testing we need an ability to control running of upgrade.lua
script execution. When constant ERRINJ_AUTO_UPGRADE is set to true
tarantool will skip upgrade.lua script execution.

Part of: #4801
---
GH issue: https://github.com/tarantool/tarantool/issues/4801
GH branch: https://github.com/tarantool/tarantool/compare/ligurio/gh-4801-errinj_auto_upgrade

 src/box/lua/load_cfg.lua | 3 ++-
 src/lib/core/errinj.h    | 1 +
 test/box/errinj.result   | 3 ++-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/box/lua/load_cfg.lua b/src/box/lua/load_cfg.lua
index b671eb7a2..9feedaa40 100644
--- a/src/box/lua/load_cfg.lua
+++ b/src/box/lua/load_cfg.lua
@@ -571,7 +571,8 @@ local function load_cfg(cfg)
             end
         end
     end
-    if not box.cfg.read_only and not box.cfg.replication then
+    if not box.cfg.read_only and not box.cfg.replication and
+       not box.error.injection.get('ERRINJ_AUTO_UPGRADE') then
         box.schema.upgrade{auto = true}
     end
 end
diff --git a/src/lib/core/errinj.h b/src/lib/core/errinj.h
index ee6c57a0d..7eaa1ac48 100644
--- a/src/lib/core/errinj.h
+++ b/src/lib/core/errinj.h
@@ -139,6 +139,7 @@ struct errinj {
 	_(ERRINJ_FIBER_MPROTECT, ERRINJ_INT, {.iparam = -1}) \
 	_(ERRINJ_RELAY_FASTER_THAN_TX, ERRINJ_BOOL, {.bparam = false}) \
 	_(ERRINJ_INDEX_RESERVE, ERRINJ_BOOL, {.bparam = false})\
+	_(ERRINJ_AUTO_UPGRADE, ERRINJ_BOOL, {.bparam = false})\
 
 ENUM0(errinj_id, ERRINJ_LIST);
 extern struct errinj errinjs[];
diff --git a/test/box/errinj.result b/test/box/errinj.result
index 0d3fedeb3..9dfd8653d 100644
--- a/test/box/errinj.result
+++ b/test/box/errinj.result
@@ -43,7 +43,8 @@ end
 ...
 evals
 ---
-- - ERRINJ_BUILD_INDEX: -1
+- - ERRINJ_AUTO_UPGRADE: false
+  - ERRINJ_BUILD_INDEX: -1
   - ERRINJ_BUILD_INDEX_DELAY: false
   - ERRINJ_CHECK_FORMAT_DELAY: false
   - ERRINJ_COIO_SENDFILE_CHUNK: -1
-- 
2.23.0

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

* Re: [Tarantool-patches] [PATCH v2] Add new error injection constant ERRINJ_AUTO_UPGRADE
  2020-05-18 15:10 [Tarantool-patches] [PATCH v2] Add new error injection constant ERRINJ_AUTO_UPGRADE sergeyb
@ 2020-06-02 11:56 ` Alexander Turenko
  2020-06-04 11:35 ` Kirill Yukhin
  1 sibling, 0 replies; 3+ messages in thread
From: Alexander Turenko @ 2020-06-02 11:56 UTC (permalink / raw)
  To: sergeyb; +Cc: tarantool-patches

On Mon, May 18, 2020 at 06:10:06PM +0300, sergeyb@tarantool.org wrote:
> From: Sergey Bronnikov <sergeyb@tarantool.org>
> 
> In upgrade testing we need an ability to control running of upgrade.lua
> script execution. When constant ERRINJ_AUTO_UPGRADE is set to true
> tarantool will skip upgrade.lua script execution.
> 
> Part of: #4801
> ---
> GH issue: https://github.com/tarantool/tarantool/issues/4801
> GH branch: https://github.com/tarantool/tarantool/compare/ligurio/gh-4801-errinj_auto_upgrade

LGTM.

Don't think more reviews are needed here, the patch is simple.

CCed Kirill.

WBR, Alexander Turenko.

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

* Re: [Tarantool-patches] [PATCH v2] Add new error injection constant ERRINJ_AUTO_UPGRADE
  2020-05-18 15:10 [Tarantool-patches] [PATCH v2] Add new error injection constant ERRINJ_AUTO_UPGRADE sergeyb
  2020-06-02 11:56 ` Alexander Turenko
@ 2020-06-04 11:35 ` Kirill Yukhin
  1 sibling, 0 replies; 3+ messages in thread
From: Kirill Yukhin @ 2020-06-04 11:35 UTC (permalink / raw)
  To: sergeyb; +Cc: tarantool-patches, alexander.turenko

Hello,

On 18 май 18:10, sergeyb@tarantool.org wrote:
> From: Sergey Bronnikov <sergeyb@tarantool.org>
> 
> In upgrade testing we need an ability to control running of upgrade.lua
> script execution. When constant ERRINJ_AUTO_UPGRADE is set to true
> tarantool will skip upgrade.lua script execution.
> 
> Part of: #4801
> ---
> GH issue: https://github.com/tarantool/tarantool/issues/4801
> GH branch: https://github.com/tarantool/tarantool/compare/ligurio/gh-4801-errinj_auto_upgrade

I've checked your patch into 1.10, 2.3, 2.4 and master.

--
Regards, Kirill Yukhin

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

end of thread, other threads:[~2020-06-04 11:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-18 15:10 [Tarantool-patches] [PATCH v2] Add new error injection constant ERRINJ_AUTO_UPGRADE sergeyb
2020-06-02 11:56 ` Alexander Turenko
2020-06-04 11:35 ` Kirill Yukhin

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