Repository navigation
SOLR-18630: Default wait for ZooKeeper at node startup is 30000 seconds instead of 30 - #5313
julianchandras wants to merge 3 commits into
Conversation
|
Automated PR triage (LLM-generated; may be wrong). Checked once, when the PR was opened or marked ready; not updated on later pushes. No clear mismatches in the answered judgements.
|
| } | ||
| for (String key : deprecatedProps.stringPropertyNames()) { | ||
| DEPRECATED_MAPPINGS.put(camelCaseToDotSeparated(deprecatedProps.getProperty(key)), key); | ||
| // A property may have several legacy names, separated by commas |
There was a problem hiding this comment.
in another PR that hasn't been merged i have the same thing!
| solr.cloud.prs.enabled=solr.prs.default | ||
| solr.cloud.startup.delete.unknown.cores.enabled=solr.delete.unknown.cores | ||
| solr.cloud.wait.for.zk.seconds=solr.wait.for.zk | ||
| solr.cloud.wait.for.zk.seconds=solr.wait.for.zk,wait.for.zk |
|
okay, I thought everything was good (and the narrow fix is fine) but then see my @dsmiley you may want to weigh in here, I think we have a naming challenge of two properties that do the same thing? Or overlap in meaning? Please see my comment that I put into the code chagne. |
dsmiley
left a comment
There was a problem hiding this comment.
What's the semantic difference question?
| @@ -0,0 +1,8 @@ | |||
| title: The default wait for ZooKeeper at node startup is 30 seconds again instead of 30000, and the deprecated -DwaitForZk system property works again with a deprecation warning | |||
There was a problem hiding this comment.
I'm going to be pedantic here: -DwaitForZk is java CLI flag that sets the waitForZk system property. It's not itself the system property. IMO just reference the latter; there are multiple ways to set a system property.
|
|
||
| // Someday this could be inlined... | ||
| static int getStartUpZkTimeOutSeconds() { | ||
| Integer waitSeconds = Integer.getInteger("solr.cloud.wait.for.zk.seconds"); |
There was a problem hiding this comment.
are we avoiding EnvUtils for some reason?
|
Any thoughts @dsmiley on the two different properties that maybe do the same thing? It appears that |
|
Eric, this is another case of you (in #3312) publicizing ( Which is itself sad... there's a fair amount of production code here in support of one test. I don't see any context as to how the problem was discovered @julianchandras . Does this related to that test or perhaps simply found it via code inspection? Or, does this affect Solr in the real world? If the latter, then the comment is inaccurate as it apparently serves a production purpose. @janhoy added the comment in 2023. The underlying code to connect to ZK here was added by @gus-asf in #416 in 2021. |
|
@dsmiley It wasn't a production incident. I'm currently working on a research tool that looks at past fixes and checks whether they still hold in the current Solr version. I found SOLR-18630 while checking against SOLR-14503, which reported an actual faulty behaviour of Solr in cloud mode. In this case, what I found is that the default wait is 30000s instead of 30s, and that the waitForZk system property isn't respected. I'm unsure about the TODO comment, but waitForZk came from user reports (SOLR-5129, SOLR-14503) and sets the connection timeout during startup, so I do think it matters outside the test |
https://issues.apache.org/jira/browse/SOLR-18630
Description
Since SOLR-17864, the default wait for ZooKeeper at node startup is 30000 seconds instead of 30. This is because when
solr.cloud.wait.for.zk.secondsis not set, the fallbackSolrZkClientTimeout.DEFAULT_ZK_CLIENT_TIMEOUT(already in milliseconds) is multiplied by 1000.Also, the legacy system property
-DwaitForZkis silently ignored, while the legacy env varSOLR_WAIT_FOR_ZKworks with a deprecation warning.Solution
NodeConfig.getStartUpZkTimeOutMillisconverts the property from seconds when it is set, and otherwise usesDEFAULT_ZK_CLIENT_TIMEOUTas is.SOLR_WAIT_FOR_ZKbecomessolr.wait.for.zk, while-DwaitForZkbecomeswait.for.zk), so a single entry inDeprecatedSystemPropertyMappings.propertiescan only match one of them. ModifiedEnvUtilsto accept several comma-separated legacy names per property, and updated the entry to list both.Written with Claude Code.
Tests
TestSolrXml.java: Test that the solr.cloud.wait.for.zk.seconds property is read with the right unitEnvUtilsTest.java: Test that the legacy-DwaitForZkandSOLR_WAIT_FOR_ZKsetsolr.cloud.wait.for.zk.secondsand log a deprecation warningTestSolrXmlmostly covers solr.xml parsing, so I'm happy to move the new tests if there is a better location.cc @epugh
Checklist
Please review the following and check all that apply: