Skip to content

Commit

Permalink
ddl: deprecate manual sharding schema reload
Browse files Browse the repository at this point in the history
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
  • Loading branch information
DifferentialOrange committed Apr 20, 2022
1 parent bad0e60 commit ccb467d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Changed
* Optimize select with known bucket_id (#234).
* Deprecate manual sharding schema reload (#212).

### Fixed
* Fix processing storage error for tuple-merger implementation of
Expand Down
15 changes: 0 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,26 +117,11 @@ Table below describe what operations supports custom sharding key:

Current limitations for using custom sharding key:

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

Current limitations for using custom sharding functions:

- It's not possible to update sharding functions automatically when schema is
updated on storages, see
[#212](https://github.com/tarantool/crud/issues/212). However it is possible
to do it manually with `require('crud.common.sharding_func').update_cache()`
(this function updates both caches: sharding key cache and sharding function
cache, but returned value is sharding function from cache).

### Insert

```lua
Expand Down
4 changes: 4 additions & 0 deletions crud/common/sharding_func.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
local log = require('log')

local sharding_metadata_module = require('crud.common.sharding.sharding_metadata')

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

Expand Down
4 changes: 4 additions & 0 deletions crud/common/sharding_key.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
local log = require('log')

local sharding_metadata_module = require('crud.common.sharding.sharding_metadata')

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

Expand Down

0 comments on commit ccb467d

Please sign in to comment.