Skip to content

Conversation

@MrCroxx
Copy link
Contributor

@MrCroxx MrCroxx commented Feb 7, 2022

What's changed and what's your intention?

Adapt create materialized view to the meta barrier manager. All barrier and meta store operations will be moved to barrier manager.

Currently MV on MV does not support parallel mview upstream (#58) and some other features in this PR. I will implement them in another some PRs. So MV on MV e2e still cannot run. I've checked the e2e test with parallel degree equals 1 and works.

Checklist

  • I have written necessary docs and comments
  • I have added necessary unit tests and integration tests

Refer to a related PR or issue link (optional)

#87

@github-actions github-actions bot added the type/feature Type: New feature. label Feb 7, 2022
@wyhyhyhyh
Copy link
Contributor

feat(mview) :eat_watermelon

Comment on lines 169 to 178
// TODO(MrCroxx): refine this
let mut actor_ids_to_collect = info.actor_ids_to_collect(node_id).collect_vec();
match &mutation {
Mutation::Add(AddMutation { actors }) => {
if !actors.is_empty() {
actor_ids_to_collect.extend(new_actors_to_collect.drain(..));
}
}
_ => {}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BugenZhao Collecting from newly created actors may not be a good idea. Maybe still collect from existing actor and let chain executor swallow the first barrier (conf change barrier) and get its epoch is better?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've no idea which approach is better. Considering there'll still be some changes if we are to optimize large snapshot ingesting, let's make it run first!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, if we collect barriers from newly created actors, we need to collect them in any cases, not only for mv on mv, which haven't been implemented now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have discussed with @fuyufjh before, we prefer not to collect barriers from newly created actors(not caught up actors). Both swallow in chain or ignore the old epoch when collecting after actors ready is both okay. Swallow it would be more simple in any cases.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not collect from newly created actors will also not block other normal barriers, like checkpoint(flush).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not collect from newly created actors will also not block other normal barriers, like checkpoint(flush).

What about setting actor status "ready"? Will the operation needs a barrier? If needed, should that barrier be collected from the new ready actors? That case is more like MV on MV, which barrier only updates the outputs of the dispatchers.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For CreateMaterializedView cmd, the barrier should be collected from the new created actors. For MV on MV or MV on table which already contains large amount of data, the creating operation should be blocked, which means Chain actor should hold the creating barrier, when almost catch up, it should pass the barrier and let it be collected by barrier manager. Until now, the creating cmd finished and the status will be set to ready.

@MrCroxx MrCroxx changed the title feat(mview): support barrier from meta [WIP] feat(mview): support barrier from meta Feb 7, 2022
@MrCroxx MrCroxx marked this pull request as ready for review February 7, 2022 04:25
@codecov
Copy link

codecov bot commented Feb 7, 2022

Codecov Report

Merging #88 (45357ac) into main (c6c3c7b) will increase coverage by 0.09%.
The diff coverage is 85.24%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main      #88      +/-   ##
============================================
+ Coverage     74.40%   74.50%   +0.09%     
  Complexity     2645     2645              
============================================
  Files           829      829              
  Lines         47563    47609      +46     
  Branches       1560     1560              
============================================
+ Hits          35390    35469      +79     
+ Misses        11375    11342      -33     
  Partials        798      798              
Flag Coverage Δ
java 61.91% <ø> (ø)
rust 79.96% <85.24%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
rust/meta/src/rpc/service/stream_service.rs 100.00% <ø> (ø)
rust/stream/src/executor/mod.rs 65.07% <0.00%> (-2.14%) ⬇️
rust/stream/src/task/barrier_manager.rs 95.50% <ø> (ø)
rust/stream/src/task/stream_manager.rs 52.48% <ø> (+0.47%) ⬆️
rust/stream/src/executor/dispatch.rs 83.08% <76.47%> (+0.33%) ⬆️
rust/meta/src/barrier/command.rs 47.91% <85.71%> (+15.56%) ⬆️
rust/stream/src/executor/chain.rs 86.00% <85.71%> (-1.10%) ⬇️
rust/meta/src/stream/stream_manager.rs 90.20% <97.82%> (-0.83%) ⬇️
rust/meta/src/barrier/mod.rs 70.23% <100.00%> (+24.55%) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c6c3c7b...45357ac. Read the comment docs.

Copy link
Member

@BugenZhao BugenZhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LSTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/feature Type: New feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants