github-actions[bot] commented on code in PR #68684:
URL: https://github.com/apache/doris/pull/68684#discussion_r4217264097


##########
be/src/exec/runtime_filter/runtime_filter_producer.cpp:
##########
@@ -75,13 +75,21 @@ Status RuntimeFilterProducer::publish(RuntimeState* state, 
bool build_hash_table
     if (!_has_remote_target) {
         // A runtime filter may have multiple targets and some of those are 
local-merge RF and others are not.
         // So for all runtime filters' producers, `publish` should notify all 
consumers in global RF mgr which manages local-merge RF and local RF mgr which 
manages others.
-        RETURN_IF_ERROR(do_merge());
+        // The merger never writes this wrapper (see 
`RuntimeFilterMerger::merge_from`), so the
+        // consumers in local RF mgr can use it right away while the merge of 
the other
+        // producers goes on.
+        RETURN_IF_ERROR(do_merge(/*other_wrapper_exclusively_owned=*/false));

Review Comment:
   [P2] Avoid the full Bloom clone in the local-only merge cases that need no 
isolation. With a non-broadcast filter, `build_bf_by_runtime_size=false`, and 
only a local-shuffle consumer in the global RF manager, no plain local consumer 
or size callback can read this producer's wrapper, so the merger can adopt it. 
A separate case has exactly one registered producer: `merge_from()` marks the 
merger ready on its first arrival and rejects further arrivals, so the 
completed wrapper can be shared even if a plain local consumer exists. This 
unconditional `false` makes `clone()` allocate, zero and OR-copy up to the 
default 64 MiB Bloom directory under producer and merger locks in both cases. 
Use ownership transfer for the no-reader case and read-only sharing for the 
single-producer case; keep the copy for multiple producers with plain readers. 
The existing threads cover remote-target and RPC inputs; these are local-only 
paths.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to