# Java Client - Automatic failover to other nodes

**URL:** <https://discuss.aerospike.com/t/java-client-automatic-failover-to-other-nodes/8428>\
**Category:** Java Client\
**Created:** [May 3, 2021, 6:33pm UTC](https://discuss.aerospike.com/t/java-client-automatic-failover-to-other-nodes/8428 "2021-05-03T18:33:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe36](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/joe36/32/1470_2.png) [@Joe36](https://discuss.aerospike.com/u/Joe36)\
**Post date:** [May 3, 2021, 6:33pm UTC](https://discuss.aerospike.com/t/java-client-automatic-failover-to-other-nodes/8428/1 "2021-05-03T18:33:21Z")

</div>

Hey,

Does the Java client support automatically switching to other nodes when one node goes offline? We are testing Aerospike with a 8 node K8s cluster (replication factor = 1) and when one node is down our client operations start to fail.  
For example an aerospike key put fails with “Client timeout” - reason: Client timeout: iteration=1 socket=30000 total=0 maxRetries=0 node=BB9844C8706B3C2 xx.xxx.xx.xxx 3000 inDoubt=true

---

<div class="post-metadata">

**Author:** ![Brian](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/brian/32/2211_2.png) [@Brian](https://discuss.aerospike.com/u/Brian)\
**Post date:** [May 3, 2021, 7:30pm UTC](https://discuss.aerospike.com/t/java-client-automatic-failover-to-other-nodes/8428/2 "2021-05-03T19:30:58Z")

</div>

If a node goes down, it’s inevitable that timeouts/connection errors occur because inflight transactions lost their connections during socket send/receive. Also, the partition map will continue to point to the downed node until the cluster tend retrieves the new server partition maps. This process should take a few seconds.

---

<div class="post-metadata">

**Author:** ![Joe36](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/joe36/32/1470_2.png) [@Joe36](https://discuss.aerospike.com/u/Joe36)\
**Post date:** [May 3, 2021, 7:46pm UTC](https://discuss.aerospike.com/t/java-client-automatic-failover-to-other-nodes/8428/3 "2021-05-03T19:46:02Z")

</div>

So basically it means that during this time we will have data lost for those operations.

There is no way how to speed this up? Or even prevent data lost? We can’t effort data lost.

Thanks

---

<div class="post-metadata">

**Author:** ![meher](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/meher/32/1644_2.png) [@meher](https://discuss.aerospike.com/u/meher)\
**Post date:** [May 3, 2021, 11:59pm UTC](https://discuss.aerospike.com/t/java-client-automatic-failover-to-other-nodes/8428/4 "2021-05-03T23:59:38Z")

</div>

You can adjust your retry policy (depending whether the write operation is idempotent for example) or have the application handle the timeout / error. It is certainly not lost since the client application would have received an error.
