From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp33.i.mail.ru (smtp33.i.mail.ru [94.100.177.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 361C9469710 for ; Mon, 18 May 2020 18:12:07 +0300 (MSK) From: sergeyb@tarantool.org Date: Mon, 18 May 2020 18:10:06 +0300 Message-Id: <1dde0d093dc53b6a7819780b11801ae1ceba04ca.1589814593.git.sergeyb@tarantool.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v2] Add new error injection constant ERRINJ_AUTO_UPGRADE List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org Cc: alexander.turenko@tarantool.org From: Sergey Bronnikov 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