Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 可以指定到主节点或主分片上执行SQL吗?
[TiDB Usage Environment] Production Environment
[TiDB Version] v5.3.0
[Reproduction Path] Successfully update a piece of data in the current thread, then after a 9ms interval, the MQ message processing will query the previously updated data and find that it cannot be found.
[Encountered Problem: Problem Phenomenon and Impact] Is it caused by replication delay? Can we force reading data from the primary shard?
Is this querying the previously updated data in the same session? Could you describe it in more detail? By default, TiDB read and write operations occur on the region leader node, which is the primary shard. If you enable something like follower read, it will read data from other replicas.
By default, read and write operations are performed on the leader node.
Are you using multiple threads and multiple transactions? The updated data might not have been committed yet, so other transactions haven’t been able to retrieve it?
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.