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


##########
be/src/exec/runtime_filter/runtime_filter_merger.h:
##########
@@ -58,7 +58,17 @@ class RuntimeFilterMerger : public RuntimeFilter {
 
     // If input is a disabled predicate, the final result is a disabled 
predicate.
     // Returns true only for the call that makes the merger ready.
-    Status merge_from(const RuntimeFilter* other, bool* ready) {
+    //
+    // `other_wrapper_exclusively_owned` must be true only when the caller 
guarantees `other`'s
+    // wrapper has no other reader and will not be read again after this call 
(e.g. a producer
+    // whose wrapper is never signaled to a plain local consumer, or an 
RPC-only filter built
+    // solely to carry one merge request). The merger then takes the wrapper 
over directly
+    // instead of paying for a deep copy. It must stay false whenever 
`other`'s wrapper may still
+    // be used by consumers in local RF mgr of the same instance, or is shared 
by all producers of
+    // a broadcast join with a shared hash table: the merger must never write 
such a wrapper, so
+    // it only merges into its own copy.
+    Status merge_from(const RuntimeFilter* other, bool* ready,
+                      bool other_wrapper_exclusively_owned = false) {

Review Comment:
   [P2] Use the new ownership path for local remote-target filters that have no 
reader. For a non-broadcast BLOOM or IN_OR_BLOOM filter with 
`has_remote_targets=true` and `build_bf_by_runtime_size=false` (for example, 
sync size disabled), `RuntimeFilterProducer::publish()` calls `do_merge()` 
without this flag. This branch signals no local consumer, has no size callback, 
and drops the producer wrapper after its local merge. A first Bloom arrival is 
therefore deep-cloned in `merge_from()`; an IN arrival followed by a Bloom also 
deep-clones the later directory in `RuntimeFilterWrapper::merge()`. Both copies 
allocate and scan the full directory under producer and merger locks. The 
existing threads concern the global RPC receiver; this is the earlier 
producer-to-local-merger copy. Pass exclusive ownership for the proven 
no-reader/no-callback local path, retaining copies when consumers or callbacks 
can still access the producer wrapper.



-- 
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