storage,compute: rethink reconciliation#13526
Conversation
350c123 to
99b7ce0
Compare
antiguru
left a comment
There was a problem hiding this comment.
I think this seems good, but I still have to convince myself that it does what it advertises. If @frankmcsherry gets to review first, then don't block on me!
Yeah current plan is to have @frankmcsherry take a swing at adding in the implementation of I'm not presently planning to push this work any further myself. |
|
Commit 2ec1e0b adds a method My confidence in the correctness of this logic is .. minimal. It seems to correctly pick up existing arrangements and drop dataflows for a TAIL command, but .. as you can see it's all a bit fiddly. My guess is that we should have someone with ownership over this / related stuff, if it ever changes again in the future. Known issues: multi-process replicas can get out of sync by receiving different prefixes of a command stream, and thereby lead to different conclusions about reconciliation. This is bad news, and we are separately discussing how to fix (in https://github.com/MaterializeInc/database-issues/issues/3881). |
|
Seems at least as correct as the existing logic, and I've got higher confidence that we'll be able to improve this logic in the new to structure to the point of "definitely correct." At least, not having to do bookkeeping in both the reconciler module and the worker itself is easier for me to reason about. How do you want to proceed with this PR, @frankmcsherry? Should we get it rebased and then talk @antiguru into reviewing it/taking long term ownership of it? |
|
I'm going to try and see if I can figure out / fix some of the issues (I haven't looked into them yet) but then getting some eyes on whether the structure of things look good and improvable/maintainable works for me. I'd love to hand it off w/o a bunch of failing tests though. :D If you are up for rebasing, I'll start sniffing around the failures. |
|
Yes, happy to do the rebase if that would be helpful! I can also stay out
of the way.
…On Thu, Jul 14, 2022 at 8:55 AM Frank McSherry ***@***.***> wrote:
I'm going to try and see if I can figure out / fix some of the issues (I
haven't looked into them yet) but then getting some eyes on whether the
structure of things look good and improvable/maintainable works for me. I'd
love to hand it off w/o a bunch of failing tests though. :D
If you are up for rebasing, I'll start sniffing around the failures.
—
Reply to this email directly, view it on GitHub
<#13526 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGXSIH22NHL4UON4PBFRRLVUAE3FANCNFSM53CETF7A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
I just had a look at @frankmcsherry's changes, and I think they look good! Definitely a plus on the maintainability side, and well explained. |
2ec1e0b to
4841017
Compare
Hearing nothing, I did the rebase! |
4841017 to
d03d29f
Compare
Make the approach to storage reconciliation match the approach to compute reconciliation, where an explicit InitializeCompaction command is used to trigger the reconciliation logic on the server. This allows stale ingestions to be removed.
benesch
left a comment
There was a problem hiding this comment.
I filled in the TODO(benesch)s for storage! We actually do have a decent test for storage reconciliation and it seems happy. This all LGTM, but I agree that we should get @antiguru's sign off too because either he or his appointee will be responsible for this code!
| .state | ||
| .history | ||
| .iter() | ||
| .chain(&[ComputeCommand::InitializationComplete]) |
There was a problem hiding this comment.
It made sense without the bootstrap signal! Just not once that exists.
antiguru
left a comment
There was a problem hiding this comment.
This looks good, thank y'all!
Co-authored-by: Moritz Hoffmann <antiguru@gmail.com>
Co-authored-by: Moritz Hoffmann <antiguru@gmail.com>
This field is dead code. Its last/only use has been removed in MaterializeInc#13526. This commit removes the `is_subscribe` field and bring the compute `SinkToken` in line with the same type defined in `storage`.
This field is dead code. Its last/only use has been removed in MaterializeInc#13526. This commit removes the `is_subscribe` field and bring the compute `SinkToken` in line with the same type defined in `storage`.
This field is dead code. Its last/only use has been removed in #13526. This commit removes the `is_subscribe` field and bring the compute `SinkToken` in line with the same type defined in `storage`.
Ignore the first commit. That's #13525.
Previously, reconciliation sat on top of storage/compute servers, and
attempted to paper over commands and responses so that clients believed
they were talking to a fresh server, while servers always believed they
were talking to the originally-connected client. This introduced a lot
of complicated logic and double bookkeeping.
This commit pushes reconciliation logic into the storaged and computed
servers. The servers are now aware of when a new client connects, and
they simply ditch any state that was related to the old client.
This tees us up for the last reconciliation task: garbage collecting
sources and dataflows that newly-connected clients are not interested
in.
Touches https://github.com/MaterializeInc/database-issues/issues/3125.
Touches https://github.com/MaterializeInc/database-issues/issues/3691.
Motivation
Testing
Release notes
This PR includes the following user-facing behavior changes: