Repository: phoenix
Updated Branches:
  refs/heads/omid2 acaa07012 -> e02b3a278


Increase Tephra timeouts for discovery failure


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/1c211038
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/1c211038
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/1c211038

Branch: refs/heads/omid2
Commit: 1c211038937541e3f25ba42a40ab3a2c27a7c04e
Parents: acaa070
Author: James Taylor <jamestay...@apache.org>
Authored: Fri Nov 16 07:35:54 2018 -0800
Committer: James Taylor <jamestay...@apache.org>
Committed: Fri Nov 16 07:35:54 2018 -0800

----------------------------------------------------------------------
 .../transaction/TephraTransactionProvider.java        | 14 ++++++++------
 pom.xml                                               |  2 +-
 2 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/1c211038/phoenix-core/src/main/java/org/apache/phoenix/transaction/TephraTransactionProvider.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/transaction/TephraTransactionProvider.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/transaction/TephraTransactionProvider.java
index 70937cf..060aaf4 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/transaction/TephraTransactionProvider.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/transaction/TephraTransactionProvider.java
@@ -89,16 +89,17 @@ public class TephraTransactionProvider implements 
PhoenixTransactionProvider {
         }
 
         int timeOut = config.getInt(HConstants.ZK_SESSION_TIMEOUT, 
HConstants.DEFAULT_ZK_SESSION_TIMEOUT);
+        int retryTimeOut = 
config.getInt(TxConstants.Service.CFG_DATA_TX_CLIENT_DISCOVERY_TIMEOUT_SEC, 
+                
TxConstants.Service.DEFAULT_DATA_TX_CLIENT_DISCOVERY_TIMEOUT_SEC);
         // Create instance of the tephra zookeeper client
         ZKClientService zkClientService  = ZKClientServices.delegate(
             ZKClients.reWatchOnExpire(
                 ZKClients.retryOnFailure(
                      new TephraZKClientService(zkQuorumServersString, timeOut, 
null,
                              ArrayListMultimap.<String, byte[]>create()), 
-                         RetryStrategies.exponentialDelay(500, 2000, 
TimeUnit.MILLISECONDS))
+                         RetryStrategies.exponentialDelay(500, retryTimeOut, 
TimeUnit.MILLISECONDS))
                      )
                 );
-        //txZKClientService.startAndWait();
         ZKDiscoveryService zkDiscoveryService = new 
ZKDiscoveryService(zkClientService);
         PooledClientProvider pooledClientProvider = new PooledClientProvider(
                 config, zkDiscoveryService);
@@ -111,6 +112,8 @@ public class TephraTransactionProvider implements 
PhoenixTransactionProvider {
 
     @Override
     public PhoenixTransactionService getTransactionService(Configuration 
config, ConnectionInfo connInfo) {
+        int retryTimeOut = 
config.getInt(TxConstants.Service.CFG_DATA_TX_CLIENT_DISCOVERY_TIMEOUT_SEC, 
+                
TxConstants.Service.DEFAULT_DATA_TX_CLIENT_DISCOVERY_TIMEOUT_SEC);
         ZKClientService zkClient = ZKClientServices.delegate(
           ZKClients.reWatchOnExpire(
             ZKClients.retryOnFailure(
@@ -118,17 +121,16 @@ public class TephraTransactionProvider implements 
PhoenixTransactionProvider {
                 .setSessionTimeout(config.getInt(HConstants.ZK_SESSION_TIMEOUT,
                         HConstants.DEFAULT_ZK_SESSION_TIMEOUT))
                 .build(),
-              RetryStrategies.exponentialDelay(500, 2000, 
TimeUnit.MILLISECONDS)
+              RetryStrategies.exponentialDelay(500, retryTimeOut, 
TimeUnit.MILLISECONDS)
             )
           )
         );
 
-        //zkClient.startAndWait();
         DiscoveryService discovery = new ZKDiscoveryService(zkClient);
-        TransactionManager txManager = new TransactionManager(config, new 
HDFSTransactionStateStorage(config, new SnapshotCodecProvider(config), new 
TxMetricsCollector()), new TxMetricsCollector());
+        TransactionManager txManager = new TransactionManager(config, new 
HDFSTransactionStateStorage(config, 
+                new SnapshotCodecProvider(config), new TxMetricsCollector()), 
new TxMetricsCollector());
         TransactionService txService = new TransactionService(config, 
zkClient, discovery, Providers.of(txManager));
         TephraTransactionService service = new 
TephraTransactionService(zkClient, txService);
-        //txService.startAndWait();            
         service.start();
         return service;
     }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/1c211038/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b2d2c64..d713dd9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -123,7 +123,7 @@
 
     <!-- Plugin options -->
     <numForkedUT>4</numForkedUT>
-    <numForkedIT>8</numForkedIT>
+    <numForkedIT>7</numForkedIT>
     <it.failIfNoSpecifiedTests>false</it.failIfNoSpecifiedTests>
     <surefire.failIfNoSpecifiedTests>false</surefire.failIfNoSpecifiedTests>
 

Reply via email to