Skip to content

Commit 093868d

Browse files
ddl: deprecate manual sharding schema reload
Since sharding schema reloads must be processed automatically after this patchset, there shouldn't be usual cases where user need to reload sharding info manually. Thus methods for manual sharding schema reload are deprecated and will be removed in future releases. Follows up #212
1 parent 0bc4d65 commit 093868d

File tree

4 files changed

+9
-15
lines changed

4 files changed

+9
-15
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1818

1919
### Changed
2020
* Optimize select with known bucket_id (#234).
21+
* Deprecate manual sharding schema reload (#212).
2122

2223
### Fixed
2324
* Fix processing storage error for tuple-merger implementation of

README.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -117,26 +117,11 @@ Table below describe what operations supports custom sharding key:
117117

118118
Current limitations for using custom sharding key:
119119

120-
- It's not possible to update sharding keys automatically when schema is
121-
updated on storages, see
122-
[#212](https://github.com/tarantool/crud/issues/212). However it is possible
123-
to do it manually with `require('crud.common.sharding_key').update_cache()`
124-
(this function updates both caches: sharding key cache and sharding function
125-
cache, but returned value is sharding key from cache).
126120
- No support of JSON path for sharding key, see
127121
[#219](https://github.com/tarantool/crud/issues/219).
128122
- `primary_index_fieldno_map` is not cached, see
129123
[#243](https://github.com/tarantool/crud/issues/243).
130124

131-
Current limitations for using custom sharding functions:
132-
133-
- It's not possible to update sharding functions automatically when schema is
134-
updated on storages, see
135-
[#212](https://github.com/tarantool/crud/issues/212). However it is possible
136-
to do it manually with `require('crud.common.sharding_func').update_cache()`
137-
(this function updates both caches: sharding key cache and sharding function
138-
cache, but returned value is sharding function from cache).
139-
140125
### Insert
141126

142127
```lua

crud/common/sharding_func.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
local log = require('log')
2+
13
local sharding_metadata_module = require('crud.common.sharding.sharding_metadata')
24

35
local sharding_func_cache = {}
@@ -9,6 +11,8 @@ local sharding_func_cache = {}
911
-- This method provides similar behavior for
1012
-- sharding function cache.
1113
function sharding_func_cache.update_cache(space_name)
14+
log.warn("require('crud.common.sharding_func').update_cache()" ..
15+
"is deprecated and will be removed in future releases")
1216
return sharding_metadata_module.update_sharding_func_cache(space_name)
1317
end
1418

crud/common/sharding_key.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
local log = require('log')
2+
13
local sharding_metadata_module = require('crud.common.sharding.sharding_metadata')
24

35
local sharding_key_cache = {}
@@ -7,6 +9,8 @@ local sharding_key_cache = {}
79
-- for updating sharding key cache in their
810
-- projects like `require('crud.common.sharding_key').update_cache()`
911
function sharding_key_cache.update_cache(space_name)
12+
log.warn("require('crud.common.sharding_key').update_cache()" ..
13+
"is deprecated and will be removed in future releases")
1014
return sharding_metadata_module.update_sharding_key_cache(space_name)
1115
end
1216

0 commit comments

Comments
 (0)