From 18b1ed401a5dee2d527076873cdb7ae9fb1f7e1e Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Tue, 6 Jun 2023 11:45:42 +0300 Subject: [PATCH 1/9] rockspec: unlock dependencies --- crud-scm-1.rockspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crud-scm-1.rockspec b/crud-scm-1.rockspec index d9da54cb..54b04fdf 100644 --- a/crud-scm-1.rockspec +++ b/crud-scm-1.rockspec @@ -7,8 +7,8 @@ source = { dependencies = { 'lua ~> 5.1', - 'checks == 3.1.0-1', - 'errors == 2.2.1-1', + 'checks >= 3.1.0-1', + 'errors >= 2.2.1-1', 'vshard >= 0.1.18-1', } From aa69aef9950cfc981952ca034d071ab3ae077aba Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Tue, 6 Jun 2023 11:54:56 +0300 Subject: [PATCH 2/9] ci: drop cartridge 1.2.0 Cartridge 1.2.0 was deprecated a long time ago after 2.x release. Now CI actually doesn't run with cartridge 1.2.0: after [1] we run tests with migrations, which depends on `cartridge >= 2.0.1-1, <3.0.0`, installing latest cartridge 2.x over expected 1.2.0. 1. https://github.com/tarantool/crud/commit/440977526461ea23d3e5c6b4cccc7c4fc11efa2f --- .github/workflows/test_on_push.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test_on_push.yaml b/.github/workflows/test_on_push.yaml index 2d66b699..3db5a2b6 100644 --- a/.github/workflows/test_on_push.yaml +++ b/.github/workflows/test_on_push.yaml @@ -30,8 +30,6 @@ jobs: - tarantool-version: "2.10" metrics-version: "0.10.0" cartridge-version: "2.7.8" - - tarantool-version: "1.10" - cartridge-version: "1.2.0" - tarantool-version: "2.10" coveralls: true metrics-version: "0.16.0" From 58ffd8c4898c234ba65ff00b632322b8018c4963 Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Tue, 6 Jun 2023 11:59:14 +0300 Subject: [PATCH 3/9] ci: bump module and SDK versions --- .github/workflows/reusable_test.yml | 2 +- .github/workflows/test_on_push.yaml | 36 ++++++++++++++--------------- deps.sh | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/reusable_test.yml b/.github/workflows/reusable_test.yml index 21b72f4b..b79f335c 100644 --- a/.github/workflows/reusable_test.yml +++ b/.github/workflows/reusable_test.yml @@ -35,7 +35,7 @@ jobs: run: ./deps.sh - name: Install metrics - run: tarantoolctl rocks install metrics 0.12.0 + run: tarantoolctl rocks install metrics 1.0.0 # This server starts and listen on 8084 port that is used for tests - name: Stop Mono server diff --git a/.github/workflows/test_on_push.yaml b/.github/workflows/test_on_push.yaml index 3db5a2b6..e176729e 100644 --- a/.github/workflows/test_on_push.yaml +++ b/.github/workflows/test_on_push.yaml @@ -13,27 +13,27 @@ jobs: matrix: # We need 1.10.6 here to check that module works with # old Tarantool versions that don't have "tuple-keydef"/"tuple-merger" support. - tarantool-version: ["1.10.6", "1.10", "2.2", "2.3", "2.4", "2.5", "2.6", "2.7", "2.8", "2.10"] + tarantool-version: ["1.10.6", "1.10", "2.2", "2.3", "2.4", "2.5", "2.6", "2.7", "2.8", "2.10", "2.11"] metrics-version: [""] - cartridge-version: ["2.7.8"] + cartridge-version: ["2.8.0"] remove-merger: [false] include: - tarantool-version: "1.10" - metrics-version: "0.16.0" - cartridge-version: "2.7.8" + metrics-version: "1.0.0" + cartridge-version: "2.8.0" - tarantool-version: "2.7" remove-merger: true - cartridge-version: "2.7.8" - - tarantool-version: "2.10" + cartridge-version: "2.8.0" + - tarantool-version: "2.11" metrics-version: "0.1.8" - cartridge-version: "2.7.8" - - tarantool-version: "2.10" + cartridge-version: "2.8.0" + - tarantool-version: "2.11" metrics-version: "0.10.0" - cartridge-version: "2.7.8" - - tarantool-version: "2.10" + cartridge-version: "2.8.0" + - tarantool-version: "2.11" coveralls: true - metrics-version: "0.16.0" - cartridge-version: "2.7.8" + metrics-version: "1.0.0" + cartridge-version: "2.8.0" fail-fast: false # Can't install older versions on 22.04, # see https://github.com/tarantool/setup-tarantool/issues/36 @@ -87,8 +87,8 @@ jobs: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository strategy: matrix: - tarantool-version: ["1.10", "2.10"] - metrics-version: ["0.12.0"] + tarantool-version: ["1.10", "2.11"] + metrics-version: ["1.0.0"] fail-fast: false runs-on: ubuntu-20.04 steps: @@ -122,10 +122,10 @@ jobs: matrix: tarantool-version: - folder: "1.10" - bundle: "tarantool-enterprise-sdk-1.10.13-48-r523" - - folder: "2.10" - bundle: "tarantool-enterprise-sdk-nogc64-2.10.4-0-r523.linux.x86_64" - metrics-version: ["", "0.12.0"] + bundle: "tarantool-enterprise-sdk-1.10.15-0-r563" + - folder: "2.11" + bundle: "tarantool-enterprise-sdk-nogc64-2.11.0-0-r563.linux.x86_64" + metrics-version: ["", "1.0.0"] fail-fast: false runs-on: ubuntu-20.04 steps: diff --git a/deps.sh b/deps.sh index d9f45e2b..597da268 100755 --- a/deps.sh +++ b/deps.sh @@ -26,7 +26,7 @@ tarantoolctl rocks install "${LUACOV_COVERALLS_ROCKSPEC_FILE}" rm "${LUACOV_COVERALLS_ROCKSPEC_FILE}" rmdir "${TMPDIR}" -CARTRIDGE_VERSION="${CARTRIDGE_VERSION:-2.7.8}" +CARTRIDGE_VERSION="${CARTRIDGE_VERSION:-2.8.0}" tarantoolctl rocks install cartridge "$CARTRIDGE_VERSION" tarantoolctl rocks install ddl 1.6.2 From 46f7d00eb3ee7b2322e3bf93bd3a447e36f82ae3 Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Tue, 6 Jun 2023 12:51:53 +0300 Subject: [PATCH 4/9] test: fix file name typo --- .../integration/updated_s\321\201hema_test.lua" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/integration/updated_shema_test.lua => "test/integration/updated_s\321\201hema_test.lua" (100%) diff --git a/test/integration/updated_shema_test.lua "b/test/integration/updated_s\321\201hema_test.lua" similarity index 100% rename from test/integration/updated_shema_test.lua rename to "test/integration/updated_s\321\201hema_test.lua" From a74970fb6dfdbc2ed7be9766c018e36deb70274a Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Tue, 6 Jun 2023 12:55:40 +0300 Subject: [PATCH 5/9] test: fix integration with metrics 0.17.0+ In metrics 0.17.0 cartridge hotreload was migrated to metrics cartridge role. The role must be enabled if we want to work with metrics+cartridge features. --- test/entrypoint/srv_stats.lua | 16 +++++++++++----- test/integration/stats_test.lua | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/test/entrypoint/srv_stats.lua b/test/entrypoint/srv_stats.lua index 2082804a..c23d57cf 100755 --- a/test/entrypoint/srv_stats.lua +++ b/test/entrypoint/srv_stats.lua @@ -51,15 +51,21 @@ if crud_utils.is_cartridge_hotreload_supported() then roles_reload_allowed = true end +local is_metrics = pcall(require, 'metrics') +local roles = { + 'cartridge.roles.crud-router', + 'cartridge.roles.crud-storage', + 'customers-storage', +} +if is_metrics then + table.insert(roles, 'cartridge.roles.metrics') +end + local ok, err = errors.pcall('CartridgeCfgError', cartridge.cfg, { advertise_uri = 'localhost:3301', http_port = 8081, bucket_count = 3000, - roles = { - 'cartridge.roles.crud-router', - 'cartridge.roles.crud-storage', - 'customers-storage', - }, + roles = roles, roles_reload_allowed = roles_reload_allowed, }) diff --git a/test/integration/stats_test.lua b/test/integration/stats_test.lua index 5424e209..5a55e46a 100644 --- a/test/integration/stats_test.lua +++ b/test/integration/stats_test.lua @@ -851,7 +851,7 @@ end -- https://github.com/tarantool/metrics/blob/fc5a67072340b12f983f09b7d383aca9e2f10cf1/test/utils.lua#L22-L31 local function find_obs(metric_name, label_pairs, observations) for _, obs in pairs(observations) do - local same_label_pairs = pcall(t.assert_equals, obs.label_pairs, label_pairs) + local same_label_pairs = pcall(t.assert_covers, obs.label_pairs, label_pairs) if obs.metric_name == metric_name and same_label_pairs then return obs end From 0c51def1d4382e11c655488197c7bb396f107d39 Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Tue, 6 Jun 2023 12:57:02 +0300 Subject: [PATCH 6/9] changelog: fix format --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a3ea56f..5ed2c18a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. `insert`, `insert_object`, `insert_many`, `insert_object_many`, `replace`, `replace_object`, `replace_many`, `insert_object_many`, `upsert`, `upsert_object`, `upsert_many`, `upsert_object_many`, - `update`, `delete`. (#267). + `update`, `delete` (#267). ### Fixed * Crud DML operations returning stale schema for metadata generation. From 8f6eff1a0fae9eddc7839b62169fd9a64a2ad9f9 Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Wed, 7 Jun 2023 10:17:34 +0300 Subject: [PATCH 7/9] ci: run coverage only when required Before this patch, we ran coverage tests even when results weren't used in coveralls. Running coverage tests is significantly more expensive (up to 5 times in length). --- .github/workflows/test_on_push.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test_on_push.yaml b/.github/workflows/test_on_push.yaml index e176729e..a8889a16 100644 --- a/.github/workflows/test_on_push.yaml +++ b/.github/workflows/test_on_push.yaml @@ -74,10 +74,11 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Run tests and code coverage analysis - run: make -C build coverage + - name: Run tests + if: matrix.coveralls != true # See https://github.com/actions/runner/issues/1173 + run: make -C build luatest-no-coverage - - name: Send code coverage to coveralls.io + - name: Run tests with coverage and send results to coveralls.io run: make -C build coveralls if: ${{ matrix.coveralls }} @@ -153,5 +154,5 @@ jobs: - run: cmake -S . -B build - - name: Run tests and code coverage analysis - run: make -C build coverage + - name: Run tests + run: make -C build luatest-no-coverage From 10de01d55e31fea8ee3f980a9b29bff3c4268fc2 Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Wed, 7 Jun 2023 11:08:27 +0300 Subject: [PATCH 8/9] test: skip cartridge hotreload on old Tarantool Running tests for cartridge roles reload with vshard 0.1.22+ may stuck on old Tarantool versions (1.10.6, 2.2, 2.3, 2.4). The reason is rather unclear (it is somehow related to new vshard retrying utils), but since it concerns out of support versions, it is not worth to inspect it too long or file an issue. ``` main/137/vshard.recovery util.lua:103 E> recovery_f has been failed: .../.rocks/share/tarantool/vshard/storage/init.lua:1268: assertion failed! main/136/vshard.gc util.lua:103 E> gc_bucket_f has been failed: .../.rocks/share/tarantool/vshard/storage/init.lua:2530: assertion failed! ``` --- deps.sh | 2 +- test/helper.lua | 14 ++++++++++++++ test/integration/cfg_test.lua | 1 + test/integration/ddl_sharding_info_reload_test.lua | 7 +++++++ test/integration/reload_test.lua | 2 ++ test/integration/stats_test.lua | 3 +++ 6 files changed, 28 insertions(+), 1 deletion(-) diff --git a/deps.sh b/deps.sh index 597da268..c1b76540 100755 --- a/deps.sh +++ b/deps.sh @@ -4,7 +4,7 @@ set -e # Test dependencies: -tarantoolctl rocks install luatest 0.5.7 +tarantoolctl rocks install luatest tarantoolctl rocks install luacheck 0.25.0 tarantoolctl rocks install luacov 0.13.0 diff --git a/test/helper.lua b/test/helper.lua index 919b7766..8109fd66 100644 --- a/test/helper.lua +++ b/test/helper.lua @@ -1,6 +1,7 @@ require('strict').on() local t = require('luatest') +local luatest_utils = require('luatest.utils') local log = require('log') local checks = require('checks') @@ -551,4 +552,17 @@ function helpers.is_cartridge_hotreload_supported() return crud_utils.is_cartridge_hotreload_supported() end +function helpers.skip_old_tarantool_cartridge_hotreload() + -- Cartridge hotreload tests stuck for vshard 0.1.22+ on Tarantool 1.10.6, 2.2, 2.3 and 2.4. + -- Logs display a lot of following errors: + -- main/137/vshard.recovery util.lua:103 E> recovery_f has been failed: .../.rocks/share/tarantool/vshard/storage/init.lua:1268: assertion failed! + -- main/136/vshard.gc util.lua:103 E> gc_bucket_f has been failed: .../.rocks/share/tarantool/vshard/storage/init.lua:2530: assertion failed! + local tarantool_version = luatest_utils.get_tarantool_version() + t.skip_if(luatest_utils.version_ge(luatest_utils.version(1, 10, 13), tarantool_version), + "Cartridge hotreload tests stuck for vshard 0.1.22+ on Tarantool 1.10.6") + t.skip_if(luatest_utils.version_ge(tarantool_version, luatest_utils.version(2, 0, 0)) + and luatest_utils.version_ge(luatest_utils.version(2, 5, 1), tarantool_version), + "Cartridge hotreload tests stuck for vshard 0.1.22+ on Tarantool 2.2, 2.3 and 2.4") +end + return helpers diff --git a/test/integration/cfg_test.lua b/test/integration/cfg_test.lua index 3c583bca..1552b02d 100644 --- a/test/integration/cfg_test.lua +++ b/test/integration/cfg_test.lua @@ -72,6 +72,7 @@ end group.test_role_reload_preserves_values = function(g) t.skip_if(not helpers.is_cartridge_hotreload_supported(), "Cartridge roles reload is not supported") + helpers.skip_old_tarantool_cartridge_hotreload() local router = g.cluster:server('router') diff --git a/test/integration/ddl_sharding_info_reload_test.lua b/test/integration/ddl_sharding_info_reload_test.lua index 0066b7af..b78bafc8 100644 --- a/test/integration/ddl_sharding_info_reload_test.lua +++ b/test/integration/ddl_sharding_info_reload_test.lua @@ -307,6 +307,7 @@ for sharding_case_name, sharding_case in pairs(sharding_cases) do ((reload_case == 'reload_roles') and not helpers.is_cartridge_hotreload_supported()), "Cartridge roles reload is not supported") + helpers.skip_old_tarantool_cartridge_hotreload() local storage = g.cluster:server('s1-master') @@ -333,6 +334,12 @@ for _, sharding_case in pairs(sharding_cases) do sharding_case.ddl_space, reload_case_name) pgroup_storage[test_name] = function(g) + t.skip_if( + ((reload_case == 'reload_roles') + and not helpers.is_cartridge_hotreload_supported()), + "Cartridge roles reload is not supported") + helpers.skip_old_tarantool_cartridge_hotreload() + local storage = g.cluster:server('s1-master') -- Init the cache. diff --git a/test/integration/reload_test.lua b/test/integration/reload_test.lua index 28b844bf..908178d2 100644 --- a/test/integration/reload_test.lua +++ b/test/integration/reload_test.lua @@ -79,6 +79,7 @@ end) function g.test_router() t.skip_if(not helpers.is_cartridge_hotreload_supported(), "Cartridge roles reload is not supported") + helpers.skip_old_tarantool_cartridge_hotreload() g.highload_fiber = fiber.new(highload_loop, 'A') @@ -104,6 +105,7 @@ end function g.test_storage() t.skip_if(not helpers.is_cartridge_hotreload_supported(), "Cartridge roles reload is not supported") + helpers.skip_old_tarantool_cartridge_hotreload() g.highload_fiber = fiber.new(highload_loop, 'B') diff --git a/test/integration/stats_test.lua b/test/integration/stats_test.lua index 5a55e46a..789cce39 100644 --- a/test/integration/stats_test.lua +++ b/test/integration/stats_test.lua @@ -777,6 +777,7 @@ pgroup.test_role_reload_do_not_reset_observations = function(g) t.skip_if((g.params.args.driver == 'metrics') and helpers.is_metrics_0_12_0_or_older(), "See https://github.com/tarantool/metrics/issues/334") + helpers.skip_old_tarantool_cartridge_hotreload() local stats_before = get_stats(g) @@ -1091,6 +1092,7 @@ group_metrics.test_role_reload_do_not_reset_metrics_observations = function(g) "Cartridge roles reload is not supported") t.skip_if(helpers.is_metrics_0_12_0_or_older(), "See https://github.com/tarantool/metrics/issues/334") + helpers.skip_old_tarantool_cartridge_hotreload() helpers.reload_roles(g.cluster:server('router')) g.router:eval("crud = require('crud')") @@ -1130,6 +1132,7 @@ group_metrics.before_test( group_metrics.test_stats_changed_in_metrics_registry_after_role_reload = function(g) t.skip_if(not helpers.is_cartridge_hotreload_supported(), "Cartridge roles reload is not supported") + helpers.skip_old_tarantool_cartridge_hotreload() helpers.reload_roles(g.cluster:server('router')) g.router:eval("crud = require('crud')") From 2bb749db1b8a1eb03c84261728804c0074edff04 Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Tue, 6 Jun 2023 13:03:36 +0300 Subject: [PATCH 9/9] Release 1.2.0 Overview This release add two new flags: `noreturn` to ignore return values excessive transfer and encoding/decoding for insert/replace/etc (performance improvement up to 10% for batch requests) and `fetch_latest_metadata` to force fetching latest space format metadata right after a live migration (performance overhead may be up to 15%). New features * Add `noreturn` option for operations: `insert`, `insert_object`, `insert_many`, `insert_object_many`, `replace`, `replace_object`, `replace_many`, `insert_object_many`, `upsert`, `upsert_object`, `upsert_many`, `upsert_object_many`, `update`, `delete` (#267). Bugfixes * Crud DML operations returning stale schema for metadata generation. Now you may use `fetch_latest_metadata` flag to work with latest schema (#236). --- CHANGELOG.md | 2 +- crud/version.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ed2c18a..d276f2b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## Unreleased +## [1.2.0] - 07-06-23 ### Added * Add `noreturn` option for operations: diff --git a/crud/version.lua b/crud/version.lua index 9c7fe0ce..dd22bfcc 100644 --- a/crud/version.lua +++ b/crud/version.lua @@ -1,4 +1,4 @@ -- Сontains the module version. -- Requires manual update in case of release commit. -return '1.1.1' +return '1.2.0'