[jira] [Commented] (GEODE-4659) AbstractGatewaySenderEventProcessor put loop of filter in wrong place

2018-02-14 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on GEODE-4659:


Commit de7c6d8b4a9b3e2c1c0ebd4ce1835aff0007f9e1 in geode's branch 
refs/heads/develop from zhouxh
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=de7c6d8 ]

GEODE-3967: There're following 9 problems fixed here:
1) When ConcurrentCacheModificationException happened, GatewaySenderEventImpl
 should save the status and notify gatewaysender if it hold primary queue,
because other member might have put the event into the secondary queue.
2) In AbstractUpdateOperation's doPutOrCreate's 3 tries of basicUpdate, the
3rd try should allow both create and update.
3) Let event with CME not to dispatch. The old logic does not allow CME event
to  enqueue. This is wrong, because an event without CME might have been
added into the secondary queue. So we should enqueue it, but not to dispatch.
4) Let UPDATE_VERSION_STAMP not to enqueue if not primary queue, because
the event did not fire in pair.
5) AbstractGatewaySenderEventProcessor put loop of filter in wrong place,
which caused UPDATE_VERSION_STAMP and CME events are not ignored.
However, not to fix it for now. Leave it in GEODE-4659.
6) shouldSendVersionEvents for Remote sender should return true, since
we no longer support 7.0.1 any more.
7) change version to 150
8) CME event should not retry in AUO.doPutOrCreate, because retry will end up 
with CME too.
9) CME && !originRemote: only enqueue to primary

This closes #1317


> AbstractGatewaySenderEventProcessor put loop of filter in wrong place
> -
>
> Key: GEODE-4659
> URL: https://issues.apache.org/jira/browse/GEODE-4659
> Project: Geode
>  Issue Type: Bug
>  Components: wan
>Reporter: xiaojian zhou
>Assignee: xiaojian zhou
>Priority: Major
>
> {noformat}
> When fixing GEODE-3967, I found the loop of filter is in wrong place. 
>  
> If there's no filter defined, the processing  to ignore UPDATE_VERSION_STAMP 
> and events with CME should have nothing to do with filters. But if there's no 
> filter defined, the code will not ignore the UPDATE_VERSION_STAMP and events 
> with CME.
>  
> However, if fixed this problem. the GEODE-3967 have more race conditions to 
> be fixed. (I have fixed several of them). It looks like this bug hided other 
> race conditions from blowing out. 
>  
> GIving the time constrain, I will not fix the filter issue in GEODE_3967 and 
> log this bug for future reference. 
>  
> Here are the diff to fix or this bug:
> diff --git 
> a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/RemoteParallelGatewaySenderEventProcessor.java
>  
> b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/RemoteParallelGatewaySenderEventProcessor.java
> index 8739a8f72..a3a89fbd0 100644
> --- 
> a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/RemoteParallelGatewaySenderEventProcessor.java
> +++ 
> b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/RemoteParallelGatewaySenderEventProcessor.java
> @@ -81,40 +81,8 @@ public class RemoteParallelGatewaySenderEventProcessor 
> extends ParallelGatewaySe
>     * @param disp
>     * @return true if remote site Gemfire Version is >= 7.0.1
>     */
> -  private boolean shouldSendVersionEvents(GatewaySenderEventDispatcher disp)
> -      throws GatewaySenderException {
> -    try {
> -      GatewaySenderEventRemoteDispatcher remoteDispatcher =
> -          (GatewaySenderEventRemoteDispatcher) disp;
> -      // This will create a new connection if no batch has been sent till
> -      // now.
> -      Connection conn = remoteDispatcher.getConnection(false);
> -      if (conn != null) {
> -        short remoteSiteVersion = conn.getWanSiteVersion();
> -        if (Version.GFE_701.compareTo(remoteSiteVersion) <= 0) {
> -          return true;
> -        }
> -      }
> -    } catch (GatewaySenderException e) {
> -      Throwable cause = e.getCause();
> -      if (cause instanceof IOException || e instanceof 
> GatewaySenderConfigurationException
> -          || cause instanceof ConnectionDestroyedException) {
> -        try {
> -          int sleepInterval = GatewaySender.CONNECTION_RETRY_INTERVAL;
> -          if (logger.isDebugEnabled()) {
> -            logger.debug("Sleeping for {} milliseconds", sleepInterval);
> -          }
> -          Thread.sleep(sleepInterval);
> -        } catch (InterruptedException ie) {
> -          // log the exception
> -          if (logger.isDebugEnabled()) {
> -            logger.debug(ie.getMessage(), ie);
> -          }
> -        }
> -      }
> -      throw e;
> -    }
> -    return false;
> +  protected boolean shou

[jira] [Commented] (GEODE-4659) AbstractGatewaySenderEventProcessor put loop of filter in wrong place

2018-02-14 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on GEODE-4659:


Commit 5717053d08cdaa7ece96cb6c23905e444627dee3 in geode's branch 
refs/heads/feature/GEODE-3967 from zhouxh
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=5717053 ]

GEODE-3967: There're following 9 problems fixed here:
1) When ConcurrentCacheModificationException happened, GatewaySenderEventImpl
 should save the status and notify gatewaysender if it hold primary queue,
because other member might have put the event into the secondary queue.
2) In AbstractUpdateOperation's doPutOrCreate's 3 tries of basicUpdate, the
3rd try should allow both create and update.
3) Let event with CME not to dispatch. The old logic does not allow CME event
to  enqueue. This is wrong, because an event without CME might have been
added into the secondary queue. So we should enqueue it, but not to dispatch.
4) Let UPDATE_VERSION_STAMP not to enqueue if not primary queue, because
the event did not fire in pair.
5) AbstractGatewaySenderEventProcessor put loop of filter in wrong place,
which caused UPDATE_VERSION_STAMP and CME events are not ignored.
However, not to fix it for now. Leave it in GEODE-4659.
6) shouldSendVersionEvents for Remote sender should return true, since
we no longer support 7.0.1 any more.
7) change version to 150
8) CME event should not retry in AUO.doPutOrCreate, because retry will end up 
with CME too.
9) CME && !originRemote: only enqueue to primary


> AbstractGatewaySenderEventProcessor put loop of filter in wrong place
> -
>
> Key: GEODE-4659
> URL: https://issues.apache.org/jira/browse/GEODE-4659
> Project: Geode
>  Issue Type: Bug
>  Components: wan
>Reporter: xiaojian zhou
>Assignee: xiaojian zhou
>Priority: Major
>
> {noformat}
> When fixing GEODE-3967, I found the loop of filter is in wrong place. 
>  
> If there's no filter defined, the processing  to ignore UPDATE_VERSION_STAMP 
> and events with CME should have nothing to do with filters. But if there's no 
> filter defined, the code will not ignore the UPDATE_VERSION_STAMP and events 
> with CME.
>  
> However, if fixed this problem. the GEODE-3967 have more race conditions to 
> be fixed. (I have fixed several of them). It looks like this bug hided other 
> race conditions from blowing out. 
>  
> GIving the time constrain, I will not fix the filter issue in GEODE_3967 and 
> log this bug for future reference. 
>  
> Here are the diff to fix or this bug:
> diff --git 
> a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/RemoteParallelGatewaySenderEventProcessor.java
>  
> b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/RemoteParallelGatewaySenderEventProcessor.java
> index 8739a8f72..a3a89fbd0 100644
> --- 
> a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/RemoteParallelGatewaySenderEventProcessor.java
> +++ 
> b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/RemoteParallelGatewaySenderEventProcessor.java
> @@ -81,40 +81,8 @@ public class RemoteParallelGatewaySenderEventProcessor 
> extends ParallelGatewaySe
>     * @param disp
>     * @return true if remote site Gemfire Version is >= 7.0.1
>     */
> -  private boolean shouldSendVersionEvents(GatewaySenderEventDispatcher disp)
> -      throws GatewaySenderException {
> -    try {
> -      GatewaySenderEventRemoteDispatcher remoteDispatcher =
> -          (GatewaySenderEventRemoteDispatcher) disp;
> -      // This will create a new connection if no batch has been sent till
> -      // now.
> -      Connection conn = remoteDispatcher.getConnection(false);
> -      if (conn != null) {
> -        short remoteSiteVersion = conn.getWanSiteVersion();
> -        if (Version.GFE_701.compareTo(remoteSiteVersion) <= 0) {
> -          return true;
> -        }
> -      }
> -    } catch (GatewaySenderException e) {
> -      Throwable cause = e.getCause();
> -      if (cause instanceof IOException || e instanceof 
> GatewaySenderConfigurationException
> -          || cause instanceof ConnectionDestroyedException) {
> -        try {
> -          int sleepInterval = GatewaySender.CONNECTION_RETRY_INTERVAL;
> -          if (logger.isDebugEnabled()) {
> -            logger.debug("Sleeping for {} milliseconds", sleepInterval);
> -          }
> -          Thread.sleep(sleepInterval);
> -        } catch (InterruptedException ie) {
> -          // log the exception
> -          if (logger.isDebugEnabled()) {
> -            logger.debug(ie.getMessage(), ie);
> -          }
> -        }
> -      }
> -      throw e;
> -    }
> -    return false;
> +  protected boolean shouldSendVe

[jira] [Commented] (GEODE-4659) AbstractGatewaySenderEventProcessor put loop of filter in wrong place

2018-02-13 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on GEODE-4659:


Commit 974497c1da530e51569ed7965f2368e051894b98 in geode's branch 
refs/heads/feature/GEODE-3967 from zhouxh
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=974497c ]

GEODE-3967: There're following 6 problems fixed here:
1) When ConcurrentCacheModificationException happened, GatewaySenderEventImpl
 should save the status and notify gatewaysender if it hold primary queue,
because other member might have put the event into the secondary queue.
2) In AbstractUpdateOperation's doPutOrCreate's 3 tries of basicUpdate, the
3rd try should allow both create and update.
3) Let event with CME not to dispatch. The old logic does not allow CME event
to  enqueue. This is wrong, because an event without CME might have been
added into the secondary queue. So we should enqueue it, but not to dispatch.
4) Let UPDATE_VERSION_STAMP not to enqueue if not primary queue, because
the event did not fire in pair.
5) AbstractGatewaySenderEventProcessor put loop of filter in wrong place,
which caused UPDATE_VERSION_STAMP and CME events are not ignored.
However, not to fix it for now. Leave it in GEODE-4659.
6) shouldSendVersionEvents for Remote sender should return true, since
we no longer support 7.0.1 any more.
7) change version to 150
8) CME event should not retry in AUO.doPutOrCreate, because retry will end up 
with CME too.
9) CME && !originRemote: only enqueue to primary


> AbstractGatewaySenderEventProcessor put loop of filter in wrong place
> -
>
> Key: GEODE-4659
> URL: https://issues.apache.org/jira/browse/GEODE-4659
> Project: Geode
>  Issue Type: Bug
>  Components: wan
>Reporter: xiaojian zhou
>Priority: Major
>
> {noformat}
> When fixing GEODE-3967, I found the loop of filter is in wrong place. 
>  
> If there's no filter defined, the processing  to ignore UPDATE_VERSION_STAMP 
> and events with CME should have nothing to do with filters. But if there's no 
> filter defined, the code will not ignore the UPDATE_VERSION_STAMP and events 
> with CME.
>  
> However, if fixed this problem. the GEODE-3967 have more race conditions to 
> be fixed. (I have fixed several of them). It looks like this bug hided other 
> race conditions from blowing out. 
>  
> GIving the time constrain, I will not fix the filter issue in GEODE_3967 and 
> log this bug for future reference. 
>  
> Here are the diff to fix or this bug:
> diff --git 
> a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/RemoteParallelGatewaySenderEventProcessor.java
>  
> b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/RemoteParallelGatewaySenderEventProcessor.java
> index 8739a8f72..a3a89fbd0 100644
> --- 
> a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/RemoteParallelGatewaySenderEventProcessor.java
> +++ 
> b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/RemoteParallelGatewaySenderEventProcessor.java
> @@ -81,40 +81,8 @@ public class RemoteParallelGatewaySenderEventProcessor 
> extends ParallelGatewaySe
>     * @param disp
>     * @return true if remote site Gemfire Version is >= 7.0.1
>     */
> -  private boolean shouldSendVersionEvents(GatewaySenderEventDispatcher disp)
> -      throws GatewaySenderException {
> -    try {
> -      GatewaySenderEventRemoteDispatcher remoteDispatcher =
> -          (GatewaySenderEventRemoteDispatcher) disp;
> -      // This will create a new connection if no batch has been sent till
> -      // now.
> -      Connection conn = remoteDispatcher.getConnection(false);
> -      if (conn != null) {
> -        short remoteSiteVersion = conn.getWanSiteVersion();
> -        if (Version.GFE_701.compareTo(remoteSiteVersion) <= 0) {
> -          return true;
> -        }
> -      }
> -    } catch (GatewaySenderException e) {
> -      Throwable cause = e.getCause();
> -      if (cause instanceof IOException || e instanceof 
> GatewaySenderConfigurationException
> -          || cause instanceof ConnectionDestroyedException) {
> -        try {
> -          int sleepInterval = GatewaySender.CONNECTION_RETRY_INTERVAL;
> -          if (logger.isDebugEnabled()) {
> -            logger.debug("Sleeping for {} milliseconds", sleepInterval);
> -          }
> -          Thread.sleep(sleepInterval);
> -        } catch (InterruptedException ie) {
> -          // log the exception
> -          if (logger.isDebugEnabled()) {
> -            logger.debug(ie.getMessage(), ie);
> -          }
> -        }
> -      }
> -      throw e;
> -    }
> -    return false;
> +  protected boolean shouldSendVersionEvents(GatewaySenderEventDispatc

[jira] [Commented] (GEODE-4659) AbstractGatewaySenderEventProcessor put loop of filter in wrong place

2018-02-13 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on GEODE-4659:


Commit 69c8eb8b1d10963e211943e558b48b0e705b9b0b in geode's branch 
refs/heads/feature/GEODE-3967 from zhouxh
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=69c8eb8 ]

GEODE-3967: There're following 6 problems fixed here:
1) When ConcurrentCacheModificationException happened, GatewaySenderEventImpl
 should save the status and notify gatewaysender if it hold primary queue,
because other member might have put the event into the secondary queue.
2) In AbstractUpdateOperation's doPutOrCreate's 3 tries of basicUpdate, the
3rd try should allow both create and update.
3) Let event with CME not to dispatch. The old logic does not allow CME event
to  enqueue. This is wrong, because an event without CME might have been
added into the secondary queue. So we should enqueue it, but not to dispatch.
4) Let UPDATE_VERSION_STAMP not to enqueue if not primary queue, because
the event did not fire in pair.
5) AbstractGatewaySenderEventProcessor put loop of filter in wrong place,
which caused UPDATE_VERSION_STAMP and CME events are not ignored.
However, not to fix it for now. Leave it in GEODE-4659.
6) shouldSendVersionEvents for Remote sender should return true, since
we no longer support 7.0.1 any more.
7) change version to 150
8) CME event should not retry in AUO.doPutOrCreate, because retry will end up 
with CME too.
9) CME && !originRemote: only enqueue to primary


> AbstractGatewaySenderEventProcessor put loop of filter in wrong place
> -
>
> Key: GEODE-4659
> URL: https://issues.apache.org/jira/browse/GEODE-4659
> Project: Geode
>  Issue Type: Bug
>  Components: wan
>Reporter: xiaojian zhou
>Priority: Major
>
> {noformat}
> When fixing GEODE-3967, I found the loop of filter is in wrong place. 
>  
> If there's no filter defined, the processing  to ignore UPDATE_VERSION_STAMP 
> and events with CME should have nothing to do with filters. But if there's no 
> filter defined, the code will not ignore the UPDATE_VERSION_STAMP and events 
> with CME.
>  
> However, if fixed this problem. the GEODE-3967 have more race conditions to 
> be fixed. (I have fixed several of them). It looks like this bug hided other 
> race conditions from blowing out. 
>  
> GIving the time constrain, I will not fix the filter issue in GEODE_3967 and 
> log this bug for future reference. 
>  
> Here are the diff to fix or this bug:
> diff --git 
> a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/RemoteParallelGatewaySenderEventProcessor.java
>  
> b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/RemoteParallelGatewaySenderEventProcessor.java
> index 8739a8f72..a3a89fbd0 100644
> --- 
> a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/RemoteParallelGatewaySenderEventProcessor.java
> +++ 
> b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/RemoteParallelGatewaySenderEventProcessor.java
> @@ -81,40 +81,8 @@ public class RemoteParallelGatewaySenderEventProcessor 
> extends ParallelGatewaySe
>     * @param disp
>     * @return true if remote site Gemfire Version is >= 7.0.1
>     */
> -  private boolean shouldSendVersionEvents(GatewaySenderEventDispatcher disp)
> -      throws GatewaySenderException {
> -    try {
> -      GatewaySenderEventRemoteDispatcher remoteDispatcher =
> -          (GatewaySenderEventRemoteDispatcher) disp;
> -      // This will create a new connection if no batch has been sent till
> -      // now.
> -      Connection conn = remoteDispatcher.getConnection(false);
> -      if (conn != null) {
> -        short remoteSiteVersion = conn.getWanSiteVersion();
> -        if (Version.GFE_701.compareTo(remoteSiteVersion) <= 0) {
> -          return true;
> -        }
> -      }
> -    } catch (GatewaySenderException e) {
> -      Throwable cause = e.getCause();
> -      if (cause instanceof IOException || e instanceof 
> GatewaySenderConfigurationException
> -          || cause instanceof ConnectionDestroyedException) {
> -        try {
> -          int sleepInterval = GatewaySender.CONNECTION_RETRY_INTERVAL;
> -          if (logger.isDebugEnabled()) {
> -            logger.debug("Sleeping for {} milliseconds", sleepInterval);
> -          }
> -          Thread.sleep(sleepInterval);
> -        } catch (InterruptedException ie) {
> -          // log the exception
> -          if (logger.isDebugEnabled()) {
> -            logger.debug(ie.getMessage(), ie);
> -          }
> -        }
> -      }
> -      throw e;
> -    }
> -    return false;
> +  protected boolean shouldSendVersionEvents(GatewaySenderEventDispatc