[ 
https://issues.apache.org/jira/browse/GEODE-8559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17205865#comment-17205865
 ] 

ASF GitHub Bot commented on GEODE-8559:
---------------------------------------

DonalEvans commented on a change in pull request #5581:
URL: https://github.com/apache/geode/pull/5581#discussion_r498515234



##########
File path: 
geode-core/src/main/java/org/apache/geode/internal/cache/FilterProfile.java
##########
@@ -1126,27 +1126,75 @@ public FilterRoutingInfo 
getFilterRoutingInfoPart1(CacheEvent event, Profile[] p
    */
   public FilterRoutingInfo getFilterRoutingInfoPart2(FilterRoutingInfo 
part1Info,
       CacheEvent event) {
+    return getFilterRoutingInfoPart2(part1Info, event, false);
+  }
+
+  public FilterRoutingInfo getFilterRoutingInfoPart2(FilterRoutingInfo 
part1Info,
+      CacheEvent event, boolean computeInterestRoutingInfo) {
     FilterRoutingInfo result = part1Info;
     if (localProfile.hasCacheServer) {
       // bug #45520 - CQ events arriving out of order causes result set
       // inconsistency, so don't compute routings for events in conflict
       boolean isInConflict =
           event.getOperation().isEntry() && ((EntryEventImpl) 
event).isConcurrencyConflict();
       CqService cqService = getCqService(event.getRegion());
-      if (!isInConflict && cqService.isRunning()
-          && this.region != null /*
-                                  * && !( 
this.region.isUsedForPartitionedRegionBucket() || //
-                                  * partitioned region CQ this.region 
instanceof PartitionedRegion)
-                                  */) { // processing is done in part 1
+      if (!isInConflict && cqService.isRunning() && region != null) {
         if (result == null) {
           result = new FilterRoutingInfo();
         }
         if (logger.isDebugEnabled()) {
           logger.debug("getting local cq matches for {}", event);
         }
-        fillInCQRoutingInfo(event, true, NO_PROFILES, result);
+        setLocalCQRoutingInfo(event, result);
       }
+      result = setLocalInterestRoutingInfo(event, result, 
computeInterestRoutingInfo);
+    }
+    return result;
+  }
+
+  void setLocalCQRoutingInfo(CacheEvent event, FilterRoutingInfo result) {
+    if (isCQRoutingNeeded(event)) {
+      fillInCQRoutingInfo(event, true, NO_PROFILES, result);
+    } else {
+      result.setLocalFilterInfo(getLocalFilterInfo(event));
+    }
+  }
+
+  boolean isCQRoutingNeeded(CacheEvent event) {
+    if (!isTransactionalEvent(event)) {
+      return true;
+    }
+    FilterInfo localFilterInfo = getLocalFilterInfo(event);
+    if (localFilterInfo != null) {
+      return false;
+    }
+    return true;

Review comment:
       This can be simplified to `return localFilterInfo == null;`




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> A race could occur during interest registration combined with transactional 
> operations
> --------------------------------------------------------------------------------------
>
>                 Key: GEODE-8559
>                 URL: https://issues.apache.org/jira/browse/GEODE-8559
>             Project: Geode
>          Issue Type: Bug
>          Components: client queues, transactions
>    Affects Versions: 1.1.0
>            Reporter: Eric Shu
>            Assignee: Eric Shu
>            Priority: Major
>              Labels: pull-request-available
>
> During client interest registration, a region snapshot is taken from server 
> and entry operations after the registration should be sent to client via 
> Region queue.
> There is a race in transaction implementation. Interested client computation 
> is occurred before the transactional operations is applied to the cache 
> during commit. This could lead to client does not get the operations through 
> region snapshot taken, and the transactional operation is not being sent to 
> the client (as the interested clients were computed before hand.)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to