-
Notifications
You must be signed in to change notification settings - Fork 18
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
Soft automatic schema reload #200
Conversation
eeefdca
to
178337c
Compare
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! My comments are below.
258f1d4
to
672a687
Compare
Sorry for the late reply. Here are my thoughts about the patch. Re approach
A schema is updated at the following points:
It worth to describe how the schema reload works (in README): I would add the AFAIU cluster client should work well if we'll drop a schema cache between Re codeWhen I start to look into the code there were difficulties to undestand some
I think it worth to think whether we able to improve the terminology: are we Don't sure about all points within this section. I don't sure that they will BTW, I like the approach where space / index names are resolved using a schema Quite minor points
|
8ef4616
to
e99d0dd
Compare
8aed0a1
to
456385e
Compare
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.
Sorry, I possibly directed you in a wrong way with all those thoughts about
ordering. I thought that it would be cheap to give some simple guarantees on
ordering, but it does not look so for me now. Please, consider comments below.
Key points:
- Extract the DSL into separate PR.
- It will be possible to discuss it separately.
- It seems we can form a request object w/o using the DSL internally.
- Don't try to give requests in some order.
- Dependent actions should either performed using a server-side procedure or
performed sequencial (next one will wait a result of previous one). There is
no general way (streams, interactive transactions or so) to ensure a server
will execute request in an order when we send them in a batch. - We use two buffers to write and choose one of them depending (AFAIU) on a
packet size and a fullness of a shared buffer, so we have no guarantee
that we'll write requests in the order it was written by a user. - Tarantool starts to execute a request in the order them were written. But
this does not guarantee that they will be finished in the same order if
there are yields inside. It is possible for calls, evals and in case of
vinyl. - As I see the current implementation retries requests in the order of
ER_SCHEMA responses. If we would want to provide some ordering guarantee
we will be obligated to lean on, say, monotonically increasing request id
(sync id). - The question here sounds for me so: how many guarantees about ordering we
can give keeping the code considerably simple and keeping description of
those guarantees considerably simple. When I said guarantees I mean
guarantees of ordering for memtx/vinyl/call(eval) requests (or at least
order of starting of execution) -- and they should become the same even if
a schema error was received -- and guarantees about a point when we
resolve names (this is about ordering too). As I see it is not worth to
give some partial and hard in understanding solution here. It is better to
come to this question when streams / transactions will be supported on
tarantool side. - So I propose to treat each request separately (in context of retries), but
as optimization we can postpone those requests that will definitely
receive a schema error if will be written immediately.
- Dependent actions should either performed using a server-side procedure or
BTW, it means that while we have no some kind of streams
support on the server
side, we are unable to implement batching (say, for jdbc) using async
connector. Or maybe we can in theory (after significant changes around points
above) and for some specific set of requests: memtx only, no yields inside
(each request either is a signle operation of several ones in a transaction).
It does not look worthful.
I assumed that relaxing of guarantees may allow us to simplify the code. That is why I bother about this. |
5ffc288
to
244a493
Compare
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.
Sorry for a big delay.
I looked into the schema reload part of the PR (1st commit). I think that the second one should be developed in a separate PR. However it is helpful to have a draft for a request DSL to evaluate how good we designed a future achitecture. (Now the DSL lacks documentation and tests, that is why I said 'draft': maybe the implementation is mature enough.)
Now I looked into a behaviour part (and I mostly comfortable with it). I need to look into schema/ classes and tests; but stops here to give some comments sooner.
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.
A bit more comments.
244a493
to
d5ceeb2
Compare
Thank you for the great work! Now I have no objections, except API compitibility: template parameters of I have the question about a died stage and the proposal re make some tests more durable: please, update me on those points. I propose to extract DSL implementation into its own PR. I looked over it too and this looks adorable. It needs tests and a documentation. Also I would name |
d5ceeb2
to
567851c
Compare
4056cb2
to
de7faf9
Compare
Now client keeps actual schema metadata and sends schemaId header to be checked against current Tarantool schema version. If client version mismatches DB version client does schema reloading in the background. Client operation interface was reworked in scope of support not only number identifiers for spaces and indexes but also their string names. Closes: #7, #137
de7faf9
to
dd1f29f
Compare
Now client keeps actual schema metadata and sends schemaId header to be
checked against current Tarantool schema version. If client version
mismatches DB version client does schema reloading in the background.
Client operation interface was reworked in scope of support not only
number identifiers for spaces and indexes but also their string names.
Closes: #7, #137