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

log-backup: the subscription conntion may be create too many times when TiKV node restarts too fast #39688

Closed
YuJuncen opened this issue Dec 7, 2022 · 0 comments · Fixed by #39689
Labels
affects-6.5 severity/moderate type/bug The issue is confirmed as a bug.

Comments

@YuJuncen
Copy link
Contributor

YuJuncen commented Dec 7, 2022

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Change the code via the diff:

diff --git a/br/pkg/streamhelper/basic_lib_for_test.go b/br/pkg/streamhelper/basic_lib_for_test.go
index 882ac69ede..9598b5d376 100644
--- a/br/pkg/streamhelper/basic_lib_for_test.go
+++ b/br/pkg/streamhelper/basic_lib_for_test.go
@@ -133,7 +133,7 @@ func (t trivialFlushStream) Recv() (*logbackup.SubscribeFlushEventResponse, erro
                        return &item, nil
                default:
                }
-               return nil, t.cx.Err()
+               return nil, status.Error(codes.Canceled, t.cx.Err().Error())
        }
 }

This is a reasonable change because in real-world clusters, once the context for the server streaming canceled, gRPC yields this error instead of plain context.Canceled.

Then run the test TestHasFailureStores.

2. What did you expect to see? (Required)

The test passes.

3. What did you see instead (Required)

The test failed.

    /home/hillium/developer/tidb/br/pkg/streamhelper/subscription_test.go:107: 
        	Error Trace:	/home/hillium/developer/tidb/br/pkg/streamhelper/subscription_test.go:107
        	Error:      	Received unexpected error:
        	            	the following errors occurred:
        	            	 -  rpc error: code = Canceled desc = context canceled

4. What is your TiDB version? (Required)

Current master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.5 severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant