Introduced MergeTask and MutateTask#25165
Introduced MergeTask and MutateTask#25165nikitamikhaylov merged 124 commits intoClickHouse:masterfrom
Conversation
cc94c52 to
ce62354
Compare
|
@Mergifyio update |
|
Command
|
f2f7d7e to
22e6571
Compare
45d29b8 to
5c1c2a3
Compare
8e179d5 to
7b89c2e
Compare
51397fa to
2f179af
Compare
8191198 to
ebcedd8
Compare
|
|
||
| bool ReplicatedMergeMutateTaskBase::executeImpl() | ||
| { | ||
| MemoryTrackerThreadSwitcherPtr switcher; |
There was a problem hiding this comment.
Why? It is RAII class.
Need to add comment, of course
There was a problem hiding this comment.
That's ok, we also call dtor for std::optional :)
Just one needless heap allocation ...
| * then it will be executed for a long time, because the result of the merge is not really needed immediately. | ||
| * It is better to merge small parts as soon as possible. | ||
| */ | ||
| class MergeTask |
There was a problem hiding this comment.
Well, we should find some way how to improve this code.
It is mainly only moved code, but now it became a little bit unreadable.
We can kind of leave it that way, but it will be a tech depth. I am ok if we have another one following pr with it.
A couple of ideas what to do:
- constructor has a lot of params - maybe group them into one or several structs, also add comment to them
- there are several states and according functions, but prev variables from stack are now all together. maybe we could create separate struct for each stage, which is alive only while stage is being executed
- also maybe replace enum with stages to an array of member functions + current index - because we execute them in order.
There was a problem hiding this comment.
BTW MutateTask looks more readable
|
Some tests become flaky after my changes or this PR contains a bug. Nevertheless I merge it and will fix all issues ASAP. Because I don't want to resolve conflicts every day. |
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Changelog category:
Changelog entry:
Added an ability to suspend and resume a process of a merge. This is needed for a better scheduling and controlling of merges execution. #22381