Repository navigation
New parallel replicas coordinator implementation - #57968
Conversation
|
This is an automated comment for commit 98337ff with description of existing statuses. It's updated for the latest CI running ❌ Click here to open a full report in a separate page Successful checks
|
13b24db to
8a918ce
Compare
9306244 to
891357a
Compare
| { | ||
| auto result = extension.callback(ParallelReadRequest( | ||
| CoordinationMode::Default, | ||
| coordination_mode, |
There was a problem hiding this comment.
It seems the same but done differently. Not clear, what's the point?
There was a problem hiding this comment.
initially I planned to choose between old and new based on settings. that is what's left from this code
| /// Parts view from the first announcement we received | ||
| std::vector<Part> all_parts_to_read; | ||
|
|
||
| std::unordered_map<std::string, std::unordered_set<size_t>> part_visibility; /// part_name -> set of replicas announced that part |
There was a problem hiding this comment.
Shouldn't MergeTreePartInfo be used as a key instead of a string id created from it?
There was a problem hiding this comment.
it could make sense to avoid calling getName(), but the hash table itself would store heavier objects. in short, I don't think it matters
|
Still need to check details but some notes: |
| void handleInitialAllRangesAnnouncement(InitialAllRangesAnnouncement announcement) override; | ||
| void markReplicaAsUnavailable(size_t replica_number) override; | ||
| /// For some ranges their owner and stealer (by consistent hash) cannot read from the given part at all. So this range have to be stolen anyway. | ||
| /// Also if those replicas unavailable during the query - segments also will end up here. |
There was a problem hiding this comment.
The comment is misleading. If a part is in set, then a replicas announced it. If the replica becomes unavailable after announcement - currently, the query fails.
devcrafter
left a comment
There was a problem hiding this comment.
In general, It'd make sense to check that the working set is completely covered by ranges sent to replicas. Probably, it can be disabled in release
| { | ||
| if (!part_visibility[segment.info.getPartNameV1()].contains(replica_num)) | ||
| { | ||
| chassert(segment.ranges.size() == 1); |
There was a problem hiding this comment.
Don't get it, how it's guaranteed?
There was a problem hiding this comment.
we always insert RangesInDataPartDescription consisting of an individual segment into these queues. see enqueueSegment
maybe, but it won't be always true. e.g. when we have |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Default coordinator for parallel replicas is rewritten for better cache locality (same mark ranges are almost always assigned to the same replicas). Consistent hashing is used also during work stealing, so better tail latency is expected.
It has been tested for linear scalability on a hundred of replicas.