Skip to content

Fix index.mapping.use_doc_values_skippers defaults in serverless#139526

Closed
romseygeek wants to merge 6 commits intoelastic:mainfrom
romseygeek:bug/host-name-index-version
Closed

Fix index.mapping.use_doc_values_skippers defaults in serverless#139526
romseygeek wants to merge 6 commits intoelastic:mainfrom
romseygeek:bug/host-name-index-version

Conversation

@romseygeek
Copy link
Contributor

We can't detect whether or not we are in serverless during default value
setup because we don't have node settings at this point. This removes
all serverless/stateful detection logic from here, as the various different
index structure changes made during development were never released
and we can use some much simpler checks.

We can't detect whether or not we are in serverless during default
value setup because we don't have node settings at this point.  This
removes all serverless/stateful detection logic from here, as the
various different index structure changes made during development
were never released and we can use some much simpler checks.
@romseygeek romseygeek requested a review from martijnvg December 15, 2025 13:38
@romseygeek romseygeek self-assigned this Dec 15, 2025
@romseygeek romseygeek added >bug test-release Trigger CI checks against release build :StorageEngine/Mapping The storage related side of mappings v9.3.0 labels Dec 15, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

@elasticsearchmachine
Copy link
Collaborator

Hi @romseygeek, I've created a changelog YAML for you.

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

public static final Setting<Boolean> USE_DOC_VALUES_SKIPPER = Setting.boolSetting("index.mapping.use_doc_values_skipper", s -> {
IndexVersion iv = SETTING_INDEX_VERSION_CREATED.get(s);
if (MODE.get(s) == IndexMode.TIME_SERIES) {
if (DiscoveryNode.isStateless(s)) {
Copy link
Contributor

@salvatore-campagna salvatore-campagna Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: I was looking into this issue and noticed that the DiscoveryNode.isStateless(s) calls in the default function might never have worked because s is index settings but stateless.enabled is a NodeScope setting. Is that the root cause here?

Also, do we need any stateless-specific handling elsewhere (like in the IndexSettings constructor using nodeSettings)? I'm thinking of the pattern we use for recoverySourceSyntheticEnabled. Just want to make sure we're not missing something for the timestamp case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that the root cause here?

Yes, exactly. We should be fine elsewhere as nothing here has actually been released - it's all post-9.2 or behind a feature flag.

@jordan-powers
Copy link
Contributor

jordan-powers commented Dec 16, 2025

I confirmed that the same test fails on this PR as in the serverless-fix PR #139532.

Reproduce with:

./gradlew :x-pack:plugin:logsdb:qa:rolling-upgrade:bcUpgradeTest -Dtests.class="org.elasticsearch.xpack.logsdb.RandomizedRollingUpgradeIT" -Dtests.method="testIndexingStandardSource" -Dtests.bwc.main.version=9.3.0-SNAPSHOT -Dtests.bwc.refspec.main=31d034824763bd0c6e76f0e282a9241f11a9b3ed -Dtests.seed=DF23618074EC7280 --info

The error:

java.lang.AssertionError: errors in bulk response:
     {took=0, items=[{create={_index=test-index-standard-0, _id=16, error={reason=cannot change field "ruLbCWwiEg.oTzMzhQGD" from docValuesSkipIndexType=RANGE to inconsistent docValuesSkipIndexType=NONE, type=illegal_argument_exception}, status=400}}, {create={_index=test-index-standard-0, _id=17, error={reason=cannot change field "ruLbCWwiEg.oTzMzhQGD" from docValuesSkipIndexType=RANGE to inconsistent docValuesSkipIndexType=NONE, type=illegal_argument_exception}, status=400}}, {create={_index=test-index-standard-0, _id=18, error={reason=cannot change field "ruLbCWwiEg.oTzMzhQGD" from docValuesSkipIndexType=RANGE to inconsistent docValuesSkipIndexType=NONE, type=illegal_argument_exception}, status=400}}, {create={_index=test-index-standard-0, _id=19, error={reason=cannot change field "ruLbCWwiEg.oTzMzhQGD" from docValuesSkipIndexType=RANGE to inconsistent docValuesSkipIndexType=NONE, type=illegal_argument_exception}, status=400}}, {create={_index=test-index-standard-0, _id=20, error={reason=cannot change field "ruLbCWwiEg.oTzMzhQGD" from docValuesSkipIndexType=RANGE to inconsistent docValuesSkipIndexType=NONE, type=illegal_argument_exception}, status=400}}, {create={_index=test-index-standard-0, _id=21, error={reason=cannot change field "ruLbCWwiEg.oTzMzhQGD" from docValuesSkipIndexType=RANGE to inconsistent docValuesSkipIndexType=NONE, type=illegal_argument_exception}, status=400}}, {create={result=created, _shards={total=2, failed=0, successful=1}, _seq_no=22, _index=test-index-standard-0, forced_refresh=true, _id=22, _version=1, _primary_term=3, status=201}}, {create={_index=test-index-standard-0, _id=23, error={reason=cannot change field "ruLbCWwiEg.oTzMzhQGD" from docValuesSkipIndexType=RANGE to inconsistent docValuesSkipIndexType=NONE, type=illegal_argument_exception}, status=400}}], errors=true}
    Expected: <false>
         but: was <true>
        at __randomizedtesting.SeedInfo.seed([DF23618074EC7280:821DDC7665512016]:0)
        at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
        at org.elasticsearch.test.ESTestCase.assertThat(ESTestCase.java:2813)
        at org.elasticsearch.xpack.logsdb.RandomizedRollingUpgradeIT.indexDocuments(RandomizedRollingUpgradeIT.java:166)
        at org.elasticsearch.xpack.logsdb.RandomizedRollingUpgradeIT.testIndexing(RandomizedRollingUpgradeIT.java:123)
        at org.elasticsearch.xpack.logsdb.RandomizedRollingUpgradeIT.testIndexingStandardSource(RandomizedRollingUpgradeIT.java:133)

The problem is that at the index version STANDARD_INDEXES_USE_SKIPPERS (which is the latest index version in serverless right now), skippers are enabled by default in snapshot builds. But after this PR, the setting is disabled by default. I added eff7223 to fix the other PR, we might consider something similar here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :StorageEngine/Mapping The storage related side of mappings Team:StorageEngine test-release Trigger CI checks against release build v9.4.0

5 participants