-
Notifications
You must be signed in to change notification settings - Fork 686
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
SOLR-17106: LBSolrClient - Make zombie ping checks configurable #2160
Conversation
…gure the liveness checker to only inspect a URL ever N runs
…ts, add detailed javadocs
This PR had no visible activity in the past 60 days, labeling it as stale. Any new activity will remove the stale label. To attract more reviewers, please tag someone or notify the [email protected] mailing list. Thank you for your contribution! |
Aparna, are we just missing use of EnvUtils here? I know we've taken this change as-is (in our fork) but even we don't have that, thus it's hard to actually use the changes configured here. |
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.
We need to update the merge conflicts, review some of the formatting etc. And lastly, to use the right method of looking up settings. I think @dsmiley has already approved the direction, which makes me more comfortable about merging it.
* Positive values can be used to ensure that the liveness checks for a given URL will only be | ||
* run every "Nth" iteration of the setAliveCheckInterval | ||
* | ||
* @param aliveCheckSkipIters, number of iterations to skip, an int value * |
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.
did this mean to have a trailing *
?
public LBHttp2SolrClient.Builder setAliveCheckSkipIters(int aliveCheckSkipIters) { | ||
if (aliveCheckSkipIters < 0) { | ||
throw new IllegalArgumentException( | ||
("Alive Check Skip Iterations must be positive, specified value = " |
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.
do we need the doubled (
here? Maybe for string parsing?
/** | ||
* Positive values can be used to ensure that the liveness checks for a given URL will only be | ||
* run every "Nth" iteration of the setAliveCheckInterval | ||
* @param aliveCheckSkipIters, number of iterations to skip, an int value * |
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.
again the trailing *
public Builder setAliveCheckSkipIters(int aliveCheckSkipIters) { | ||
if (aliveCheckSkipIters < 0) { | ||
throw new IllegalArgumentException( | ||
("Alive Check Skip Iterations must be positive, specified value = " |
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.
and the doubled (
@@ -79,24 +81,27 @@ public abstract class LBSolrClient extends SolrClient { | |||
|
|||
protected long aliveCheckIntervalMillis = | |||
TimeUnit.MILLISECONDS.convert(60, TimeUnit.SECONDS); // 1 minute between checks | |||
protected int aliveCheckSkipIters = 0; |
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.
Do we use the short hand Iters
in lots of places? If not, I like the full Iteration
as just one less thing to read.
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.
maybe just a personal thing though.
log.debug("Assuming success because aliveCheckQuery is null"); | ||
return true; | ||
} | ||
log.debug("Running ping check on server " + zombieServer.getBaseUrl()); |
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.
likewise on the check?
} | ||
// push back on liveness checks only every Nth iteration | ||
if (zombieServer.skipAliveCheckIters > 0) { | ||
log.debug( |
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.
the ifDebugEnabled check
if (!zombieServer.standard && zombieServer.failedPings >= NONSTANDARD_PING_LIMIT) { | ||
zombieServers.remove(zombieServer.getBaseUrl()); | ||
if (isServerAlive(zombieServer)) { | ||
log.debug("Successfully pinged server " + zombieServer.getBaseUrl() + ", marking it alive"); |
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.
and the check
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.
Always use "{}" templates in SLF4J
} | ||
|
||
} catch (Exception e) { | ||
log.debug( |
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.
and the check! I think the whole check thing is werid that it's not just part of log.debug!
@@ -205,16 +202,31 @@ public void testTwoServers() throws Exception { | |||
} | |||
} | |||
|
|||
public void testReliability() throws Exception { | |||
@LogLevel("org.apache.solr.client.solrj.impl.LBSolrClient=DEBUG") |
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.
is this needed to make the test pass, or from working on the code? the @loglevel?
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.
ah, I think I see why you have it from looking lower down in the LogReliablityTestSetup
This PR has had no activity for 60 days and is now labeled as stale. Any new activity or converting it to draft will remove the stale label. To attract more reviewers, please tag people who might be familiar with the code area and/or notify the [email protected] mailing list. Thank you for your contribution! |
This PR is now closed due to 60 days of inactivity after being marked as stale. Re-opening this PR is still possible, in which case it will be marked as active again. |
https://issues.apache.org/jira/browse/SOLR-17106
Description
Please provide a short description of the changes you're making with this pull request.
The issue involves scalability challenges in SolrJ's LBSolrClient when a pod with numerous cores experiences connectivity problems. The "zombie" ping checking mechanism, operating on a core basis, becomes a bottleneck during distributed search on a massive multi shard collection. Threads attempting to reach unhealthy cores contribute to a high computational load, causing performance issues.
LBSolrClient could be configured to disable zombie "ping" checks, but retain zombie tracking. Once a replica/endpoint is identified as a zombie, it could be held in zombie state for X seconds, before being released - hoping that by this timeframe ZK would be updated to mark this endpoint DOWN or the pod is back up and CloudSolrClient would avoid querying it. In any event, only 1 failed query would be needed to send the server back to zombie state.
Dev list thread: https://lists.apache.org/thread/f0zfmpg0t48xrtppyfsmfc5ltzsq2qqh
Solution
Please provide a short description of the approach taken to implement your solution.
Modified the code to make zombie ping checking configurable through a new property named "enableZombiePingChecks." When set to true, the system is designed to periodically send zombie ping requests every zombiePingIntervalMillis. Conversely, setting it to false disables zombie pings and instead monitors the "zombieServers" every zombieStateMonitoringIntervalMillis. This monitoring identifies replicas or endpoints that have spent at least minZombieReleaseTimeMillis as zombies, subsequently releasing them from the zombie state and adding them back to the alive set.
The default configuration for zombiePingIntervalMillis remains at 1 minute, while zombieStateMonitoringIntervalMillis is currently set to 5 seconds, and minZombieReleaseTimeMillis is configured at 10 seconds.
Corresponding tests in TestLBHttp2SolrClient and TestLBHttpSolrClient have been adjusted accordingly.
Tests
Please describe the tests you've developed or run to confirm this patch implements the feature or solves the problem.
Slight refactoring in TestLBHttp2SolrClient and TestLBHttpSolrClient, added a new test testReliabilityWithoutZombiePingChecks in TestLBHttp2SolrClient. All tests pass.
Checklist
Please review the following and check all that apply:
main
branch../gradlew check
.