Hi All,
I understand that Strong consistency is an enterprise feature. I did some consistency related experiments with community edition (CE). I am working with aerospike server version 4.2.0.10. Its a two node setup with below policies. Replication factor is set to 2.
cfg.policies.read.replica = AS_POLICY_REPLICA_SEQUENCE;
cfg.policies.write.replica = AS_POLICY_REPLICA_SEQUENCE;
cfg.policies.write.commit_level = AS_POLICY_COMMIT_LEVEL_ALL;
cfg.policies.write.base.total_timeout = 0;
cfg.policies.write.base.max_retries = 10;
cfg.policies.write.base.sleep_between_retries = 500;
cfg.policies.read.base.total_timeout = 0;
cfg.policies.read.base.max_retries = 10;
cfg.policies.read.base.sleep_between_retries = 300;
I’ve below queries.
- According to my observation replica writes are happening & client gets acknowledged only after write completes on replica nodes. How is it differently handled in enterprise when it comes to writes on replica nodes?
Node1 / bcc060012ac4202:
Oct 24 2019 07:39:22 GMT: WARNING (rw): (write.c:262) : transaction replication started as_write_start
Oct 24 2019 07:39:22 GMT: WARNING (rw): (write.c:300) inside start_write_repl_write
Oct 24 2019 07:39:22 GMT: WARNING (rw): (rw_utils.c:86) send_rw_messages abt to send rw msg to node over fabric bcc050012ac4202
Node2 / bcc050012ac4202:
Oct 24 2019 07:39:22 GMT: WARNING (rw): (rw_request_hash.c:412) : abt to handle replica writes rw_msg_cb
Oct 24 2019 07:39:22 GMT: WARNING (rw): (replica_write.c:298) abt to write record in repl_write_handle_op
Node1 / bcc060012ac4202:
Oct 24 2019 07:39:22 GMT: WARNING (rw): (rw_request_hash.c:416) : abt to handle replica writes ack rw_msg_cb
Oct 24 2019 07:39:22 GMT: WARNING (rw): (replica_write.c:311) repl_write_handle_ack repl-write ack: from node bcc050012ac4202
Oct 24 2019 07:39:22 GMT: WARNING (rw): (replica_write.c:413) repl_write_handle_ack abt to do cb as we hrd from node bcc050012ac4202
Oct 24 2019 07:39:22 GMT: WARNING (rw): (write.c:409) inside should be marked complete for all write_repl_write_cb
2. Experiment:
1. Write 'a' as value in 100K records.
2. Bring master node down only after above write is complete.
3. Overwrite above 100K records with 'b'.
4. Bring master node up & Immediately (before migrations complete) read above 100K records.
5. As expected latest data ('b') got served.
From consistency point of view, how is it differently handled in enterprise when it comes to serving reads while migrations (in context of partition re-balancing) going on?
3. Are above mentioned policies enough to achieve strong consistency (for all the replica commits)?
Thanks,
Mahaveer