-
Notifications
You must be signed in to change notification settings - Fork 15
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
Vshard cluster user experience #366
Comments
The priority of tasks had changed, so I leave this one for now. To pass the baton, here is what I've investigated so far. It seems that the best approach is to implement the local luri = require('uri')
function utils.get_vshard_username()
local storage_info = vshard.storage.info()
local replicaset_info = storage_info.replicasets[utils.replicaset_uuid()]
return luri.parse(replicaset_info.master.uri).login
end Vshard makes some magic with its calls so vshard user (without any explicitly given grants) can write to any space, read any space and call any required procedure on the storage. I haven't yet found the reason why it works since grants are inherited through common net.box call. local log = require('log')
local fiber = require('fiber')
vshard = require('vshard')
box.cfg{listen=3301}
box.once('storage', function()
box.schema.user.create('storage', {password = 'storage'})
end)
local uri = 'storage:storage@localhost:3301'
local cfg = {
bucket_count = 3000,
sharding = {
[box.info().cluster.uuid] = {
replicas = {
[box.info().uuid] = {
uri = uri,
name = 'storage',
master = true,
},
},
},
},
}
vshard.storage.cfg(cfg, box.info().uuid)
vshard.router.cfg(cfg)
vshard.router.bootstrap()
box.schema.space.create('myspace', {if_not_exists = true})
box.space.myspace:create_index('pk', {if_not_exists = true})
func1 = function(arg)
return box.space.myspace:replace(arg)
end
box.schema.func.create('func1', {if_not_exists = true})
func2 = function(arg)
return vshard.router.callro(1, 'func1', {arg})
end
box.schema.func.create('func2', {if_not_exists = true})
func3 = function()
return true
end
box.schema.func.create('func3', {if_not_exists = true})
func4 = function(arg)
return vshard.router.callro(1, 'func3')
end
box.schema.func.create('func4', {if_not_exists = true})
box.schema.role.create('myapi', {if_not_exists = true})
box.schema.role.grant('myapi', 'execute', 'function', 'func1', {if_not_exists = true})
box.schema.role.grant('myapi', 'execute', 'function', 'func2', {if_not_exists = true})
box.schema.user.create('customer', {password = 'customer', if_not_exists = true})
box.schema.user.grant('customer', 'myapi', nil, nil, {if_not_exists = true})
box.schema.user.grant('storage', 'myapi', nil, nil, {if_not_exists = true})
fiber.sleep(10)
box.session.su('customer')
log.info('session customer')
local success, res, res2 = pcall(func1, {1})
log.info('func1')
log.info(success) -- false
log.info(res) -- Write access to space 'myspace' is denied for user 'customer'
log.info(res2) -- nil
local success, res, res2 = pcall(func2, {1})
log.info('func2')
log.info(success) -- true
log.info(res) -- [1]
log.info(res2) -- nil
local success, res, res2 = pcall(func4)
log.info('func4')
log.info(success) -- true
log.info(res) -- true
log.info(res2) -- nil
box.session.su('storage')
log.info('session storage')
local success, res, res2 = pcall(func1, {1})
log.info('func1')
log.info(success) -- false
log.info(res) -- Write access to space 'myspace' is denied for user 'customer'
log.info(res2) -- nil
local success, res, res2 = pcall(func2, {1})
log.info('func2')
log.info(success) -- true
log.info(res) -- [1]
log.info(res2) -- nil
local success, res, res2 = pcall(func4)
log.info('func4')
log.info(success) -- true
log.info(res) -- true
log.info(res2) -- nil It seems that we need to do something with |
We need use `box.info.replication.uuid` instead of `box.info.cluster.uuid` to support Tarantool 3.0. Part of #366
We need use `box.info.replication.uuid` instead of `box.info.cluster.uuid` to support Tarantool 3.0 [1]. 1. tarantool/tarantool#8289 Part of #366 Closes #371
We need use `box.info.replication.uuid` instead of `box.info.cluster.uuid` to support Tarantool 3.0 [1]. 1. tarantool/tarantool#8289 Part of #366 Closes #371
We need use `box.info.replication.uuid` instead of `box.info.cluster.uuid` to support Tarantool 3.0 [1]. 1. tarantool/tarantool#8289 Part of #366 Closes #371
We need use `box.info.replication.uuid` instead of `box.info.cluster.uuid` to support Tarantool 3.0 [1]. 1. tarantool/tarantool#8289 Part of #366 Closes #371
The patch adds execution access for storage crud functions to a VShard storage user in the VShard manner [1]. 1. https://github.com/tarantool/vshard/blob/b3c27b32637863e9a03503e641bb7c8c69779a00/vshard/storage/init.lua#L777-L780 Closes #366
The patch adds execution access for storage crud functions to a VShard storage user in the VShard manner [1]. 1. https://github.com/tarantool/vshard/blob/b3c27b32637863e9a03503e641bb7c8c69779a00/vshard/storage/init.lua#L777-L780 Closes #366
The patch adds execution access for storage crud functions to a VShard storage user in the VShard manner [1]. 1. https://github.com/tarantool/vshard/blob/b3c27b32637863e9a03503e641bb7c8c69779a00/vshard/storage/init.lua#L777-L780 Closes #366
The patch adds execution access for storage crud functions to a VShard storage user in the VShard manner [1]. 1. https://github.com/tarantool/vshard/blob/b3c27b32637863e9a03503e641bb7c8c69779a00/vshard/storage/init.lua#L777-L780 Closes #366
The patch adds execution access on a stroage for crud functions to a VShard storage user in the VShard manner [1]. 1. https://github.com/tarantool/vshard/blob/b3c27b32637863e9a03503e641bb7c8c69779a00/vshard/storage/init.lua#L777-L780 Closes #366
The patch adds execution access on a stroage for crud functions to a VShard storage user in the VShard manner [1]. 1. https://github.com/tarantool/vshard/blob/b3c27b32637863e9a03503e641bb7c8c69779a00/vshard/storage/init.lua#L777-L780 Closes #366
The patch adds execution access on a stroage for crud functions to a VShard storage user in the VShard manner [1]. 1. https://github.com/tarantool/vshard/blob/b3c27b32637863e9a03503e641bb7c8c69779a00/vshard/storage/init.lua#L777-L780 Closes #366
The patch adds execution access on a stroage for crud functions to a VShard storage user in the VShard manner [1]. 1. https://github.com/tarantool/vshard/blob/b3c27b32637863e9a03503e641bb7c8c69779a00/vshard/storage/init.lua#L777-L780 Closes #366
The patch adds execution access on a stroage for crud functions to a VShard storage user in the VShard manner [1]. 1. https://github.com/tarantool/vshard/blob/b3c27b32637863e9a03503e641bb7c8c69779a00/vshard/storage/init.lua#L777-L780 Closes #366
The patch adds execution access on a stroage for crud functions to a VShard storage user in the VShard manner [1]. 1. https://github.com/tarantool/vshard/blob/b3c27b32637863e9a03503e641bb7c8c69779a00/vshard/storage/init.lua#L777-L780 Closes #366
The patch adds execution access on a stroage for crud functions to a VShard storage user in the VShard manner [1]. 1. https://github.com/tarantool/vshard/blob/b3c27b32637863e9a03503e641bb7c8c69779a00/vshard/storage/init.lua#L777-L780 Closes #366
The patch adds execution access on a stroage for crud functions to a VShard storage user in the VShard manner [1]. 1. https://github.com/tarantool/vshard/blob/b3c27b32637863e9a03503e641bb7c8c69779a00/vshard/storage/init.lua#L777-L780 Closes #366
The patch adds execution access on a stroage for crud functions to a VShard storage user in the VShard manner [1]. 1. https://github.com/tarantool/vshard/blob/b3c27b32637863e9a03503e641bb7c8c69779a00/vshard/storage/init.lua#L777-L780 Closes #366
Overview This release improves experience for VShard clusters users and Tarantool 3 users. It also introduces schema introspection API. New features * Space schema introspection API `crud.schema` (#380). Bugfixes * Return explicit error for `*_many` call with no tuples/objects (#377). * `crud.readview` resource cleanup on garbage collect (#379). * VShard storage user have not execution rights for internal functions (#366). Infrastructure * `deps.sh` installs the `vshard` instead of the `cartridge` by default (#364). You could to specify an environment variable `CARTIRDGE_VERSION` to install the `cartridge` and run tests cases with it. * `doc/playground.lua` does not work with Tarantool 3 (#371). * Tests with Tarantool 3 (#364). * Quickstart section in the README.md focuses on usage with `vshard` instead of `Cartridge` (#366).
Overview This release improves experience for VShard clusters users and Tarantool 3 users. It also introduces schema introspection API. New features * Space schema introspection API `crud.schema` (#380). Bugfixes * Return explicit error for `*_many` call with no tuples/objects (#377). * `crud.readview` resource cleanup on garbage collect (#379). * VShard storage user have not execution rights for internal functions (#366). * Compatibility with Tarantool 3.0 tuple objects (#387). Infrastructure * `deps.sh` installs the `vshard` instead of the `cartridge` by default (#364). You could to specify an environment variable `CARTIRDGE_VERSION` to install the `cartridge` and run tests cases with it. * `doc/playground.lua` does not work with Tarantool 3 (#371). * Tests with Tarantool 3 (#364). * Quickstart section in the README.md focuses on usage with `vshard` instead of `Cartridge` (#366).
Overview This release improves experience for VShard clusters users and Tarantool 3 users. It also introduces schema introspection API. New features * Space schema introspection API `crud.schema` (#380). Bugfixes * Return explicit error for `*_many` call with no tuples/objects (#377). * `crud.readview` resource cleanup on garbage collect (#379). * VShard storage user have not execution rights for internal functions (#366). * Compatibility with Tarantool 3.0 tuple objects (#387). Infrastructure * `deps.sh` installs the `vshard` instead of the `cartridge` by default (#364). You could to specify an environment variable `CARTIRDGE_VERSION` to install the `cartridge` and run tests cases with it. * `doc/playground.lua` does not work with Tarantool 3 (#371). * Tests with Tarantool 3 (#364). * Quickstart section in the README.md focuses on usage with `vshard` instead of `Cartridge` (#366).
cartridge
rock won't be supported in Tarantool 3.x.crud
supports running withoutcartridge
onvshard
cluster, but it seems that it is not enough for user to simply run vshard cluster andcrud.init_router
/crud.init_storage
:We need to automatize the process of setup as far as possible. If some manual actions still should be required from user, we should thoroughly describe them in README.
See also #364
The text was updated successfully, but these errors were encountered: