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

Feature Branch: merge master to planner_refactory branch #5353

Merged
merged 105 commits into from
Jul 12, 2022

Conversation

SeaRise
Copy link
Contributor

@SeaRise SeaRise commented Jul 12, 2022

What problem does this PR solve?

Issue Number: ref #4739
close #5350

Problem Summary:

What is changed and how it works?

We can use #5350 to check if the modification is correct

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

windtalker and others added 30 commits May 26, 2022 21:12
* Add to_seconds support for tiflash

Signed-off-by: yibin <[email protected]>

* Fix format issue

Signed-off-by: yibin <[email protected]>

* Add mutex lock to protect async reciever async reader

Signed-off-by: yibin <[email protected]>

* Fix a rebase issue

Signed-off-by: yibin <[email protected]>

* Change raw pointer to unique ptr

Signed-off-by: yibin <[email protected]>

* Fix format issue

Signed-off-by: yibin <[email protected]>

Co-authored-by: Ti Chi Robot <[email protected]>
)

* fix decoding error under heavy ddl operation

* small fix
f
update for planner

update for tests

fix tests
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jul 12, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • guo-shaoge
  • ywqzzy

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jul 12, 2022
@SeaRise SeaRise changed the title merge master to feature branch(planner_refactory) Feature Branch: merge master to planner_refactory branch Jul 12, 2022
@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 12, 2022

/rebuild

Comment on lines +90 to +98
/// todo support fine grained shuffle
static auto disable_fine_frained_shuffle = [](const DAGQueryBlock & query_block) {
return !enableFineGrainedShuffle(query_block.source->fine_grained_shuffle_stream_count())
&& (!query_block.exchange_sender || !enableFineGrainedShuffle(query_block.exchange_sender->fine_grained_shuffle_stream_count()));
};
return query_block.source
&& (query_block.source->tp() == tipb::ExecType::TypeProjection
|| query_block.source->tp() == tipb::ExecType::TypeExchangeReceiver);
|| query_block.source->tp() == tipb::ExecType::TypeExchangeReceiver)
&& disable_fine_frained_shuffle(query_block);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

for fine grained shuffle
#5048

@@ -69,7 +68,7 @@ void PhysicalExchangeReceiver::transformImpl(DAGPipeline & pipeline, Context & c
auto & exchange_receiver_io_input_streams = dag_context.getInBoundIOInputStreamsMap()[executor_id];
for (size_t i = 0; i < max_streams; ++i)
{
BlockInputStreamPtr stream = std::make_shared<ExchangeReceiverInputStream>(mpp_exchange_receiver, log->identifier(), executor_id);
BlockInputStreamPtr stream = std::make_shared<ExchangeReceiverInputStream>(mpp_exchange_receiver, log->identifier(), executor_id, /*stream_id=*/0);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

for fine grained shuffle
#5048

Comment on lines +58 to +72
/// todo support fine grained shuffle
int stream_id = 0;
pipeline.transform([&](auto & stream) {
// construct writer
std::unique_ptr<DAGResponseWriter> response_writer = std::make_unique<StreamingDAGResponseWriter<MPPTunnelSetPtr>>(
std::unique_ptr<DAGResponseWriter> response_writer = std::make_unique<StreamingDAGResponseWriter<MPPTunnelSetPtr, false>>(
dag_context.tunnel_set,
partition_col_ids,
partition_col_collators,
exchange_type,
context.getSettingsRef().dag_records_per_chunk,
context.getSettingsRef().batch_send_min_limit,
stream_id++ == 0, /// only one stream needs to sending execution summaries for the last response
dag_context);
dag_context,
0,
0);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

for fine grained shuffle
#5048

}
CATCH

/// todo support FineGrainedShuffle
Copy link
Contributor Author

Choose a reason for hiding this comment

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

for fine grained shuffle
#5048

Comment on lines +109 to +141
if (pipeline.streams.size() > 1 || pipeline.streams_with_non_joined_data.size() > 1)
{
const Settings & settings = context.getSettingsRef();
BlockInputStreamPtr stream_with_non_joined_data = combinedNonJoinedDataStream(pipeline, max_streams, log);
pipeline.firstStream() = std::make_shared<ParallelAggregatingBlockInputStream>(
BlockInputStreamPtr stream = std::make_shared<ParallelAggregatingBlockInputStream>(
pipeline.streams,
stream_with_non_joined_data,
pipeline.streams_with_non_joined_data,
params,
context.getFileProvider(),
true,
max_streams,
settings.aggregation_memory_efficient_merge_threads ? static_cast<size_t>(settings.aggregation_memory_efficient_merge_threads) : static_cast<size_t>(settings.max_threads),
log->identifier());

pipeline.streams.resize(1);
pipeline.streams_with_non_joined_data.clear();
pipeline.firstStream() = std::move(stream);

// should record for agg before restore concurrency. See #3804.
recordProfileStreams(pipeline, context);
restoreConcurrency(pipeline, context.getDAGContext()->final_concurrency, log);
}
else
{
BlockInputStreamPtr stream_with_non_joined_data = combinedNonJoinedDataStream(pipeline, max_streams, log);
BlockInputStreams inputs;
if (!pipeline.streams.empty())
inputs.push_back(pipeline.firstStream());
else
pipeline.streams.resize(1);
if (stream_with_non_joined_data)
inputs.push_back(stream_with_non_joined_data);

if (!pipeline.streams_with_non_joined_data.empty())
inputs.push_back(pipeline.streams_with_non_joined_data.at(0));

pipeline.streams.resize(1);
pipeline.streams_with_non_joined_data.clear();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

from #5274

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 12, 2022
@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 12, 2022

/rebuild

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jul 12, 2022
@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 12, 2022

/merge

@ti-chi-bot
Copy link
Member

@SeaRise: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: b8a6178

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 12, 2022
@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 12, 2022

/rebuild

@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 12, 2022

/run-integration-test

@sre-bot
Copy link
Collaborator

sre-bot commented Jul 12, 2022

Coverage for changed files

too many lines from llvm-cov, please refer to full report instead

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18664      9499             49.11%    211011  95872        54.57%

full coverage report (for internal network access only)

@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 12, 2022

/run-integration-test

6 similar comments
@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 12, 2022

/run-integration-test

@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 12, 2022

/run-integration-test

@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 12, 2022

/run-integration-test

@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 12, 2022

/run-integration-test

@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 12, 2022

/run-integration-test

@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 12, 2022

/run-integration-test

@ti-chi-bot ti-chi-bot merged commit 05fd9bd into pingcap:planner_refactory Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.