-
Notifications
You must be signed in to change notification settings - Fork 613
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: adding column of table schema change #8063
Conversation
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
…-part-2 Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
This PR moves the `ColIndexMapping` utility from the frontend crate to the common crate, since the meta service will also rely on this (#8063). The frontend-specific methods are provided by an extension trait. Approved-By: st1page Approved-By: xxchan
…-part-2 Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
|
||
table_fragments.insert(table_id, table_fragment.clone()); | ||
|
||
// Update downstream `Merge`s. |
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 part is too dirty. 🥵
@@ -842,18 +924,26 @@ where | |||
pub async fn get_downstream_chain_fragments( | |||
&self, | |||
table_id: TableId, | |||
) -> MetaResult<Vec<Fragment>> { | |||
) -> MetaResult<Vec<(DispatchStrategy, Fragment)>> { |
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.
We also need the output indices in the dispatchers (then map it with column index mapping), so Fragment
is not sufficient here.
let added_upstream_actor_id = update.added_upstream_actor_id.clone(); | ||
let removed_upstream_actor_id: HashSet<_> = | ||
if update.new_upstream_fragment_id.is_some() { | ||
select_all.upstream_actor_ids().iter().copied().collect() |
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.
Remove all actors if fragment id is changed.
risingwave/proto/stream_plan.proto
Lines 47 to 50 in 54a92dd
// - For scaling, this is always `None`. | |
// - For plan change, the upstream fragment will be changed to a new one, and this will be `Some`. | |
// In this case, all the upstream actors should be removed and replaced by the `new` ones. | |
optional uint32 new_upstream_fragment_id = 5; |
Codecov Report
@@ Coverage Diff @@
## main #8063 +/- ##
==========================================
- Coverage 71.70% 71.59% -0.11%
==========================================
Files 1131 1131
Lines 182325 182672 +347
==========================================
+ Hits 130731 130780 +49
- Misses 51594 51892 +298
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
LSTM!!! Except some workaround, we can refactor them later. 🥵
self.notify_fragment_mapping(&old_table_fragment, Operation::Delete) | ||
.await; | ||
self.notify_fragment_mapping(&table_fragment, Operation::Add) | ||
.await; |
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.
Can this 2 lines be merged into 1 Update?
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 guess we can't. By specifying Update
we will update the vnode mapping for all fragment in the list that is used for scaling, while in this case, the fragment list is replaced and we should delete the entry of vnode mapping for old fragments.
…-part-2 Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
6722da1
to
7bb5515
Compare
Signed-off-by: Bugen Zhao i@bugenzhao.com
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
This PR implements adding columns of table schema change on the meta service and compute node.
ReplaceTable
which will generateUpdate
mutation, sharing some logic with scaling.Note: this PR should not be marked as user-facing, until #7906 is done.
Tracking issue: #6903.
Close #7908. Close #7910.
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Click here for Documentation
Types of user-facing changes
Please keep the types that apply to your changes, and remove the others.
Release note