-
Notifications
You must be signed in to change notification settings - Fork 606
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
feat(snapshot-backfill): introduce state to snapshot backfill #19720
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
641fa65
to
a3f0881
Compare
c2868dd
to
d5c4a10
Compare
5567d22
to
ba717b7
Compare
if self.streams.is_empty() { | ||
break Poll::Ready(Ok(None)); | ||
} | ||
for (vnode, stream) in &mut self.streams { |
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.
Will polling the streams in vnode order cause starvation or data skew in downstream? Should we use FuturesUnordered
instead?
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.
Changed to use FuturesUnordered
in #19936
ba717b7
to
353a5c9
Compare
353a5c9
to
45a1be4
Compare
45a1be4
to
0fb452c
Compare
2d2947f
to
579b264
Compare
0fb452c
to
7a48e72
Compare
de3fef3
to
627c55a
Compare
7a48e72
to
0913965
Compare
0913965
to
39b4c1b
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.
license-eye has checked 5534 files.
Valid | Invalid | Ignored | Fixed |
---|---|---|---|
2332 | 1 | 3201 | 0 |
Click to see the invalid file list
- src/stream/src/executor/backfill/snapshot_backfill/state.rs
Use this command to fix any missing license headers
```bash
docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix
</details>
43a6729
to
b5d15ae
Compare
b5d15ae
to
8ad6a3b
Compare
8ad6a3b
to
8b58adc
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.
LGTM, thanks!
3977f66
to
d53453b
Compare
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
In this PR, we will introduce state to track the progress of snapshot backfill. The progress state table will have the following schema
vnode
, which means we track the snapshot backfill progress in per-vnode way.epoch
is the epoch that thevnode
is currently consuming on. We can assume thatepoch >= snapshot_epoch
. Whenepoch == snapshot_epoch
, thevnode
will be consuming the snapshot, and whenepoch > snapshot_epoch
, thevnode
will be consuming the change log onepoch
.row_count
is the number of rows that we have consumed in this epoch. Therow_count
is measured in per-vnode manner.is_epoch_finished
means whether the vnode has finished consuming theepoch
.pk...
is the current progress of consuming the epoch. When the fields only make sense whenis_epoch_finished
isfalse
. Note that thepk...
is thepk
of the first unconsumed row, rather than thepk
of the last consumed row, which is different to the one in arrangement backfill.With the
VnodeStream
implemented in #19936, we can get the current progress of each vnode before the stream is finished. When barrier is received, we can first drain the buffer, and then usePeekable::peek
to get the first unconsumed row, and then save thepk
to the backfill progress state.In this PR, we only write the progress state, and only read the state for sanity check. In future PR, we will read the progress state to support recoverable snapshot backfill.
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.