You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2015/08/04 23:39:25 UTC

[4/5] incubator-geode git commit: Fix for GEODE-110

Fix for GEODE-110

In the context of distributed transactions, DistributedPutAllOperation.createPRMessages calls putAllData[i].setFakeEventID() to set event ID for each entry in put all op (called from DistTXStateProxyImplOnCoordinator.postPutAll->DistPeerTXStateStub.postPutAll->TXStateStub.postPutAll -> PartitionedTXRegionStub.postPutAll). However when the data node itself is a transaction coordinator, createPRMessages is not called and the data is locally put by calling DistTXStateProxyImplOnCoordinator.postPutAll->DistTXStateOnCoordinator.postPutAll(). This call sequence does not call putAllData[i].setFakeEventID(). At the commit time when the coordinator sends TX events to secondaries, some of the events from different buckets had same event ID. This caused TXState.txPutEntry() to skip those events (assuming that the entry has been processed already) and therefore the test failed. The fix is to call putallOp.putAllData[i].setFakeEventID() in DistTXStateProxyImplOnCoordinator.postPutAll so that even
 tID is set for all entries. Similar fix is done for remove all.

Also enabled the assertion that was surrounded by logger.isDebugEnabled() call due to this issue


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/be622538
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/be622538
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/be622538

Branch: refs/heads/feature/GEODE-181
Commit: be622538eb1021f0bb6dba893f268439bb4ffcf2
Parents: 3e3acef
Author: shirishd <sd...@pivotal.io>
Authored: Tue Aug 4 12:02:39 2015 +0530
Committer: Kirk Lund <kl...@pivotal.io>
Committed: Tue Aug 4 14:38:24 2015 -0700

----------------------------------------------------------------------
 .../cache/DistTXStateProxyImplOnCoordinator.java   |  2 ++
 .../gemfire/internal/cache/TXRegionState.java      | 17 +++++------------
 2 files changed, 7 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/be622538/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/DistTXStateProxyImplOnCoordinator.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/DistTXStateProxyImplOnCoordinator.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/DistTXStateProxyImplOnCoordinator.java
index 2f79605..b44713f 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/DistTXStateProxyImplOnCoordinator.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/DistTXStateProxyImplOnCoordinator.java
@@ -888,6 +888,7 @@ public class DistTXStateProxyImplOnCoordinator extends DistTXStateProxyImpl {
               event, putallOp.putAllDataSize, putallOp.isBridgeOp);
           bucketToPutallMap.put(bucketId, putAllForBucket);
         } 
+        putallOp.putAllData[i].setFakeEventID();
         putAllForBucket.addEntry(putallOp.putAllData[i]);
 
         KeyInfo ki = new KeyInfo(key, null, null);
@@ -965,6 +966,7 @@ public class DistTXStateProxyImplOnCoordinator extends DistTXStateProxyImpl {
               event, op.removeAllDataSize, op.isBridgeOp);
           bucketToRemoveAllMap.put(bucketId, removeAllForBucket);
         } 
+        op.removeAllData[i].setFakeEventID();
         removeAllForBucket.addEntry(op.removeAllData[i]);
 
         KeyInfo ki = new KeyInfo(key, null, null);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/be622538/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/TXRegionState.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/TXRegionState.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/TXRegionState.java
index 67cb8c5..bb6ae5f 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/TXRegionState.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/TXRegionState.java
@@ -596,18 +596,11 @@ public class TXRegionState {
     String regionFullPath = this.getRegion().getFullPath();
     int entryModsSize = this.entryMods.size();
     int entryEventListSize = entryEventList.size();
-    /*
-     * [DISTTX] TODO
-     * This assertion is not working for PutAll and RemoveAll operations 
-     * and thus guarding within Debug flags. May be enabled at later stage.
-     */
-    if (logger.isDebugEnabled()) {
-      if (entryModsSize != entryEventListSize) {
-        throw new UnsupportedOperationInTransactionException(
-            LocalizedStrings.DISTTX_TX_EXPECTED
-                .toLocalizedString("entry size of " + entryModsSize
-                    + " for region " + regionFullPath, entryEventListSize));
-      }
+    if (entryModsSize != entryEventListSize) {
+      throw new UnsupportedOperationInTransactionException(
+          LocalizedStrings.DISTTX_TX_EXPECTED.toLocalizedString(
+              "entry size of " + entryModsSize + " for region "
+                  + regionFullPath, entryEventListSize));
     }
 
     int index = 0;