-
Notifications
You must be signed in to change notification settings - Fork 5k
[Load-CDK] Speed: prepare state handling for new protocol #60886
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
[Load-CDK] Speed: prepare state handling for new protocol #60886
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
436c000 to
6dd6e03
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.
with with
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.
Should some logging be added to indicate that the checkpoint was indeed removed?
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.
This log line log.info { "Flushing global checkpoint with key ${head.key}" } means we definitely got there. (I was careful to make sure all the possible code paths when trying to flush log something.)
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.
I think I meant logging globalCheckpoints.remove was done.
sendStateMessage could fail in which case we would not be running remove?
6dd6e03 to
ba53a29
Compare
ba53a29 to
12a988b
Compare
| streamCheckpoints.poll() // don't remove until after we've successfully sent | ||
| sendStateMessage(nextMessage, nextCheckpointKey, listOf(stream.descriptor)) | ||
| // don't remove until after we've successfully sent | ||
| streamCheckpoints.remove(nextCheckpointKey) |
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.
nit: can we name nextCheckpointKey something like currentCheckpointKey?
I feel like it is confusing to call remove on "next"
What
Implements the spec outlined here.
Lays groundwork for the CDK to use the new Speed state protocol. TLDR:
partition_idon both the state message and its associated records (called internally CheckpointId)idfor bw-compatibility w/ the platform, called internally CheckpointIndex); the index specifies the order in which the state should be returned/persistedPrevious STDIO workflow:
To prepare the STDIO workflow for Speed:
CheckpointIndex::value.toString()Some callouts:
The source will try to release states in order, but long-term we can't rely on that, and using multiple threads means we can't guarantee the destination will process the state in order. Implications:
Additional changes: