Hi, Asya,
Thanks for your reply. My question is when the clusterTime of MongoS is T1, and after it sending a query to the MongoD with clusterTime T0, the HLC of MongoD is still T0, but it’ll track the T1. So what’s the reason of this tracking and including?
As the A1.3 chapter said in this paper:
1. Client sends a write command to the primary, the message includes its current value of the ClusterTime: T1.
2. Primary node receives the message and advances its ClusterTime to T1, if T1 is greater than the primary node’s current ClusterTime value.
3. Primary node “ticks” the cluster time to T2 in the process of preparing the OpTime for the write. This is the only time a new value of ClusterTime is generated.
4. Primary node writes to the oplog.
5. Result is returned to the client, it includes the new
ClusterTime T2.
6. The client advances its ClusterTime to T2.
Checkout the step2, it looks like the Primary Node will advance the HLC to T1 once receive the message, so in my understanding, both query and write can advance the HLC to T1, but only write can tick the HLC to T2.