-
Notifications
You must be signed in to change notification settings - Fork 388
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Hi!
Tarantool protocol was designed for transparent schema reload.
However, net.box
doesn't follow the workflow protocol properly.
net.box
should send its schema_version
for each request. But it always sends zero.
So it reloads the scheme with one-request delay.
There wasn't such bug 7 years ago. This bug appeared when the net.box
was refactored. After that there was added the :reload_schema
method to solve the problems caused by this bug manually.
The net.box
algorithm should be the following:
- Init
- Send
schema_version
for each request - Delay all requests if schema error occurs until the schema is reloaded
- Reload schema
- Resend the request that caused schema error
- Send all delayed requests (including the other
schema-error
requests) - ...
Reproduce test config:
console = require 'console'
nb = require 'net.box'
box.cfg{listen = 3301, work_dir = 'tnb'}
box.schema.user.grant('guest', 'read,write,execute', 'universe')
ts = box.schema.space.create(
'ts',
{
format={
{name='key', type='string'},
{name='vl', type='string'},
}
}
)
ts:create_index('pk')
ts:insert{'hello', 'world'}
remote = nb.connect('localhost:3301')
console.start() os.exit()
Reproduce script:
tarantool> remote.schema_version
---
- 80 -- !!!! have to be 81 !!!!!
...
tarantool> remote.space.ts:get('hello')['value']
---
- null
...
tarantool> remote.space.ts:get('hello')['vl']
---
- world
...
tarantool> ts:format{'key', 'value'}
---
...
tarantool> remote.schema_version
---
- 80 -- !!!! have to be 81 !!!!!
...
tarantool> remote.space.ts:get('hello')['value']
---
- null -- !!!! have to be 'world' !!!!
...
tarantool> remote.space.ts:get('hello')['value']
---
- world
...
tarantool> remote.schema_version
---
- 81
...
Totktonada and DifferentialOrange
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working