-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crud: introduce basic tarantool 3 roles
This patch introduce basic crud-router and crud-storage roles for Tarantool 3. The roles are similar to Cartridge ones. Roles support Tarantool 3.0.2, Tarantool 3.1.0 and newer due to [1, 2]. This commit makes all existing config tests run with roles enabled instead of manual bootstrap. This commit does not yet introduce metrics configuration through roles config. [1] tarantool/tarantool#9643 [2] tarantool/tarantool#9649 Part of #415
- Loading branch information
1 parent
6cd51a1
commit 2c1d4ce
Showing
15 changed files
with
542 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
local config = require('config') | ||
|
||
local function is_sharding_role_enabled(expected_sharding_role) | ||
-- Works only for versions newer than 3.0.1-10 (3.0.2 and following) | ||
-- and newer than 3.1.0-entrypoint-77 (3.1.0 and following). | ||
-- https://github.com/tarantool/tarantool/commit/ebb170cb8cf2b9c4634bcf0178665909f578c335 | ||
local actual_sharding_roles = config:get('sharding.roles') | ||
|
||
for _, actual_sharding_role in ipairs(actual_sharding_roles or {}) do | ||
if actual_sharding_role == expected_sharding_role then | ||
return true | ||
end | ||
end | ||
|
||
return false | ||
end | ||
|
||
return { | ||
is_sharding_role_enabled = is_sharding_role_enabled, | ||
} |
Oops, something went wrong.