host -> solr.host.advertise in EnvToSyspropMappings - #4715
Conversation
Since host is deprecated.
|
glad to see this getting fixed; I've noticed this warning lately when running Solr |
| SOLR_HIDDEN_SYS_PROPS=solr.hiddenSysProps | ||
| SOLR_HOME=solr.solr.home | ||
| SOLR_HOST_ADVERTISE=host | ||
| SOLR_HOST_ADVERTISE=solr.host.advertise |
There was a problem hiding this comment.
huh... I was under the impression that this was needed for NON-STANDARD mappings. I will dig in more. I assumed that all caps underscroe would convert. I notice however that we also have SOLR_HIDDEN_SYS_PROPS, and I didn't think it would be needed.
There was a problem hiding this comment.
In that case it sounds like removing the line is better. A suitable regression test would be to verify that no mappings in EnvToSyspropMappings.properties result in deprecated system properties in DeprecatedSystemPropertyMappings.properties (as was the case here).
There was a problem hiding this comment.
want to try it? I'm going to dig more in and see if maybe there is a bug in how we handle the mappings. Let me know!
There was a problem hiding this comment.
It's common for HOST env to be defined automatically. Definitely doesn't mean the Solr user has an outdated mapping.
We could add a custom rule to default solr.host.name from HOST env.
There was a problem hiding this comment.
okay, chatted with Claude, and your intuition @msternermxy is right. We don't need SOLR_HOST_ADVERTISE=solr.host.advertise, it doesn't hurt anything, but doesn't do anything at all as well. I am checking some other settings in this file as well.
|
So I agree, this should be removed since "host" has been deprecated for a while and now removed. But there are a few places in the code that it needs to be fixed. https://github.com/apache/solr/blob/main/solr/core/src/java/org/apache/solr/util/tracing/SimplePropagator.java#L45 I think those are the last remnants. |
…warnings Several other EnvToSyspropMappings.properties entries had the same bug as SOLR_HOST_ADVERTISE: they pointed at a legacy/intermediate sysprop name that DeprecatedSystemPropertyMappings.properties also treats as deprecated, so setting the env var tripped EnvUtils' own deprecation-forwarding logic on itself, producing a confusing warning even though the value still resolved correctly via that indirection.
| * deliberately excluded here: it shares a target sysprop with that other test, and this test | ||
| * would clobber it with a non-boolean value depending on random test execution order. | ||
| * | ||
| * <p>The LogListener is scoped to only these six properties' names (rather than listening for |
There was a problem hiding this comment.
I was on the fence about this test, both all the comments and the use of loglisterner, but since this bug was "already there" and didn't get caught, I liked having this very much more rigourse test.
| # CamelCase properties are mapped to dot separated lowercase | ||
| # This way, env SOLR_FOO_BAR will also match property 'solr.foo.bar' without a mapping in this file | ||
| # TODO: Deprecate non-standard sysprops and standardize on solr.foo.bar in Solr 10 | ||
| # Mapping from Environment variable to system property. |
There was a problem hiding this comment.
redoing this comment to make it clear hopefully for the future
| SOLR_ALWAYS_ON_TRACE_ID=solr.alwaysOnTraceId | ||
| SOLR_AUTH_JWT_ALLOW_OUTBOUND_HTTP=solr.auth.jwt.allowOutboundHttp | ||
| SOLR_HIDDEN_SYS_PROPS=solr.hiddenSysProps | ||
| SOLR_ALWAYS_ON_TRACE_ID=solr.tracing.always.on.enabled |
There was a problem hiding this comment.
turns out the pattern that avoids "double hops" is to use the permanant property name. not the old name that then needs another hop of conversion!
#c8c5142bcc8521c01ccd0a93b424c885885cd70e has these changes... |
1 similar comment
#c8c5142bcc8521c01ccd0a93b424c885885cd70e has these changes... |
|
@msternermxy i hope it was okay I pushed up some changes.... would love a review @dsmiley @HoustonPutman ... |
| // These have different names than the environment variables | ||
| assertEquals(ENV.get("SOLR_HOME"), EnvUtils.getProperty("solr.solr.home")); | ||
| assertEquals(ENV.get("SOLR_HOST_ADVERTISE"), EnvUtils.getProperty("host")); | ||
| assertEquals(ENV.get("SOLR_HOST_ADVERTISE"), EnvUtils.getProperty("solr.host.advertise")); |
There was a problem hiding this comment.
This changed assertion no longer makes sense in this test method
Asserting that no system property mapped from an environment variable by EnvToSyspropMappings.properties is deprecated by DeprecatedSystemPropertyMappings.properties.
Of course! Seems my oneliner draft PR served its purpose well, even though not a single line of it remains... :-) I additionally added the regression test I had in mind, based on cross-verifying the two properties files. |
Fixes https://issues.apache.org/jira/browse/SOLR-18337
Description
During the implementation of SIP-21,
hostseems to have been mistakenly left in as the system property mapped toSOLR_HOST_ADVERTISEinstead of the non-deprecatedsolr.host.advertise.Solution
Removing the
hosttosolr.host.advertisemapping fromEnvToSyspropMappings.properties.Tests
I have not tested the fix.
Checklist
Please review the following and check all that apply:
mainbranch../gradlew check.