geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From qih...@apache.org
Subject [07/19] incubator-geode git commit: Fix for GEODE-110
Date Thu, 06 Aug 2015 17:11:18 GMT
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/32186b98
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/32186b98
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/32186b98

Branch: refs/heads/feature/GEODE-137
Commit: 32186b98f087c69a7154e628aae314cf777aee5c
Parents: 863c4ca
Author: shirishd <sdeshmukh@pivotal.io>
Authored: Tue Aug 4 12:02:39 2015 +0530
Committer: Qihong Chen <qchen@pivotal.io>
Committed: Thu Aug 6 10:07:47 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/32186b98/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/32186b98/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;


Mime
View raw message