@Override
  public void setVersions(final VersionTag versionTag) {
    memberId = versionTag.getMemberID();
    int eVersion = versionTag.getEntryVersion();
    entryVersionLowBytes = (short) (eVersion & 0xffff);
    entryVersionHighByte = (byte) ((eVersion & 0xff0000) >> 16);
    regionVersionHighBytes = versionTag.getRegionVersionHighBytes();
    regionVersionLowBytes = versionTag.getRegionVersionLowBytes();
    if (!versionTag.isGatewayTag()
        && distributedSystemId == versionTag.getDistributedSystemId()) {
      if (getVersionTimeStamp() <= versionTag.getVersionTimeStamp()) {
        setVersionTimeStamp(versionTag.getVersionTimeStamp());
      } else {
        versionTag.setVersionTimeStamp(getVersionTimeStamp());
      }
    } else {
      setVersionTimeStamp(versionTag.getVersionTimeStamp());
    }
    distributedSystemId = (byte) (versionTag.getDistributedSystemId() & 0xff);
  }
I needed to add this because I wanted clear to call setValue which normally can only be called
while the re is synced. But if I sync in that code it causes a lock ordering deadlock with the
disk regions because they also get a rw lock in clear. Some hardware platforms do not support
CAS on a long. If gemfire is run on one of those the AtomicLongFieldUpdater does a sync on the
RegionEntry and we will once again be deadlocked. I don't know if we support any of the
hardware platforms that do not have a 64bit CAS. If we do then we can expect deadlocks on disk
regions.
geode-core/src/main/java/org/apache/geode/internal/cache/entries/VersionedThinRegionEntryOffHeapLongKey.java