diff --git a/include/ReplicaThread.h b/include/ReplicaThread.h index bb87e00c7c..2f3701a6eb 100644 --- a/include/ReplicaThread.h +++ b/include/ReplicaThread.h @@ -32,7 +32,7 @@ class ReplicaThread { public: ReplicaThread(int _follower_id):follower_id(_follower_id), _finalize(false), - _pending_requests(false), retry_timeout(2) + _pending_requests(false), retry_timeout(1e8) { pthread_mutex_init(&mutex, 0); diff --git a/src/raft/FedReplicaManager.cc b/src/raft/FedReplicaManager.cc index 1bef300c29..914ee0f37f 100644 --- a/src/raft/FedReplicaManager.cc +++ b/src/raft/FedReplicaManager.cc @@ -509,6 +509,12 @@ int FedReplicaManager::xmlrpc_replicate_log(int zone_id, bool& success, return -1; } + if ( zservers.size() == 0 ) + { + error = "No servers defined in the zone"; + return -1; + } + // ------------------------------------------------------------------------- // Get parameters to call append entries on follower // ------------------------------------------------------------------------- diff --git a/src/raft/ReplicaThread.cc b/src/raft/ReplicaThread.cc index c7c7cc51ba..bafeda238b 100644 --- a/src/raft/ReplicaThread.cc +++ b/src/raft/ReplicaThread.cc @@ -29,7 +29,7 @@ // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- -const time_t ReplicaThread::max_retry_timeout = 300; +const time_t ReplicaThread::max_retry_timeout = 2.5e9; // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- @@ -79,8 +79,8 @@ void ReplicaThread::do_replication() { struct timespec timeout; - timeout.tv_sec = time(NULL) + retry_timeout; - timeout.tv_nsec = 0; + timeout.tv_sec = time(NULL); + timeout.tv_nsec = retry_timeout; if ( pthread_cond_timedwait(&cond, &mutex, &timeout) == ETIMEDOUT ) { @@ -110,7 +110,7 @@ void ReplicaThread::do_replication() } else { - retry_timeout = 2; + retry_timeout = 1e8; retry_request = false; } }