Skip to content

Commit bcff806

Browse files
Александр Ваховvakhov
authored andcommitted
bump: vshard 0.1.34, cartridge 2.16.0
(cherry picked from commit 47631804f3f19b1b85bc32908dbba6e4f520df36)
1 parent b4f6d75 commit bcff806

File tree

2 files changed

+43
-5
lines changed

2 files changed

+43
-5
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
SHELL := /bin/bash
22

33
S3_TARANTOOL_SDK_3_PATH := s3://packages/enterprise/release/linux/x86_64/3.3/tarantool-enterprise-sdk-gc64-3.3.1-0-r55.linux.x86_64.tar.gz
4-
S3_TARANTOOL_SDK_2_PATH := s3://packages/enterprise/release/linux/x86_64/2.11/tarantool-enterprise-sdk-gc64-2.11.6-0-r677.linux.x86_64.tar.gz
4+
S3_TARANTOOL_SDK_2_PATH := s3://packages/enterprise/release/linux/x86_64/2.11/tarantool-enterprise-sdk-gc64-2.11.7-0-r689.linux.x86_64.tar.gz
55
S3_ENDPOINT_URL := $(if $(S3_ENDPOINT_URL),$(S3_ENDPOINT_URL),https://hb.vkcs.cloud)
66

77
SDK_TEST := $(if $(SDK_TEST),$(SDK_TEST),sdk-3)
@@ -14,8 +14,8 @@ SDK_TEST := $(if $(SDK_TEST),$(SDK_TEST),sdk-3)
1414
tt rocks install luacov-reporters 0.1.0 --only-server=sdk-2/rocks && \
1515
tt rocks install metrics 1.1.0 --only-server=sdk-2/rocks && \
1616
tt rocks install ddl-ee 1.8.0 --only-server=sdk-2/rocks && \
17-
tt rocks install cartridge 2.15.1 --only-server=sdk-2/rocks && \
18-
tt rocks install migrations-ee 1.3.1 --only-server=sdk-2/rocks && \
17+
tt rocks install cartridge 2.16.0 --only-server=sdk-2/rocks && \
18+
tt rocks install migrations-ee 1.3.2 --only-server=sdk-2/rocks && \
1919
tt rocks make
2020

2121
sdk-2:

crud/common/vshard_utils.lua

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,48 @@ local vshard = require('vshard')
44

55
local vshard_utils = {}
66

7+
-- get_replicasets returns vshard replicasets from vshard.storage.internal
8+
-- copy pasted from https://github.com/tarantool/vshard/blob/9ad0e2726a5137398f50fe88ac105f53e446c3e2/vshard/storage/init.lua#L3962-L3984
9+
-- todo: remove after https://github.com/tarantool/vshard/issues/565 closed
10+
local function get_replicasets()
11+
local ireplicasets = {}
12+
local M = vshard.storage.internal
13+
local is_named = M.this_replica.id == M.this_replica.name
14+
for id, replicaset in pairs(M.replicasets) do
15+
local master = replicaset.master
16+
local master_info
17+
if replicaset.is_master_auto then
18+
master_info = 'auto'
19+
elseif not master then
20+
master_info = 'missing'
21+
else
22+
local uri = master:safe_uri()
23+
local conn = master.conn
24+
master_info = {
25+
uri = uri, uuid = conn and conn.peer_uuid,
26+
name = is_named and master.name or nil,
27+
state = conn and conn.state, error = conn and conn.error,
28+
}
29+
end
30+
ireplicasets[id] = {
31+
uuid = replicaset.uuid,
32+
name = is_named and replicaset.name or nil,
33+
master = master_info,
34+
}
35+
end
36+
return ireplicasets
37+
end
38+
739
function vshard_utils.get_self_vshard_replicaset()
840
local box_info = vshard_utils.__get_box_info()
941

1042
local ok, storage_info = vshard_utils.__get_storage_info()
1143
assert(ok, 'vshard.storage.cfg() must be called first')
1244

13-
1445
local is_needs_upgrade_2_11 = vshard_utils.is_schema_needs_upgrade_from_2_11()
1546

1647
if vshard_utils.get_vshard_identification_mode() == 'name_as_key' and not is_needs_upgrade_2_11 then
1748
local replicaset_name = box_info.replicaset.name
18-
1949
return replicaset_name, storage_info.replicasets[replicaset_name]
2050
else
2151
local replicaset_uuid
@@ -36,6 +66,14 @@ end
3666

3767
-- for unit tests
3868
function vshard_utils.__get_storage_info()
69+
-- cartridge disable vshard.storage on the very first apply_config
70+
-- here we check this and do not call vshard.storage.info
71+
-- todo: remove after https://github.com/tarantool/vshard/issues/565 closed
72+
if vshard.storage.internal.is_enabled == false then
73+
return true, {
74+
replicasets = get_replicasets(),
75+
}
76+
end
3977
return pcall(vshard.storage.info)
4078
end
4179

0 commit comments

Comments
 (0)