fix(pd): keep KvClient watches alive after reconnect failures - #3157
Open
contrueCT wants to merge 1 commit into
Open
fix(pd): keep KvClient watches alive after reconnect failures#3157contrueCT wants to merge 1 commit into
contrueCT wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of the PR
KvClientpreviously retried a failed watch only once. If that reconnect also failed, thewatch stopped permanently, and unexpected stream completion did not trigger recovery.
The reconnect path also exposed a lifecycle issue:
AbstractClient.resetStub()invoked thevirtual
close()method, so transport initialization on aKvClientdispatched toKvClient.close()and marked the whole client closed.Main Changes
AbstractClienttransport cleanup from the overridable client lifecycle close.onError,Leader_Changed, and unexpectedonCompletedwith a fixed delay until thewatch recovers or the client closes.
KvClient.close()is called.changes, completion, deduplication, stale observers, prefix semantics, and close behavior.
This PR does not add event replay, protocol revisions, PD Server changes, or the Server-side
reconciliation tracked by #3151. Events emitted while a watch is disconnected are still not
replayed.
Verifying these changes
mvn -q -o test -pl hugegraph-pd/hg-pd-test -am -Dtest=KvClientTest -DfailIfNoTests=false -Drat.skip=true -Djacoco.skip=true(12 tests, 0 failures/errors)mvn -q -o package -pl hugegraph-pd -am -DskipTests -Dmaven.javadoc.skip=true -Drat.skip=true -Djacoco.skip=truemvn -q -o -f hugegraph-pd/hg-pd-client/pom.xml apache-rat:checkmvn -q -o -f hugegraph-pd/hg-pd-test/pom.xml apache-rat:checkThe full local PD suite was also attempted. The common suite passed 83/83 and the core suite
passed 89/91 with 2 skipped. The client suite could not complete without a local PD service at
127.0.0.1:8686(4 failures and 5 errors reported connection refused), which prevented the restsuite from executing in that Maven run.
Repository-wide RAT is not a valid signal in this checkout because pre-existing ignored
.upgrade-artifactsfiles produce 68 unrelated unapproved-license entries; RAT passes for bothchanged modules.
Does this PR potentially affect the following parts?
Documentation Status
Doc - TODODoc - DoneDoc - No Need