-
Notifications
You must be signed in to change notification settings - Fork 605
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
refactor: ensure update vnode bitmap after yield barrier #20218
base: main
Are you sure you want to change the base?
Conversation
This pull request has been modified. If you want me to regenerate unit test for any of the files related, please find the file in "Files Changed" tab and add a comment |
7ebc0d1
to
4083a47
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.
Added some comments for code with logic changed and need more careful review.
.as_mut() | ||
.unwrap() | ||
.commit(barrier.epoch) | ||
.await?; | ||
yield Message::Barrier(barrier); | ||
post_commit |
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.
Newly added logic. Previously the vnode bitmap of memo table is not updated, not sure if this is correct or not.
if previous_vnode_bitmap != vnode_bitmap { | ||
need_update_global_max_watermark = true; | ||
} | ||
} | ||
|
||
if is_checkpoint && last_checkpoint_watermark != current_watermark { |
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.
Logic is changed here. Previously write the watermark on the new vnode bitmap. After this PR will write on the original vnode bitmap.
|
||
Message::Barrier(b) | ||
continue; |
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.
The barrier has been yielded, so we change to continue
here.
0d278ab
to
9965471
Compare
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Part of #18312.
As described in #18312, we should ensure a correct handling order as
state_table.commit()
->yield barrier
->state_table.update_vnode_bitmap()
in streaming executors while update vnode bitmap.In this PR, for
state_table.commit()
, we change to return aStateTablePostCommit<'_>
, which captures the mutable reference to the originalstate_table
and will be used as a callback after yielding the barrier. TheStateTablePostCommit
has a methodasync fn post_yield_barrier(mut self, new_vnodes: Option<Arc<Bitmap>>)
to be called after the we yield the barrier.The
StateTablePostCommit
is marked with#[must_use]
. The method namepost_yield_barrier
indicates that it should be called after we have yielded the barrier. In state table, we add a flagon_post_commit
, to indicate that whether theStateTablePostCommit
is handled properly. Onstate_table.commit()
, we will mark theon_post_commit
as true, and inStateTablePostCommit::post_yield_barrier
, we will remark the flag as false, and onstate_table.commit()
, we will assert that theon_post_commit
must be false. Note that, thepost_yield_barrier
should be called for all barriers rather than only for the barrier with update vnode bitmap. In this way, though we don't have scale test for all streaming executor, we can ensure that all executor covered by normal e2e test have properly handled theStateTablePostCommit
.Checklist
Documentation
Release note