-
Notifications
You must be signed in to change notification settings - Fork 15
api: support vshard groups #319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api: support vshard groups #319
Conversation
522aeda to
9de1913
Compare
|
Needs to be in sync with #317 since something may change with this patch |
9de1913 to
ccd69f9
Compare
8a9876b to
8677a5e
Compare
|
Current implementation may be a bit difficult to review, I'll try to separate the implementation to several commits. UPD: done. |
8677a5e to
679b582
Compare
| local vshard_router = vshard.router.static | ||
|
|
||
| if vshard_router == nil then | ||
| log.warn('Failed to resolve space name for stats: default vshard router not found') | ||
| return nil | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add a vshard_router option for stats.wrap?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this case is related only to crud.len, we can make specific wrappers for it. But this behavior is deprecated and will be removed, so I decided not to make statistics code more complicated since it will become irrelevant after a couple of releases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing is more permanent than a temporary solution.
The inconsistency of the code is not good, but you know more about the plans for the development of this product. So it's up to you.
679b582 to
04bd845
Compare
b332869 to
fa69e83
Compare
After discussion with Ecosystem team, we decided not to specify PR in CHANGELOG entries if there is a related issue. This patch make last CHANGELOG entries consistent.
fa69e83 to
c3ffcb0
Compare
This patch is the groundwork for vshard groups and custom routers support. Test runs have shown that this patch do not affects the performance of crud requests. Part of #44
This patch is the groundwork for vshard groups and custom routers support. After this patch, schema reload works per vshard router object. Test runs have shown that this patch do not affects the performance of crud requests. Part of #44
This patch is the groundwork for vshard groups and custom routers support. After this patch, sharding schema reload works per vshard router object. Test runs have shown that this patch do not affects the performance of crud requests. Part of #44
This patch is the groundwork for vshard groups and custom routers support. After this patch, vshard router object is retrieved only in the single point of a request. (Except for name resolving in statistics.) Test runs have shown that this patch do not affects the performance of crud requests. Part of #44
This patch adds Cartridge vshard groups [1] and non-default vshard
router [2] support to CRUD operations.
To specify Cartridge vshard group, pass vshard group name with
`vshard_router` option of a crud operation.
```lua
crud.select('customers_ddl',
{{'=', 'age', 41}},
{vshard_router = 'customers'})
```
To use non-default vshard router, pass vshard router object with
`vshard_router` option of a crud operation.
```lua
local router = vshard.router.new(cfg)
crud.select('customers_ddl',
{{'=', 'age', 41}},
{vshard_router = router})
```
If `vshard_router` is not specified, default vshard router is used to
process the request. If default vshard router is not found (for example,
if it is a Cartridge application with vshard groups) and option is not
specified, the error is returned.
1. https://www.tarantool.io/en/doc/latest/book/cartridge/cartridge_dev/#using-multiple-vshard-storage-groups
2. https://www.tarantool.io/ru/doc/latest/reference/reference_rock/vshard/vshard_router/#router-api-new
Closes #44
CRUD stats are separated by space name. If space id is passed instead of name (only `crud.len` allows this), space name is resolved with net_box schema. Since, after resolving #44, non-default vshard routers and Cartridge vshard groups are supported, to resolve the name we must know what vshard router should be used. Since using space id for `crud.len` is deprecated now, we won't support name resolve for operations with custom router statistics. Instead of this, a warning will be logged. `crud.len` statistics will be signed by space name or space id casted to string depending on is there a default router with space schema or not. Follows up #44, part of #255
c3ffcb0 to
b8465f3
Compare
oleg-jukovec
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the pull request!
readme: fix args description
changelog: use single format
After discussion with Ecosystem team, we decided not to specify PR in CHANGELOG entries if there is a related issue. This patch make last CHANGELOG entries consistent.
api: deprecate using space id in len
Part of #255
internal: use vshard router object
This patch is the groundwork for vshard groups and custom routers
support.
Test runs have shown that this patch do not affects the performance of
crud requests.
Part of #44
internal: rework replicasets schema reload
This patch is the groundwork for vshard groups and custom routers
support.
After this patch, schema reload works per vshard router object.
Test runs have shown that this patch do not affects the performance of
crud requests.
Part of #44
internal: rework sharding schema reload
This patch is the groundwork for vshard groups and custom routers
support.
After this patch, sharding schema reload works per vshard router object.
Test runs have shown that this patch do not affects the performance of
crud requests.
Part of #44
internal: use single router object
This patch is the groundwork for vshard groups and custom routers
support.
After this patch, vshard router object is retrieved only in the single
point of a request. (Except for name resolving in statistics.)
Test runs have shown that this patch do not affects the performance of
crud requests.
Part of #44
api: support vshard groups
This patch adds Cartridge vshard groups [1] and non-default vshard router [2] support to CRUD operations.
To specify Cartridge vshard group, pass vshard group name with
vshard_routeroption of a crud operation.To use non-default vshard router, pass vshard router object with
vshard_routeroption of a crud operation.If
vshard_routeris not specified, default vshard router is used to process the request. If default vshard router is not found (for example, if it is a Cartridge application with vshard groups) and option is not specified, the error is returned.Closes #44
stats: warn for using id with custom router
CRUD stats are separated by space name. If space id is passed instead of name (only
crud.lenallows this), space name is resolved with net_box schema. Since, after resolving #44, non-default vshard routers and Cartridge vshard groups are supported, to resolve the name we must know what vshard router should be used. Since using space id forcrud.lenis deprecated now, we won't support name resolve for operations with custom router statistics. Instead of this, a warning will be logged.crud.lenstatistics will be signed by space name or space id casted to string depending on is there a default router with space schema or not.Follows up #44, part of #255
I didn't forget about