Skip to main content

Say we have two nodes(simple replica no sharding) i.e. N1,N2 with replication factor as 2. I am using default Read and write consistency levels i.e. R and W are 1 which means it will read/write from/to single node

Scenario 1

1.  Consider write request goes to node N1  to update record R1. Say name `scott` updated to `scott_update1`
2.  Before it is replicated to N1, N1 crashed
3.  Another write request goes to node N2  to update the same record R1. Now `scott` updated to `scott_update2`
4.  Now when N1 comes back, will the name `scott_update1` be updated to `scott_update2` ?
  1. Consider write request goes to node N1 to update record R1. Say name scott updated to scott_update1
  2. Before it is replicated to N2, N1 crashed
  3. Another write request goes to node N2 to update the same record R1. Now scott updated to scott_update2
  4. Now when N1 comes back, will the name scott_update1 be updated to scott_update2 ?

Scenario 2

1.  Consider write request goes to node N1  to update record R1. Say name `scott` updated to `scott_update1`
2.  Before it is replicated to N1, N1 crashed
3 . Read request  goes to node N2  to read the same record R1. It returns `scott`
3.  Now when N1 comes back, will the name `scott_update1` be updated to `scott` or it will stay `scott_update1` ?
  1. Consider write request goes to node N1 to update record R1. Say name scott updated to scott_update1
  2. Before it is replicated to N2, N1 crashed
  3. Read request goes to node N2 to read the same record R1. It returns scott
  4. Now when N1 comes back, will the name scott_update1 be updated to scott or it will stay scott_update1 ?

Say we have two nodes(simple replica no sharding) i.e. N1,N2 with replication factor as 2. I am using default Read and write consistency levels i.e. R and W are 1 which means it will read/write from/to single node

Scenario 1

1.  Consider write request goes to node N1  to update record R1. Say name `scott` updated to `scott_update1`
2.  Before it is replicated to N1, N1 crashed
3.  Another write request goes to node N2  to update the same record R1. Now `scott` updated to `scott_update2`
4.  Now when N1 comes back, will the name `scott_update1` be updated to `scott_update2` ?

Scenario 2

1.  Consider write request goes to node N1  to update record R1. Say name `scott` updated to `scott_update1`
2.  Before it is replicated to N1, N1 crashed
3 . Read request  goes to node N2  to read the same record R1. It returns `scott`
3.  Now when N1 comes back, will the name `scott_update1` be updated to `scott` or it will stay `scott_update1` ?

Say we have two nodes(simple replica no sharding) i.e. N1,N2 with replication factor as 2. I am using default Read and write consistency levels i.e. R and W are 1 which means it will read/write from/to single node

Scenario 1

  1. Consider write request goes to node N1 to update record R1. Say name scott updated to scott_update1
  2. Before it is replicated to N2, N1 crashed
  3. Another write request goes to node N2 to update the same record R1. Now scott updated to scott_update2
  4. Now when N1 comes back, will the name scott_update1 be updated to scott_update2 ?

Scenario 2

  1. Consider write request goes to node N1 to update record R1. Say name scott updated to scott_update1
  2. Before it is replicated to N2, N1 crashed
  3. Read request goes to node N2 to read the same record R1. It returns scott
  4. Now when N1 comes back, will the name scott_update1 be updated to scott or it will stay scott_update1 ?
Source Link
user3198603
  • 399
  • 1
  • 5
  • 14

How these conflicting scenarios will work in cassandra when one of the mode crashes?

Say we have two nodes(simple replica no sharding) i.e. N1,N2 with replication factor as 2. I am using default Read and write consistency levels i.e. R and W are 1 which means it will read/write from/to single node

Scenario 1

1.  Consider write request goes to node N1  to update record R1. Say name `scott` updated to `scott_update1`
2.  Before it is replicated to N1, N1 crashed
3.  Another write request goes to node N2  to update the same record R1. Now `scott` updated to `scott_update2`
4.  Now when N1 comes back, will the name `scott_update1` be updated to `scott_update2` ?

Scenario 2

1.  Consider write request goes to node N1  to update record R1. Say name `scott` updated to `scott_update1`
2.  Before it is replicated to N1, N1 crashed
3 . Read request  goes to node N2  to read the same record R1. It returns `scott`
3.  Now when N1 comes back, will the name `scott_update1` be updated to `scott` or it will stay `scott_update1` ?