arnabkaycee
arnabkaycee

Reputation: 1644

Infinispan - Node Failover and Control over Recovery

Hope all are doing good. I am new to Infinispan and I need help. Say I have a cluster of 3 nodes running in Distributed Mode. Consider the following scenario:

Infinispan Version : 7.1.1

No. of Nodes = 3 (NodeA, NodeB, NodeC)

Mode = Distributed

numOwners = 2

No. of Key/Values in the cluster = 3 [(k1,v1),(k2,v2),(k3,v3)]

Distribution of keys in each of the nodes :

NodeA --> k1,k2

NodeB --> k2,k3

NodeC --> k3,k1

Now, say Node B is down.

Q1. Would the following scenario be like this?

NodeA --> k1,k2, k3

NodeC --> k3,k1, k2

Q2. If Node B becomes alive again, I want my cluster to regain its original state like:

NodeA --> k1,k2

NodeB --> k2,k3

NodeC --> k3,k1

Is there any mechanism by which I can achieve the above 2 states (after node failure and after node recovery).

Can anyone help me out? Any help would be highly appreciated.

Upvotes: 0

Views: 294

Answers (1)

Radim Vansa
Radim Vansa

Reputation: 5888

Q1: Yes, with numOwners = 2 and 2 nodes all data will be on both nodes

Q2: It won't get to the original state, but it will spread the entries ~evenly across cluster. Therefore, it is possible that it will end up e.g. like

A -> k1, k3
B -> k3, k2
C -> k2, k1

However, the keys don't have to be spread exactly evenly. Infinispan defines the distribution by the concept of segments; you can define the number of segments in configuration, too. Each segment contains a portion of keys according to the hashCode() of those keys, and these segments are spread as evenly as possible.

Upvotes: 4

Related Questions