You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/09/15 23:54:07 UTC

[GitHub] [geode] boglesby commented on a change in pull request #5509: GEODE-8491: Do not store dropped events in stopped primary gateway se…

boglesby commented on a change in pull request #5509:
URL: https://github.com/apache/geode/pull/5509#discussion_r489081453



##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySender.java
##########
@@ -1118,6 +1115,17 @@ public void distribute(EnumListenerEvent operation, EntryEventImpl event,
     }
   }
 
+  private void recordDroppedEvent(EntryEventImpl event) {
+    if (this.eventProcessor != null) {
+      this.eventProcessor.registerEventDroppedInPrimaryQueue(event);

Review comment:
       In ConcurrentParallelGatewaySenderEventProcessor.registerEventDroppedInPrimaryQueue instead of calling sendQueueRemovalMesssageForDroppedEvent to send a ParallelQueueRemovalMessage inline, can you call ParallelGatewaySenderQueue.addRemovedEvent and let the BatchRemovalThread handle sending the message?
   
   Something like:
   ```
   ...
   int bucketId = PartitionedRegionHelper.getHashKey((EntryOperation) droppedEvent);
   boolean isPrimary = prQ.getRegionAdvisor().getBucketAdvisor(bucketId).isPrimary();
   if (isPrimary) {
     long shadowKey = droppedEvent.getTailKey();
     ParallelGatewaySenderQueue pgsq = (ParallelGatewaySenderQueue) cpgsq.getQueueByBucket(bucketId);
     pgsq.addRemovedEvent(prQ, bucketId, shadowKey);
     this.sender.getStatistics().incEventsDroppedDueToPrimarySenderNotRunning();
   ...
   ``
   I didn't try this, but it seems like it should work.
   
   I'm not sure if the same idea would work for SerialGatewaySenderEventProcessor.sendBatchDestroyOperationForDroppedEvent since it has a different implementation.
   
   btw - sendQueueRemovalMesssageForDroppedEvent has an extra 's'.
   




----------------------------------------------------------------
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:
users@infra.apache.org