Skip to content

Resolve the 26.7 cherry-pick conflicts of #112942 - #121593

Merged
PedroTadim merged 16 commits into
ClickHouse:backport/26.7/112942from
groeneai:groeneai/cherrypick-26.7-112942-resolved
Sep 29, 2026
Merged

PedroTadim merged 16 commits into
ClickHouse:backport/26.7/112942from
groeneai:groeneai/cherrypick-26.7-112942-resolved

Conversation

@groeneai

Copy link
Copy Markdown
Collaborator

Related: #112942
Related: #113810
Related: #118802
Related: #119753
Related: #115986

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Fixed several cases when parallel replicas returned duplicated rows: distributed_aggregation_memory_efficient was ignored by the plan-based parallel replicas, so the buckets of the memory efficient merging arrived out of order and were merged twice; and a shard was read from all of its replicas although the data was not split between them, when the parallel replicas are not applicable to the query or when parallel_replicas_mode asks for the custom key filtering without parallel_replicas_custom_key.

Description

Conflict resolution for the auto-closed robot cherry-pick #113810, done the way cherry_pick.py does it, hence the base. One six-line region: keep the new settings argument, drop insertParallelReplicasSplit, added after the 26.7 cut.

Why 26.7 needs it. #118802 landed the bucket-order half of #114523, but alone it is inert: applyParallelReplicas.cpp still hard-codes memory_efficient_aggregation = false, because that visitor cannot see the optimization settings #112942 hands it. On cbe5200ad319 the test reds 7 of 20 runs with GroupingAggregatedTransform pushed bucket N twice; with the port, 20/20 clean.

Onto 26.7. Merging this alone opens no 26.7-facing PR: cherry_pick.py drops a closed cherry-pick PR before it would create one. Preferred, a fast-forward:

git fetch https://github.com/groeneai/ClickHouse groeneai/cherrypick-26.7-112942-resolved
git push origin FETCH_HEAD:cherrypick/26.7/112942

then reopen #113810; merging this PR first empties its diff and blocks it. The squash onto 26.7 conflicts in that region again, since #118802 rewrote it: keep its setProduceResultsInBucketOrder call and take the derived memory_efficient_aggregation from here, so 26.7 gets both. I built and tested that result; the numbers below are from it.

Commit 2 restores 04606's own earlier table-based body, because its subquery form dies on run 1 on the pristine tip: the pruned sum(y) leaves the shard fragment with no aggregate-state column, which the parallel-replicas read never adds. Upstream used that form until #111063 fixed it in master, five days after the cut; the 200000 keys and the out-of-order setting are preserved. If 26.7 should have #111063's +7/-1 hunk, that is a v26.7-must-backport label away.

No CI here: this base matches neither workflow's branch filter. The 26.7-facing PR does.

Validation, all local, per-arm Build-ID and server identity asserted (click to expand)

The resolved applyParallelReplicas.cpp is byte-identical to master's own copy at #112942's fix commit 7a902aec5b1f6, because 26.7's copy equals master's at that commit's parent, so the resolution diverges from upstream by zero bytes. The other four source files and all three tests auto-merge clean. cherry_pick.py:300-306 discards a closed cherry-pick PR before create_backport(); ReadFromParallelReplicas.cpp:197 hard-codes the add_agg_info = false that costs 04606 its subquery form.

Arms are git commit-trees on the 26.7 tip cbe5200ad319, so HEAD^{tree} certifies each. The last row is git merge-tree --write-tree --merge-base fafdfd835ab9c cbe5200ad319 <this head> with its single conflict resolved, i.e. what the release step produces.

arm 04606 04605 04607 04669
pristine tip 7 FAIL / 20 3 FAIL / 20 not on the branch not on the branch
tip + the resolved region only 2 FAIL / 20 4 FAIL / 20 0 OK / 10 0 OK / 10
tip + the full port 20/20, and 50/50 in one batch 20/20 10/10 10/10

Every failure above is Logical error: 'GroupingAggregatedTransform pushed bucket N twice', N varying per run. The dying query is pinned by query id: initial INSERT INTO res SELECT x, sum(y) FROM d GROUP BY x at stage Complete, shard fragment at stage WithMergeableState, and zero Shuffle/Scatter/Exchange lines for it, so this is the parallel-replicas route, not the distributed-plan one #116446 fixed.

Randomization was live throughout (87 to 187 settings per query), and 21 of the 71 recorded runs on the last arm used the runner's automatic_parallel_replicas_mode = 2 bundle, the route the partial arm still failed on; all green. That middle row is why the port has to go in whole: 04607 and 04669 need the four source files besides the conflicted one.

nickitat and others added 16 commits August 1, 2026 18:12
…enabled

`applyParallelReplicas` created the `MergingAggregatedStep` which merges the
partially aggregated data of the replicas with a hardcoded
`memory_efficient_aggregation = false`, while the path it replaced,
`Planner::addMergingAggregatedStep`, obeys `distributed_aggregation_memory_efficient`
and lists `parallel_replicas_from_merge_tree` among the cases where it applies.

It is not only about the memory. The ordinary `MergingAggregatedTransform` reads
all the buckets before it returns anything, and it returns them in the order
produced by `Aggregator::convertToChunks`, where the buckets of a two level
result are converted by a thread pool, every thread collects the buckets it took
into its own list, and the lists are spliced together at the end. So the buckets
come out in an arbitrary order.

A shard of a `Distributed` table can read its local table with parallel replicas
(`ClusterProxy::executeQuery` keeps them enabled for the shards of a cluster
which has more than one replica per shard), and then it sends the merged result
to the initiator, which merges it memory efficiently. Buckets arriving out of
order there make the initiator merge and output the same bucket twice, and the
result contains duplicated keys.

The bug does not need the buckets to be produced out of order, so
`enable_producing_buckets_out_of_order_in_aggregation` is disabled in the test.
The thread pool in `Aggregator::prepareChunksAndFillTwoLevelImpl` is used only
for more than 100000 keys, so the test has 200000 of them. Without the fix the
test reports about 46000 duplicated keys and fails in every run.

Memory efficient merging is not supported for grouping sets, so it stays
disabled for them.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01BAZjq1jL3wNACqVQzocPoT
…not applicable

`ReadFromRemote` establishes a connection per replica of a shard (`PoolMode::GET_MANY`)
unless parallel reading from replicas is used or the `enable_parallel_replicas`
setting is 0. But a replica executes the whole query unless it is given a part of
the data to read, and only the offset based modes (`SAMPLING_KEY`,
`CUSTOM_KEY_SAMPLING`, `CUSTOM_KEY_RANGE`) do that, by sending a filter along with
the query. `ParallelReplicasMode::READ_TASKS` does it with the coordinator, and for
that a single connection per shard is needed, which is why it is handled separately.

`Context::canUseTaskBasedParallelReplicas` returns false not only when the setting
is 0, but also because of `automatic_parallel_replicas_mode`,
`parallel_replicas_only_with_analyzer` and `max_parallel_replicas`. In those cases
the query was still sent to every replica of a shard, every one of them read all of
its data, and the result of the shard was multiplied by the number of the replicas.

    SELECT count(), sum(y) FROM d SETTINGS enable_parallel_replicas = 1,
        max_parallel_replicas = 3, automatic_parallel_replicas_mode = 2

returned 6000, 2997000 instead of 2000, 999000 for a cluster of 2 shards holding
1000 rows each. With `distributed_aggregation_memory_efficient` the duplicated
partially aggregated results also arrive at the initiator as several complete
sequences of two-level buckets on a single input port, which the memory efficient
merging cannot handle, so the keys were duplicated as well.

Now several connections to a shard are used only when they read different parts of
the data, i.e. only for the offset based modes.

`automatic_parallel_replicas_mode` no longer has to be pinned in
04606_parallel_replicas_merging_aggregated_bucket_order.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01BAZjq1jL3wNACqVQzocPoT
`04606` wrote the result of the aggregation into a table, because such a query
could not be used as a subquery: it failed with `Chunk should have
AggregatedChunkInfo in MergingAggregatedTransform`. That is fixed in master,
which is merged here, so the query is a subquery again and the table is gone.

Both tests drop their tables in the prologue and in the epilogue now. Every test
gets its own database (`tests/clickhouse-test` creates `test_<random>` per test
and drops it afterwards), so this is not needed for the isolation, but it is what
most of the tests around do.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01BAZjq1jL3wNACqVQzocPoT
`04603_pr_plan_based_view_no_view_flag`, `04604_pr_plan_based_force_index_view`
and `04605_pr_plan_based_count_distinct_serialized` are named after the feature
they test, and this test belongs to the same group.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01BAZjq1jL3wNACqVQzocPoT
`parallel_replicas_mode` can ask for the custom key filtering while
`parallel_replicas_custom_key` is not set. Every replica reads only the
part of the data its filter selects, so without the key every replica
reads everything and the result of the shard is multiplied by the number
of the replicas.

The initiator builds the filter itself only for a cluster with a single
shard, and it already failed there, because `parseCustomKeyForTable`
cannot parse the empty key. Otherwise the filter is built by every
replica, and `buildCustomKeyFilterIfNeeded` returned no filter silently
for the empty key, so a query to a cluster with several shards returned
every row as many times as there are replicas.

Check the key in `parseCustomKeyForTable`, so that every caller fails the
same way, and with the message about the missing custom key instead of a
syntax error. An empty filter means a missing key and nothing else: a key
that parses always produces a filter, and `parseCustomKeyForTable` throws
rather than returns nothing for a key that does not parse.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BAZjq1jL3wNACqVQzocPoT

Assert that the custom key is parsed into something

`parseCustomKeyForTable` either parses the key or throws, so the check
for the missing result was never true and its message about the missing
custom key was unreachable. The message is reported by
`parseCustomKeyForTable` itself now, keep the expectation as an assert.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BAZjq1jL3wNACqVQzocPoT
`parallel_replicas_for_non_replicated_merge_tree` is about the task based
parallel replicas: the replicas read the parts the coordinator assigns to
them, and that needs the same parts on every replica. The old analyzer
disabled the parallel replicas for a plain `MergeTree` table whenever the
setting is not set, no matter the mode, and that also disabled building
the filter by the custom key, which is built by the same interpreter.

The initiator has already sent the query to every replica of the shard by
then, so every replica read the whole table and the result of the shard
was multiplied by the number of the replicas. A query without the custom
key did not report the missing key either, because the code that reports
it was not reached.

Check the mode, the same way the check for FINAL right above it does. The
analyzer does not disable the filtering here, so both of them behave the
same way now.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BAZjq1jL3wNACqVQzocPoT
`parseCustomKeyForTable` either parses the key or throws, it never returns
nothing, so the branch that reports the missing custom key when it returns
nothing was never taken. It reported the key of a replica with an offset
only, which left the first replica reading the whole table silently. The
missing key is reported by `parseCustomKeyForTable` itself now, for every
replica, keep the expectation as an assert.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BAZjq1jL3wNACqVQzocPoT
JOINs are not supported with the custom key, and the old analyzer dropped
the custom key for them, promising in the log message that the query is
executed without the parallel replicas. It is not what dropping the key
does: the parallel replicas stay enabled, the initiator still sends the
query to every replica of the shard, and the replicas are left without
anything to split the data by, so every one of them reads the whole table
and the result of the shard is multiplied by the number of the replicas.

Disable the parallel replicas instead, the way the checks for FINAL and
for a plain `MergeTree` next to it do. The analyzer executes such queries
without the parallel replicas as well, and both of them return the same
result now.

Reported by review of ClickHouse#112942.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BAZjq1jL3wNACqVQzocPoT
The table of the test is a plain `MergeTree`, and the parallel replicas
are not used for it unless `parallel_replicas_for_non_replicated_merge_tree`
is set. The initiator still sends the query to every replica of the shard,
so the missing custom key has to be reported, but the test depended on the
replicas keeping the parallel replicas enabled to report it. Ask for them
explicitly, so that the test checks the missing key on its own.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BAZjq1jL3wNACqVQzocPoT
The setting says that the query is executed locally when the analyzer is
disabled, and it is set by default, but it does not stop the initiator
from sending the query to every replica of the shard. Only the filter by
the custom key keeps the result of such a query correct, and the replicas
dropped that filter for a plain `MergeTree` table, so the result was
multiplied by the number of the replicas with either value of the setting.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BAZjq1jL3wNACqVQzocPoT
The replicas of the cluster of the test are the same server, so the other
queries return the same numbers whether a shard is read by one replica or
by all of them, and they check the result alone. The query without the
custom key is the only one that needs the parallel replicas to be used to
get its result, and it relied on them being used for a plain `MergeTree`
without `parallel_replicas_for_non_replicated_merge_tree`. Ask for them,
so that the check does not depend on that.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BAZjq1jL3wNACqVQzocPoT
…licas-duplicate-keys

Fix a few cases when parallel replicas might return duplicate rows in the output
The robot cherry-pick of ClickHouse#112942 into 26.7 (ClickHouse#113810) came out conflicting and
was auto-closed after seven idle days without anyone resolving it. Eight hours
later the 26.7 backport of ClickHouse#112794 landed the "Bucket N is pushed twice"
assert and test 04605 on the branch, so 26.7 now asserts an invariant whose
fix it never received.

ClickHouse#112942 makes the per-shard replica merge that `applyParallelReplicas`
inserts obey `distributed_aggregation_memory_efficient`. Without it that merge
always takes the `!memory_efficient_aggregation` branch of
`MergingAggregatedStep::transformPipeline`, which resizes the pipeline to one
stream and uses the plain `MergingAggregatedTransform`. That transform emits
two-level buckets in `Aggregator::convertToChunks` order and never consults
`should_produce_results_in_order_of_bucket_number`, so a shard that promised
the initiator ascending bucket order breaks its own promise. The initiator's
memory-efficient merge then trips
`chassert(bucket < 0 || pushed_buckets.insert(bucket).second)` in debug and
sanitizer builds, and returns duplicated aggregation keys in release builds.

Merging `backport/26.7/112942` into `cherrypick/26.7/112942` conflicts in one
file, `applyParallelReplicas.cpp`, in one six-line region: master passes the
new `settings` argument to the visitor and calls
`insertParallelReplicasSplit(query_plan, nodes)` before it, a function added
to master after 26.7 was cut. The resolution keeps the `settings` argument and
drops the `insertParallelReplicasSplit` call.

The resolved file is byte-identical to master's own copy at the fix commit
7a902ae (blob 74365cc), because 26.7's
copy equals master's copy at that commit's parent. The resolution therefore
diverges from upstream by zero bytes. The other four source files and all
three new tests auto-merge clean.

(cherry picked from commit 0793ca6)
04606 asserts that a shard of a `Distributed` table which merges the partially
aggregated results of its parallel replicas hands the initiator the two-level
buckets in ascending bucket id order, so the initiator's memory-efficient merge
does not merge and output the same bucket twice. It measures that as
`count() - uniqExact(x)` over 200000 groups, which has to be `0`.

Upstream computes the aggregation in a subquery. On this branch the same query
kills the server before it reaches the assertion:

    Logical error: 'Chunk should have AggregatedChunkInfo in
    MergingAggregatedTransform.' (MergingAggregatedTransform.cpp:239)

    Logical error: 'Chunk should have AggregatedChunkInfo/ChunkInfoWithAllocatedBytes
    in GroupingAggregatedTransform.' (MergingAggregatedMemoryEfficientTransform.cpp:369)

on run 1, against a pristine 26.7 tip with none of this branch applied. The
outer query consumes only `x`, so `sum(y)` is pruned from the shard-side
fragment and its header carries no aggregate state column.
`ReadFromParallelReplicas.cpp:197` hard-codes `add_agg_info = false`, and the
only other way that flag is set is the auto-detection in `RemoteSource`'s
constructor (`RemoteSource.cpp:29-33`), which looks for a
`DataTypeAggregateFunction` column in the header. So no `AggregatedChunkInfo` is
attached and the merge throws. Master fixed that in ClickHouse#111063
(`36966297cd1696a`), merged five days after this branch was cut.

The test is healthy upstream: 12348 runs and 0 failures on master over the last
30 days. It is this branch that cannot run the shape, not the test that is
flaky.

Upstream itself wrote the test this way first. `7a902aec5b1f6` introduced it
writing the result into a `Memory` table, with the comment "at the moment such a
query cannot be used as a subquery", and `bcd47d843620` converted it to a
subquery only once master had the fix: "it failed with `Chunk should have
AggregatedChunkInfo in MergingAggregatedTransform`. That is fixed in master,
which is merged here, so the query is a subquery again and the table is gone."
This commit reverts that one transformation and keeps the rest of it, including
the drop hygiene.

The coverage is unchanged. 200000 keys keep the buckets of the two-level result
being converted by a thread pool, which is what returns them in an arbitrary
order, and `enable_producing_buckets_out_of_order_in_aggregation = 0` keeps the
producer from reporting them as delayed. The reference stays `0`.

Co-Authored-By: Claude Opus 5 <[email protected]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-request PR origin: a maintainer pinged or directed groeneai labels Sep 22, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review

An independent model reviewed the resolved tree cold against the base backport/26.7/112942
(diff 11 files, +185/-54: #112942's own paths plus one test tweak). It raised 3 findings. All 3 are
about #112942's design and tests as they stand on master, not about the transport, so none is
actionable in a cherry-pick: acting on any of them would make 26.7 behave or test differently from
master, which is the one thing a backport must not do.

❌ Strict mode for parallel_replicas_custom_key with a JOIN (raised as a blocker). In the old
analyzer, InterpreterSelectQuery.cpp disables parallel replicas for setting values 1 and 2 alike,
while the analyzer throws SUPPORT_IS_DISABLED for 2. The asymmetry is real, and it is master's: that
block is byte-identical on this branch, on master at #112942's merge commit, and on master today, and
the added and removed lines of the hunk are line for line #112942's own. Mirroring the throw here
would make 26.7 reject a query that master and 26.8 accept. Worth a master PR, not this one.

⚠️ 04606 does not pin automatic_parallel_replicas_mode, and value 2 makes the plan-based route
decline, so some randomized runs cannot fail. Measured rather than assumed: the test still reds 7 of
20 runs on the pristine tip, and 04605 reds 3 of 20, against 20/20 and 50/50 with the port, so the
oracle is live and that setting only costs sensitivity. The setting occurs zero times in this test on
master too, and the SETTINGS block here is byte-identical to master's, so the observation belongs to
master's copy.

⚠️ The old-analyzer custom-key hunks are not covered by the added tests (04669 uses the default
analyzer, 04607 disables it only for the task-based mode). Both files are byte-identical to master's,
so that gap is master's as well. What this branch relies on instead is transport fidelity, which is
the stronger property: the added and removed line sets of this diff equal upstream's exactly for all
five source files, applyParallelReplicas.cpp differing in context lines only, so a mis-transported
hunk is excluded by construction. I did not rebuild to confirm the reviewer's claim that reverting
those hunks leaves the tests green.

⚠️ Adjudicated earlier and folded into the description: the further resolution the 26.7 squash needs
was named but not specified, and resolving it toward this branch would delete #118802's
setProduceResultsInBucketOrder call. The description now says which side each half comes from.

💡 Noted, not changed: the comment blocks in the source diff are upstream's own text, so they stay
as they are.

@clickhouse-gh clickhouse-gh Bot closed this Sep 22, 2026
@clickhouse-gh clickhouse-gh Bot reopened this Sep 22, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes, on demand. On the pristine 26.7 tip cbe5200ad319, 04606 in its table form fails 7 of 20 runs and 04605 3 of 20, always Logical error: 'GroupingAggregatedTransform pushed bucket N twice'. Not a 1% event.
b Root cause explained? Yes. applyParallelReplicas.cpp:82 on 26.7 hard-codes memory_efficient_aggregation = false, so MergingAggregatedStep takes its non memory-efficient branch and the plain MergingAggregatedTransform emits two-level buckets in Aggregator::convertToChunks order, ignoring should_produce_results_in_order_of_bucket_number. The shard had promised the initiator ascending bucket order, so the initiator's memory-efficient merge sees a bucket twice.
c Fix matches root cause? Yes, and it is upstream's own: #112942 gives the visitor the optimization settings and derives the flag from distributed_aggregation_memory_efficient. Nothing is widened, tagged or reduced; the single conflicted region resolves to text byte-identical to master's.
d Test intent preserved / new tests added? Yes. The port ships #112942's three tests. The second commit restores 04606's own earlier table-based body so it can execute on this branch, preserving the 200000 keys and enable_producing_buckets_out_of_order_in_aggregation = 0 verbatim and leaving the reference at 0; that restored form is what reds 7/20 on the pristine tip, so the coverage is demonstrated.
e Both directions demonstrated? Yes, on Build-ID-verified binaries with SELECT lower(buildId()) asserted against readelf per arm: pristine tip 7 FAIL / 20, tree with the port 20/20 plus 50/50 in one --test-runs 50 batch, 04605 20/20, 04607 10/10, 04669 10/10.
f Fix is general across code paths? The transported change is upstream's whole fix, all five source files; the four besides the conflicted one are what make 04607 and 04669 pass (0 OK / 10 without them, 10/10 with them, measured). No guard was added at a symptom site.
g Fix generalizes across inputs (params/datatypes/wrappers)? The port's own tests cover the plan-based route, the result-duplication case and the custom-key case, and randomization was live in every run (87 to 187 settings per query), including the runner's automatic_parallel_replicas_mode = 2 bundle in 21 of 71 recorded runs. A cherry-pick introduces no new type surface.
h Backward compatible? No setting defaults, no new settings, no format change, so no SettingsChangesHistory.cpp implication. One behaviour change rides in upstream's fix and is upstream's decision: an empty parallel_replicas_custom_key with parallel_replicas_count > 1 now raises BAD_ARGUMENTS instead of silently reading everything. #112942 ships 04669 for it; 10/10 here.
i Invariants and contracts preserved? The invariant is that a memory-efficient two-level merge is fed by inputs promised to emit buckets in ascending order. Its other carrier is already on 26.7 via #118802 and the resolution preserves that setter verbatim; asserted mechanically on the resolved file: exactly one const bool memory_efficient_aggregation, derived from optimization_settings, the visitor constructed with (..., nodes, settings), insertParallelReplicasSplit count 0, and the two-argument ParallelReplicasSplitStep kept.

Session id: cron:clickhouse-impl-slot-6:20260913-221100

@PedroTadim

Copy link
Copy Markdown
Member

Ok, let's merge to finish the backport

@PedroTadim
PedroTadim merged commit 68e3a87 into ClickHouse:backport/26.7/112942 Sep 29, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

Thanks. The robot will not open the 26.7 PR from here: it only does that after the cherry-pick PR from cherrypick/26.7/112942 merges (cherry_pick.py L292-298), and it treats the closed #113810 as discarded, both in the normal pass (L300-306) and in the recovery of stranded backport/* branches (L1157-1175).

So the last step is manual: squash backport/26.7/112942 into one commit, as create_backport() does (L668-682), and open the PR to 26.7. Unsquashed, the branch is 7191 commits ahead of 26.7, 7173 of them master history from the -s ours merge. I cannot do it (no push access, and I do not open PRs against release branches). Could you do that step?

On today's 26.7 the squash conflicts in one hunk of applyParallelReplicas.cpp, and neither side is right: #118802 moved const bool memory_efficient_aggregation = false; up, above the marker. Drop the incoming declaration and give the moved one master's value, optimization_settings.distributed_aggregation_memory_efficient && grouping_sets_params.empty() && !aggregating_step->getOutputHeader()->has("__grouping_set"). That is the resolution I tested (numbers in the description); the other 10 files merge cleanly.

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

Labels

can be tested Allows running workflows for external contributors comp-parallel-replicas Parallel reading from replicas for query speed (not data replication consistency). groeneai-origin-request PR origin: a maintainer pinged or directed groeneai

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants