Asking about handling Reconnecting

Hi,

Im, system administrator, I have deployed Cockroach manually and my purpose is test Cockroach Capabilities

My cluster is deployed in AWS, three EC2 machines, in each instance 2 cockroach nodes (for cost saving), behind the instance i have deployed a Network Load Balance.

We would like to know, If we made write operations, is cockroach able by himself realize that he lost connection to the node and restart the transaction or operation in another node after connectivity lost?

I believe for this to work correctly, you need at least 3 nodes. CockroachDB uses Raft. If you were to spin up a 3rd node it would have the needed resiliency.

Hi,yes

But, we are before an application that doesnt know how to reconnect in its code.

When connection is lost, (because I do a failover in the node where the session is stablished) “aborting connection shutdown node” or if i kill the process “Error I/O”

If we made write operations, is cockroach able by himself realize that he lost connection to the node and restart the transaction or operation in another node

The transaction would either succeed before the node fails or fail and leave the data unchanged. From our docs:

If a transaction succeeds, all mutations are applied together with virtual simultaneity. If any part of a transaction fails, the entire transaction is aborted, and the database is left unchanged. CockroachDB guarantees that while a transaction is pending, it is isolated from other concurrent transactions with serializable isolation.

My cluster is deployed in AWS, three EC2 machines, in each instance 2 cockroach nodes (for cost saving), behind the instance i have deployed a Network Load Balance.

For reference our docs on deploying CockroachDB are useful, see:

and Production Checklist | CockroachDB Docs

When connection is lost, (because I do a failover in the node where the session is stablished) “aborting connection shutdown node” or if i kill the process “Error I/O”

You don’t need to setup specific failover nodes with CockroachDB. Each node is able to fail gracefully and rejoin the cluster all while distributing the data and keeping consistent. If you’re looking to test this, a great reference would be:

But, we are before an application that doesnt know how to reconnect in its code.

An important component that your application should have is a connection pool. A connection pool should be able to reconnect to a healthy node when it detects that an existing connection was broken. The connection pool you choose depends on which language and frameworks you are using. See the general guidance at: Connection Pooling | CockroachDB Docs