-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-26180 Introduce a initial refresh interval for RpcConnectionReg… #3601
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
Conversation
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
if (refreshNow) { | ||
return minTimeBetweenRefreshesMs; | ||
} | ||
if (firstRefresh) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this works ok for a large cluster once we populate the stubs of all the bootstrap nodes. But for a smaller cluster (<=10), populateStubs() returns everything. So its likely that even after the first refresh, all the subsequent refreshes hit the same bunch of nodes at the same time.
It looks to me like the right way to fix this is to add jitter to the refreshTime? jitter is a random sleep between (0, n) so that we spread out the calls, this is for all the refreshes and not just the first refresh, WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think jitter is used to solve another problem? It is always good to add a jitter to periodically requests to reduce the possibility to request at the same time.
For the purpose of this issue, let me just paste the description here first to see it can help you to understand better
Introduce a initial refresh interval for RpcConnectionRegistry so we can get the new list soon once we connect to the cluster.
As end users could configure any nodes in a cluster as the initial bootstrap nodes, it is possible that different end users will configure the same machine which makes the machine over load. So we should have a shorter delay for the initial refresh, to let users quickly switch to the bootstrap nodes we want them to connect to.
Free feel to ask if you have other concerns.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry interpreted it as something else totally. I thought you were talking about what if all requests hit the servers at the same time and suggested jitter, my bad!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of minor comments, but lgtm otherwise.
if (refreshNow) { | ||
return minTimeBetweenRefreshesMs; | ||
} | ||
if (firstRefresh) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry interpreted it as something else totally. I thought you were talking about what if all requests hit the servers at the same time and suggested jitter, my bad!
hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcConnectionRegistry.java
Show resolved
Hide resolved
return minTimeBetweenRefreshesMs; | ||
} | ||
if (firstRefresh) { | ||
return initialDelayMs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor edge case is initialDelayMs > periodicRefreshMs (like in a misconfiguration), that needs to be handled ?
(or) we can make initialDelayMs = periodicRefreshMs/4 or something like that, essentially a f(periodicRefreshMs) rather than a separate config, whatever works for you, I don't have a preference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a new config option is needed, but the default value could be periodicRefreshMs/4 or /5, if users explicitly set it, we will use the value set by users. WDYT?
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
Any other concerns? @bharathv Thanks. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…istry (#3601) Signed-off-by: Xin Sun <ddupgs@gmail.com>
…istry