Can you please help to clarify the Replication mechanism described in https://academy.datastax.com/units/20112-replication-dse-foundations-apache-cassandra
User connects to node1 for write data belonging to partition P. But partition P is stored in nodeA, and replicated to nodeB and nodeC.
Q1. How does the contact node1 knows that nodeA holds partition P? It does knows where nodeA is located thanks to snitch info. Because token range info is not part of the gossipinfo. But how does node1 knows about the token ranges of nodeA?
Q2. Let's assume nodeA is offline at that moment. Would node1 knows about this offline status after it had forwarded the write request to nodeA? Then node1 would make a new attempt to forward the write request to either nodeB or nodeC. In this case, how does node1 knows that nodeB or nodeC hold the replicas of nodeA?
Q3. Let's assume nodeA is working OK. It receives the write request from node1 and handled the write successfully. Then nodeA must fulfill the relication fctor 3 by asking nodeB and nodeC to store a copy. Based on the explanation of the video course, this is b/c B and C are neighbors of A. But how does A knows that B and C are its neighbors?
I am wondering if there are some deterministic rules that allows to a node to compute (node, neighbor) = f(partition) based on some cluster topology params.
Thanks for any clarification.