Skip to content
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: enable consistent hash for materialize and table scan #3558

Merged
merged 19 commits into from
Jun 30, 2022

Conversation

BugenZhao
Copy link
Member

@BugenZhao BugenZhao commented Jun 29, 2022

I hereby agree to the terms of the Singularity Data, Inc. Contributor License Agreement.

What's changed and what's your intention?

This PR enables consistent hash for materialize executor, so that the batch query executor can really parallelize the scanning now. Besides, the RowSeqScan is now ready to support parallel scan as well (#3251).

There leave several issues to resolve:

Checklist

  • I have written necessary docs and comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Refer to a related PR or issue link (optional)

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>
@BugenZhao BugenZhao mentioned this pull request Jun 30, 2022
3 tasks
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>
@BugenZhao BugenZhao marked this pull request as ready for review June 30, 2022 06:12
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
@@ -95,13 +98,19 @@ impl ExecutorBuilder for ArrangeExecutorBuilder {
.map(|key| *key as usize)
.collect();

// FIXME: Lookup is now implemented without cell-based table API and relies on all vnodes
Copy link
Member Author

@BugenZhao BugenZhao Jun 30, 2022

Choose a reason for hiding this comment

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

This will be resolved by #3418. cc @BowenXiao1999

Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
@codecov
Copy link

codecov bot commented Jun 30, 2022

Codecov Report

Merging #3558 (5665bda) into main (edab3f5) will decrease coverage by 0.02%.
The diff coverage is 56.70%.

@@            Coverage Diff             @@
##             main    #3558      +/-   ##
==========================================
- Coverage   74.39%   74.36%   -0.03%     
==========================================
  Files         771      771              
  Lines      108714   108713       -1     
==========================================
- Hits        80875    80844      -31     
- Misses      27839    27869      +30     
Flag Coverage Δ
rust 74.36% <56.70%> (-0.03%) ⬇️

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

Impacted Files Coverage Δ
src/batch/src/executor/row_seq_scan.rs 16.99% <0.00%> (-0.70%) ⬇️
src/common/src/hash/key.rs 84.92% <0.00%> (ø)
src/common/src/types/mod.rs 67.18% <ø> (ø)
...ntend/src/optimizer/plan_node/stream_index_scan.rs 25.00% <ø> (+1.52%) ⬆️
...ntend/src/optimizer/plan_node/stream_table_scan.rs 95.57% <ø> (-0.26%) ⬇️
src/stream/src/executor/aggregation/mod.rs 75.74% <0.00%> (-0.86%) ⬇️
src/stream/src/from_proto/batch_query.rs 0.00% <0.00%> (ø)
src/stream/src/from_proto/mview.rs 0.00% <0.00%> (ø)
src/storage/src/table/cell_based_table.rs 72.28% <69.44%> (-1.45%) ⬇️
src/stream/src/executor/mview/materialize.rs 87.75% <86.20%> (-1.14%) ⬇️
... and 16 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

Signed-off-by: Bugen Zhao <i@bugenzhao.com>
@@ -184,7 +184,7 @@ mod tests {
#[test]
fn test_vec_decode_encode() {
let mut result = vec![];
let value_meta = ValueMeta { vnode: 63492 };
let value_meta = ValueMeta { vnode: 233 };
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still have vnode in value meta now?

Copy link
Member Author

Choose a reason for hiding this comment

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

Will remove soon. Check #3316

@BugenZhao BugenZhao added the mergify/can-merge Indicates that the PR can be added to the merge queue label Jun 30, 2022
@mergify mergify bot merged commit 5ff98d7 into main Jun 30, 2022
@mergify mergify bot deleted the bz/vnode-in-key-part-6 branch June 30, 2022 11:42
huangjw806 pushed a commit that referenced this pull request Jul 5, 2022
* encode vnode in mview

Signed-off-by: Bugen Zhao <i@bugenzhao.com>

* use vnode in scan & batch query executor

Signed-off-by: Bugen Zhao <i@bugenzhao.com>

* support singleton materialize

Signed-off-by: Bugen Zhao <i@bugenzhao.com>

* ordered batch iterator

Signed-off-by: Bugen Zhao <i@bugenzhao.com>

* parallelized chain

Signed-off-by: Bugen Zhao <i@bugenzhao.com>

* disable time index & time window

Signed-off-by: Bugen Zhao <i@bugenzhao.com>

* introduce distribution struct

Signed-off-by: Bugen Zhao <i@bugenzhao.com>

* remove without distribution

Signed-off-by: Bugen Zhao <i@bugenzhao.com>

* disable delta join

Signed-off-by: Bugen Zhao <i@bugenzhao.com>

* recover delta join

Signed-off-by: Bugen Zhao <i@bugenzhao.com>

* update proto test

Signed-off-by: Bugen Zhao <i@bugenzhao.com>

* fix clippy

Signed-off-by: Bugen Zhao <i@bugenzhao.com>

* concurrent iter creation

Signed-off-by: Bugen Zhao <i@bugenzhao.com>

* use 256 vnodes

Signed-off-by: Bugen Zhao <i@bugenzhao.com>

* fix tests

Signed-off-by: Bugen Zhao <i@bugenzhao.com>

* fix tests

Signed-off-by: Bugen Zhao <i@bugenzhao.com>

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mergify/can-merge Indicates that the PR can be added to the merge queue type/feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable consistent hash for Materialize
4 participants