You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2021/02/25 01:28:54 UTC

[GitHub] [geode] luissson opened a new pull request #6054: GEODE-8907: CI Failure: ClientServerTransactionCCEDUnitTest.testTxRemoveAll

luissson opened a new pull request #6054:
URL: https://github.com/apache/geode/pull/6054


   Thank you for submitting a contribution to Apache Geode.
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [ ] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
   
   - [ ] Has your PR been rebased against the latest commit within the target branch (typically `develop`)?
   
   - [ ] Is your initial contribution a single, squashed commit?
   
   - [ ] Does `gradlew build` run cleanly?
   
   - [ ] Have you written or updated unit tests to verify your changes?
   
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   
   ### Note:
   Please ensure that once the PR is submitted, check Concourse for build issues and
   submit an update to your PR as soon as possible. If you need help, please send an
   email to dev@geode.apache.org.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] pivotal-eshu merged pull request #6054: GEODE-8907: CI Failure: ClientServerTransactionCCEDUnitTest.testTxRemoveAll

Posted by GitBox <gi...@apache.org>.
pivotal-eshu merged pull request #6054:
URL: https://github.com/apache/geode/pull/6054


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] pivotal-eshu commented on a change in pull request #6054: GEODE-8907: CI Failure: ClientServerTransactionCCEDUnitTest.testTxRemoveAll

Posted by GitBox <gi...@apache.org>.
pivotal-eshu commented on a change in pull request #6054:
URL: https://github.com/apache/geode/pull/6054#discussion_r583911648



##########
File path: geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerTransactionDUnitTest.java
##########
@@ -2108,6 +2110,8 @@ public Object call() throws Exception {
         TXManagerImpl mgr = getGemfireCache().getTxManager();
         Region<Integer, String> r = getGemfireCache().getRegion(D_REFERENCE);
         Region<CustId, Customer> pr = getGemfireCache().getRegion(CUSTOMER);
+        TXStateProxy tx = mgr.internalSuspend();

Review comment:
       This will not address the issue we saw in the pipeline.
   The issue is the thread can not internalSuspend a transaction, if it does not in a txState. Which we saw in the test failure on the second call.
   
   The correct fix is change the first callable return mgr.getTransactionId() to mgr.suspend().
       final TXId txid = (TXId) client.invoke(new SerializableCallable() {
         @Override
         public Object call() throws Exception {
           ClientCacheFactory ccf = new ClientCacheFactory();
           ccf.addPoolServer("localhost"/* getServerHostName(Host.getHost(0)) */, port1);
           ccf.addPoolServer("localhost", port2);
           ccf.setPoolLoadConditioningInterval(1);
           ccf.setPoolSubscriptionEnabled(false);
           ccf.set(LOG_LEVEL, getDUnitLogLevel());
           ClientCache cCache = getClientCache(ccf);
           ClientRegionFactory<CustId, Customer> custrf =
               cCache.createClientRegionFactory(ClientRegionShortcut.PROXY);
           ClientRegionFactory<Integer, String> refrf =
               cCache.createClientRegionFactory(ClientRegionShortcut.PROXY);
           Region<Integer, String> r = refrf.create(D_REFERENCE);
           Region<CustId, Customer> pr = custrf.create(CUSTOMER);
           // Region<Integer, String> order = refrf.create(ORDER);
   
           TXManagerImpl mgr = getGemfireCache().getTxManager();
           mgr.begin();
           int i = 0;
           for (int j = 0; j < 10; j++) {
             CustId custId = new CustId(i);
             Customer cust = new Customer("name" + i, "address" + i);
             getGemfireCache().getLogger().info("SWAP:putting:" + custId);
             pr.put(custId, cust);
             r.put(i, "value" + i);
           }
           return mgr.suspend();
         }
       });
   
   And here you can resume transaction by calling mgr.resume(txId);




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] luissson commented on pull request #6054: GEODE-8907: CI Failure: ClientServerTransactionCCEDUnitTest.testTxRemoveAll

Posted by GitBox <gi...@apache.org>.
luissson commented on pull request #6054:
URL: https://github.com/apache/geode/pull/6054#issuecomment-786763560


   Good point, I did consider that but am in the process of rewriting RemoteTransactionDUnitTest which will address those concerns and more. I wanted to treat this PR as a quick fix to stop these sorts errors from popping up in CI while the rework is being done.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] pivotal-eshu commented on a change in pull request #6054: GEODE-8907: CI Failure: ClientServerTransactionCCEDUnitTest.testTxRemoveAll

Posted by GitBox <gi...@apache.org>.
pivotal-eshu commented on a change in pull request #6054:
URL: https://github.com/apache/geode/pull/6054#discussion_r586752182



##########
File path: geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerTransactionDUnitTest.java
##########
@@ -2076,10 +2078,11 @@ public Object call() throws Exception {
       }
     });
 
-    client.invoke(new SerializableCallable() {
+    TXId txid2 = (TXId) client.invoke(new SerializableCallable() {

Review comment:
       There is no need to have a new txId here, unless you want to assert this is the same as txId. There is only one transaction. Probably just ignore the return value here. And later resume the original txId instead of txid2.

##########
File path: geode-core/src/distributedTest/java/org/apache/geode/internal/cache/RemoteTransactionDUnitTest.java
##########
@@ -3010,50 +3024,82 @@ public Object call() throws Exception {
       }
     });
 
-    SerializableCallable testFnOnDs = new SerializableCallable() {
-      @Override
-      public Object call() throws Exception {
-        TXManagerImpl mgr = getGemfireCache().getTXMgr();
-        PartitionedRegion pr = (PartitionedRegion) getGemfireCache().getRegion(CUSTOMER);
-        CustId keyOnDs = getKeyOnMember(pr.getMyId(), pr);
-        mgr.begin();
-        pr.get(keyOnDs);
-        Set filter = new HashSet();
-        filter.add(keyOnDs);
-        FunctionService.onRegion(pr).withFilter(filter).execute(TXFunction.id).getResult();
-        assertEquals(expectedCustomer, pr.get(expectedCustId));
-        TXStateProxy tx = mgr.pauseTransaction();
-        assertNull(pr.get(expectedCustId));
-        mgr.unpauseTransaction(tx);
-        return null;
-      }
-    };
-    SerializableCallable closeTx = new SerializableCallable() {
-      @Override
-      public Object call() throws Exception {
-        Region custRegion = getGemfireCache().getRegion(CUSTOMER);
-        CacheTransactionManager mgr = getGemfireCache().getTXMgr();
-        mgr.commit();
-        assertEquals(expectedCustomer, custRegion.get(expectedCustId));
-        custRegion.destroy(expectedCustId);
-        return null;
-      }
-    };
-
     if (owner.equals(ds1)) {
-      datastore1.invoke(testFnOnDs);
+      TXId dsTxId = (TXId) datastore1.invoke(

Review comment:
       Should not duplicate the code here, should reuse the existing callables.
   
   To pass in different txIds in the callable, you can see how DoOpsInTX is implemented.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] pivotal-eshu commented on a change in pull request #6054: GEODE-8907: CI Failure: ClientServerTransactionCCEDUnitTest.testTxRemoveAll

Posted by GitBox <gi...@apache.org>.
pivotal-eshu commented on a change in pull request #6054:
URL: https://github.com/apache/geode/pull/6054#discussion_r586866920



##########
File path: geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerTransactionDUnitTest.java
##########
@@ -3782,13 +3790,15 @@ public Object call() throws Exception {
       @Override
       public Object call() throws Exception {
         TXManagerImpl mgr = getGemfireCache().getTxManager();
+        mgr.resume(txid);

Review comment:
       After you resume the transaction, the following code trying to resume can be safely removed.

##########
File path: geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerTransactionDUnitTest.java
##########
@@ -3749,14 +3756,15 @@ public Object call() throws Exception {
         lr.validatedPut(event, System.currentTimeMillis());
         lr.validatedPut(event, System.currentTimeMillis());
         lr.validatedPut(event, System.currentTimeMillis());
-        return null;
+        return mgr.suspend();
       }
     });
 
     server.invoke(new SerializableCallable() {
       @Override
       public Object call() throws Exception {
         TXManagerImpl mgr = getGemfireCache().getTxManager();
+        // mgr.resume(txid2);

Review comment:
       You may want to clean up this commented out line.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org