-
Notifications
You must be signed in to change notification settings - Fork 453
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
storage: add regression test for upsert sources with keys that move partitions #27092
base: main
Are you sure you want to change the base?
Conversation
I don't think we want to commit to anything (and I don't think we can even if we wanted to). If the topic looks like this:
There is no guarantee that after reclocking the stream will look like this:
And not like this
In the first case |
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.
There is a detail that I want to verify is done correctly. Upsert should compare the tuple (into_time, from_time)
of an incoming update with the stored (into_time, from_time)
tuple and not just the from_time
. Is this what we store and use from the upsert state?
In other words, the behavior you have documented in the test as only happening in a restart must also happen in the case where the two updates from two different partitions happen to be reclocked to different timestamps. In that case the one with the larger mz timestamp must be the one that wins, no matter what its partition is. Is this how it works?
@petrosagg We currently sort by |
yes
If "supporting" means that when a key moves partitions we will always keep the value of the highest partition then no, we can't support that because we can't guarantee that the two updates will land in the same mz timestamp. It's only when they land in the same timestamp that we can promise to keep the highest partition, otherwise the one with the highest mztimestamp will win, and that might be the lower partition. |
Our correctness promise is correctness property #2, i.e that |
Closes #26965
cc @morsapaes
We only want to commit to the fact that if a keys partition only increases, then we do the right thing.
Motivation
Checklist
$T ⇔ Proto$T
mapping (possibly in a backwards-incompatible way), then it is tagged with aT-proto
label.