Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue of doesn't fast fail request when no available connections #1339

Merged
merged 1 commit into from May 13, 2024

Conversation

crazycs520
Copy link
Contributor

@crazycs520 crazycs520 commented May 11, 2024

Ref pingcap/tidb#53222

https://github.com/tikv/client-go/pull/1098/files#diff-289d0ab3e9da9a88db8dcf8ed7095af6756da3ea8da38212b352742a83d93ba2L383

If do not cancel the request in time, the upper layer will wait until it times out, and we should cancel requests when no available connections and let the upper layer try another replica again.

Before This PR:

Benchmark test with stop 1 tikv store. Many slow query execution time exceed 1 min.

image

This PR:

Many slow query execution time is less than 25s.

image

@crazycs520 crazycs520 marked this pull request as ready for review May 11, 2024 12:08
Copy link
Contributor

@cfzjywxk cfzjywxk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@MyonKeminta MyonKeminta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM

internal/client/client_batch.go Outdated Show resolved Hide resolved
Signed-off-by: crazycs520 <crazycs520@gmail.com>
@cfzjywxk cfzjywxk merged commit c82e921 into tikv:master May 13, 2024
10 checks passed
crazycs520 added a commit to crazycs520/client-go that referenced this pull request May 14, 2024
cfzjywxk pushed a commit that referenced this pull request May 14, 2024
…1339) (#1341)

* fix issue of doesn't fast fail request when no available connections (#1339)

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* refine error msg (#1338)

* refine error msg

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* refine

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* fix test

Signed-off-by: crazycs520 <crazycs520@gmail.com>

---------

Signed-off-by: crazycs520 <crazycs520@gmail.com>

---------

Signed-off-by: crazycs520 <crazycs520@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants