Bruce Schuchardt created GEODE-6614:
---------------------------------------

             Summary: WAN concurrency conflict checks are messed up
                 Key: GEODE-6614
                 URL: https://issues.apache.org/jira/browse/GEODE-6614
             Project: Geode
          Issue Type: Bug
          Components: regions, wan
            Reporter: Bruce Schuchardt


Someone inserted code into concurrency conflict checks that treats all 
VersionTags as gateway tags if their distributed system ID is not the same as 
the RegionEntry being modified.  When that's the case the code checks 
timestamps and distributed system identifiers to resolve conflicts.  This is 
counter-intuitive for folks trying to debug WAN consistency issues and can 
cause odd decisions to be made, especially in client caches.

The revision that did this is so old it's not in the Apache github repo, but 
the code in question is
{code:java}
// bug #46223, an event received from a peer or a server may be from a different
// distributed system than the last modification made to this entry so we must
// perform a gateway conflict check
if (stamp != null && !tag.isAllowedByResolver()) {
  int stampDsId = stamp.getDistributedSystemId();
  int tagDsId = tag.getDistributedSystemId();

  if (stampDsId != 0 && stampDsId != tagDsId && stampDsId != -1) {
    StringBuilder verbose = null;
    if (logger.isTraceEnabled(LogMarker.TOMBSTONE_VERBOSE)) {
      verbose = new StringBuilder();
      verbose.append("processing tag for key ").append(getKey()).append(", 
stamp=")
          .append(stamp.asVersionTag()).append(", tag=").append(tag);
    }
    long stampTime = stamp.getVersionTimeStamp();
    long tagTime = tag.getVersionTimeStamp();
    if (stampTime > 0 && (tagTime > stampTime || (tagTime == stampTime
        && tag.getDistributedSystemId() >= stamp.getDistributedSystemId()))) {
      if (verbose != null) {
        verbose.append(" - allowing event");
        logger.trace(LogMarker.TOMBSTONE_VERBOSE, verbose);
      }
      // Update the stamp with event's version information.
      applyVersionTag(r, stamp, tag, originator);
      return;
    }

    if (stampTime > 0) {
      if (verbose != null) {
        verbose.append(" - disallowing event");
        logger.trace(LogMarker.TOMBSTONE_VERBOSE, verbose);
      }
      r.getCachePerfStats().incConflatedEventsCount();
      persistConflictingTag(r, tag);
      throw new ConcurrentCacheModificationException("conflicting event 
detected");
    }
  }
}
{code}
If I remove that code the concurrency checks behave as expected.  Tests that 
were added along with this change pass with the change removed.

 

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to