Skip to content

Commit b784154

Browse files
committed
sync: port EE changes (code, tests, docs) into CE branch
1 parent 8b8e580 commit b784154

File tree

20 files changed

+183
-63
lines changed

20 files changed

+183
-63
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ luacov.stats.out
1111
build/*.cmake
1212
build/Makefile
1313
.idea
14+
sdk
15+
sdk-2
16+
sdk-3
1417

1518
# Vim Swap files.
1619
.*.s[a-w][a-z]

.luacheckrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
redefined = false
22
globals = {'box', 'utf8', 'checkers', '_TARANTOOL'}
33
include_files = {'**/*.lua', '*.luacheckrc', '*.rockspec'}
4-
exclude_files = {'**/*.rocks/', 'tmp/', 'tarantool-enterprise/'}
4+
exclude_files = {'**/*.rocks/', 'tmp/', 'sdk-*'}
55
max_line_length = 120
66
max_comment_line_length = 150

.luacov

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1+
local ci_node_index = os.getenv("CI_NODE_INDEX") or ""
2+
3+
statsfile = "luacov.stats" .. ci_node_index .. ".out"
14
exclude = {
2-
'/test/',
3-
'/.rocks/',
5+
"test"
6+
}
7+
include = {
8+
"crud%/.+$",
9+
"crud.lua",
10+
"roles%/.+$",
11+
"cartridge%/.+$",
412
}

CHANGELOG.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,22 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
88
## [Unreleased]
99

1010
### Changed
11-
* bumped: metrics version in rockspec
12-
* bumped: cartridge version in rockspec
13-
* bumped: vshard version in rockspec
14-
* Role model support in CRUD is provided (https://jira.vk.team/browse/TNTP-2177)
11+
* bumped: vshard version in rockspec.
12+
* Role model support in CRUD is provided ([commit](https://github.com/tarantool/crud/pull/453/commits/379f7e0a133b3ad8763885b51626e7d30b2920ee)).
1513

1614
### Added
1715
* Validation of `bucket_id`. Invalid values now raise `BucketIDError`
18-
before routing. [TNTP-3536](https://jira.vk.team/browse/TNTP-3536)
16+
before routing ([commit](https://github.com/tarantool/crud/pull/453/commits/3019e76a09200b0c12523b0b5221350ae8a0a8b4)).
1917

2018
### Fixed
21-
* Fixed compatibility with cartridge `2.16.0` ([TNTP-3598](https://jira.vk.team/browse/TNTP-3598))
19+
* Fixed compatibility with cartridge `2.16.0`.
2220
* `crud.schema` no longer returns TCF system space `_cdc_state`.
2321
* `crud.schema` no longer returns system space `_gc_consumers` with Tarantool 3.2+.
2422
* `crud.schema` no longer returns `tt` system space `_tt_migrations`.
2523
* Tests of `schema` with Tarantool 3.2+.
2624
* Fixed bad error handling for method `call.single`
2725
* Added support for working in 3.1 with data from 2.11, previously there was an error
28-
due to the inability to find the replicasets by name https://github.com/tarantool/crud-ee/issues/16
26+
due to the inability to find the replicasets by name ([commit](https://github.com/tarantool/crud/pull/453/commits/fdce364254a234fb8db9ed1bab9bbe0d3c9d3e17)).
2927

3028
## [1.5.2] - 20-05-24
3129

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2020-2024 crud AUTHORS: please see the AUTHORS file.
1+
Copyright 2020-2025 crud AUTHORS: please see the AUTHORS file.
22

33
Redistribution and use in source and binary forms, with or without modification,
44
are permitted provided that the following conditions are met:

Makefile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ S3_TARANTOOL_SDK_2_PATH := s3://packages/enterprise/release/linux/x86_64/2.11/ta
55
S3_ENDPOINT_URL := $(if $(S3_ENDPOINT_URL),$(S3_ENDPOINT_URL),https://hb.vkcs.cloud)
66

77
.rocks: sdk
8-
# в sdk-2 есть все нужные роки, в sdk-3 нет
98
source ./sdk-2/env.sh && \
109
tt rocks install luacheck 0.26.0 --only-server=sdk-2/rocks && \
1110
tt rocks install luacov 0.13.0 --only-server=sdk-2/rocks && \
1211
tt rocks install luacov-reporters 0.1.0 --only-server=sdk-2/rocks && \
13-
tt rocks install metrics 1.4.0 --only-server=sdk-2/rocks && \
14-
tt rocks install ddl-ee 1.8.0 --only-server=sdk-2/rocks && \
15-
tt rocks install cartridge 2.16.2 --only-server=sdk-2/rocks && \
16-
tt rocks install migrations-ee 1.3.2 --only-server=sdk-2/rocks && \
12+
tt rocks install metrics 1.5.0 && \
13+
tt rocks install cartridge 2.16.3 && \
14+
tt rocks install migrations 1.1.0 && \
1715
tt rocks make
1816

1917
sdk-2:
@@ -25,7 +23,6 @@ sdk-3:
2523
mkdir sdk-3 && tar -xvzf tarantool-enterprise-*.tar.gz -C ./sdk-3 --strip-components=1 && rm tarantool-enterprise-*.tar.gz
2624

2725
sdk: sdk-2 sdk-3
28-
# в sdk-3 нет luatest
2926
source sdk-3/env.sh && \
3027
cp sdk-2/rocks/luatest-1.0.1-1.all.rock sdk-3/rocks/ && \
3128
chmod 644 sdk-3/rocks/* && \

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ First, [install Tarantool](https://www.tarantool.io/en/download).
6666

6767
#### Manual install
6868

69-
To try `crud` in your application, you may install it manually fron web
69+
To try `crud` in your application, you may install it manually from web
7070
with `tt rocks` rock management tool.
7171

7272
```bash
@@ -156,6 +156,12 @@ tarantool> crud.select('developers', nil, {first = 6})
156156

157157
The CRUD operations should be called from router.
158158

159+
Assuming that:
160+
161+
```lua
162+
local crud = require('crud')
163+
```
164+
159165
All VShard storages should call `crud.init_storage()` after
160166
`vshard.storage.cfg()` (or enable the `roles.crud-storage` role for Tarantool 3
161167
or the `crud-storage` role for Cartridge)
@@ -1968,7 +1974,6 @@ issues.
19681974

19691975
<details>
19701976
<summary>Full configuration example</summary>
1971-
19721977
```yaml
19731978
credentials:
19741979
users:

crud-scm-1.rockspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ description = {
1111

1212
dependencies = {
1313
'lua ~> 5.1',
14-
'checks >= 3.1.0-1',
14+
'checks >= 3.3.0-1',
1515
'errors >= 2.2.1-1',
16-
'vshard >= 0.1.18-1',
16+
'vshard >= 0.1.36-1',
1717
}
1818

1919
build = {

crud/common/sharding/sharding_func.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ local ShardingFuncError = errors.new_class('ShardingFuncError', {capture_stack
1010
local sharding_func_module = {}
1111

1212
local sharding_module_names = {
13-
['vshard'] = true,
13+
['vshard'] = 'vshard',
1414
}
1515

1616
local function is_callable(object)
@@ -50,8 +50,9 @@ local function get_function_from_G(func_name)
5050
local sharding_module = false
5151
local ok
5252

53-
if sharding_module_names[chunks[1]] then
54-
ok, sharding_func = pcall(require, chunks[1])
53+
if sharding_module_names[chunks[1]] ~= nil then
54+
local module_name = sharding_module_names[chunks[1]]
55+
ok, sharding_func = pcall(require, module_name)
5556
if not ok then
5657
return nil
5758
end

crud/select/merger.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ local merger_lib = compat.require('tuple.merger', 'merger')
1212

1313
local Keydef = require('crud.compare.keydef')
1414
local stats = require('crud.stats')
15-
local utils = require("crud.common.utils")
15+
local utils = require('crud.common.utils')
1616

1717
local function bswap_u16(num)
1818
return bit.rshift(bit.bswap(tonumber(num)), 16)

0 commit comments

Comments
 (0)