Repository navigation
[fix][metadata] Set revalidateAfterReconnection true for certain failures - #17664
Merged
eolivelli merged 1 commit intoSep 18, 2022
Merged
Conversation
merlimat
approved these changes
Sep 15, 2022
merlimat
left a comment
Contributor
There was a problem hiding this comment.
Great catch! It was definitely a mistake :/
lhotari
approved these changes
Sep 15, 2022
lhotari
left a comment
Member
There was a problem hiding this comment.
Nice catch! An additional test would be nice too.
michaeljmarshall
marked this pull request as ready for review
September 15, 2022 05:38
Member
Author
|
Thanks for confirming! |
Member
Author
I can look at adding a test tomorrow. |
mattisonchao
approved these changes
Sep 15, 2022
Member
|
I think this bug may cause forget to invalidate |
| @@ -196,6 +196,7 @@ synchronized void lockWasInvalidated() { | |||
| // We failed to revalidate the lock due to connectivity issue | |||
Member
There was a problem hiding this comment.
Plus, I think we also need to handle LockBusyException here that throws by doRevalidate method, which can avoid forgetting to complete expiredFuture.
2 of 13 tasks
Jason918
approved these changes
Sep 17, 2022
eolivelli
approved these changes
Sep 18, 2022
Technoboy-
pushed a commit
that referenced
this pull request
Sep 19, 2022
nicoloboschi
pushed a commit
to datastax/pulsar
that referenced
this pull request
Sep 19, 2022
…ures (apache#17664) (cherry picked from commit c40c7ee)
aloyszhang
pushed a commit
to aloyszhang/pulsar
that referenced
this pull request
Jan 9, 2023
…est !188) Squash merge branch 'release_2.8.1.4_fix_metadata' into 'release-2.8.1.4' Fixes #<xyz> ### Motivation chery pick了三个PR: PIP-45: Handle session events and invalidations from single thread (apache#12184) [fix][metadata] Set revalidateAfterReconnection true for certain failures apache#17664 [fix][metadata] Cleanup state when lock revalidation gets LockBusyException apache#17700 TAPD: --story=881235137
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.
Motivation
In reading through the
ResourceLockImpl, I noticed thatrevalidateAfterReconnectionis alwaysfalse. This seems like an oversight. It was introduced in #11886.Modifications
revalidateAfterReconnection = true;when there is a failure during lock validation.Verifying this change
I am not sure that this change will actually affect anything. In recently looking through the reconnection lo logs, I noticed the following two get logged together:
These logs relate to the following:
pulsar/pulsar-metadata/src/main/java/org/apache/pulsar/metadata/coordination/impl/LockManagerImpl.java
Lines 125 to 136 in 12ca27f
Note that the changes in this PR will affect how
lock.revalidateIfNeededAfterReconnection()will run, but if the lock is going to be revalidated in a subsequent call because there is always another ZK notification that triggers thelock.revalidate(lock.getValue()), then I am not sure that this PR is important. I'll continue looking into this.Documentation
doc-not-needed