snapshot: set `ReplicaRead` to false when `ReplicaReadType` fallbacks to `ReplicaReadLeader` (#1663)
Cherry pick #1663 to tidb-8.5
ref pingcap/tidb#61745
The replicaReadAdjuster can choose leader and follower replica after a request is created.
When the request is created as a replica-read request but fallback to leader read by replicaReadAdjuster, we need to set the replica_read to false as well. Unless it can perform a meaningless read-index in leader and harm the performance.
Before this PR
Many read-index proposals.
This PR
Few read-index proposals.
@glorv @zyguan I pushed an empty commit to trigger CI and the LGTM tag is removed, so I need your approve again, thanks.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: glorv, zyguan
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [glorv,zyguan]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
[LGTM Timeline notifier]
Timeline:
2025-06-30 07:41:10.482232131 +0000 UTC m=+1294323.205411112: :ballot_box_with_check: agreed by glorv.2025-06-30 08:26:15.488228585 +0000 UTC m=+1297028.211407566: :ballot_box_with_check: agreed by zyguan.2025-07-01 08:14:49.995013009 +0000 UTC m=+1382742.718191985: :heavy_multiplication_x::repeat: reset by you06.2025-07-01 08:54:31.48545135 +0000 UTC m=+1385124.208630327: :ballot_box_with_check: agreed by glorv.2025-07-01 11:08:42.496982418 +0000 UTC m=+1393175.220161397: :ballot_box_with_check: agreed by zyguan.