From 24c748dd2e29cdce69de5b7e70f064596d274390 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 21 May 2025 15:22:30 +0200 Subject: [PATCH 1/2] Temporarily disable use_default_lucene_postings_format feature flag. When the feature flag was enabled, there were many changes happening at the same time. Upgrade to Lucene 10.2 and enabling logsdb by default. The new default codec did have a regression, that was fixed in Lucene with the next bugfix release (apache/lucene#14445). However, there's been still some noise in the benchmark since standard index mode started to use the default lucene posting format. By temporarily disabling and then enabling after a few days, we hope to get more clarity about whether there is still a regression. --- .../org/elasticsearch/index/codec/PerFieldFormatSupplier.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/org/elasticsearch/index/codec/PerFieldFormatSupplier.java b/server/src/main/java/org/elasticsearch/index/codec/PerFieldFormatSupplier.java index b88ae698134b9..88dd2aea440a3 100644 --- a/server/src/main/java/org/elasticsearch/index/codec/PerFieldFormatSupplier.java +++ b/server/src/main/java/org/elasticsearch/index/codec/PerFieldFormatSupplier.java @@ -50,8 +50,10 @@ public PerFieldFormatSupplier(MapperService mapperService, BigArrays bigArrays) this.mapperService = mapperService; this.bloomFilterPostingsFormat = new ES87BloomFilterPostingsFormat(bigArrays, this::internalGetPostingsFormatForField); + // TODO: temporarily disable feature flag for a few days to see effect in benchmarks + boolean useDefaultLucenePostingsFormat = USE_DEFAULT_LUCENE_POSTINGS_FORMAT.isEnabled() && false; if (mapperService != null - && USE_DEFAULT_LUCENE_POSTINGS_FORMAT.isEnabled() + && useDefaultLucenePostingsFormat && mapperService.getIndexSettings().getIndexVersionCreated().onOrAfter(IndexVersions.USE_LUCENE101_POSTINGS_FORMAT) && mapperService.getIndexSettings().getMode() == IndexMode.STANDARD) { defaultPostingsFormat = Elasticsearch900Lucene101Codec.DEFAULT_POSTINGS_FORMAT; From b814b85d81bd9e36797868a0acfb61e51414bdaf Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 21 May 2025 17:18:00 +0200 Subject: [PATCH 2/2] tweak tests --- .../index/codec/PerFieldMapperCodecTests.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/server/src/test/java/org/elasticsearch/index/codec/PerFieldMapperCodecTests.java b/server/src/test/java/org/elasticsearch/index/codec/PerFieldMapperCodecTests.java index dcd43326dcbb1..0e6b51ec6d3a5 100644 --- a/server/src/test/java/org/elasticsearch/index/codec/PerFieldMapperCodecTests.java +++ b/server/src/test/java/org/elasticsearch/index/codec/PerFieldMapperCodecTests.java @@ -10,7 +10,6 @@ package org.elasticsearch.index.codec; import org.apache.lucene.codecs.PostingsFormat; -import org.apache.lucene.codecs.lucene101.Lucene101PostingsFormat; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; @@ -94,8 +93,7 @@ public void testUseBloomFilter() throws IOException { assertThat(perFieldMapperCodec.getPostingsFormatForField("_id"), instanceOf(ES87BloomFilterPostingsFormat.class)); assertThat(perFieldMapperCodec.useBloomFilter("another_field"), is(false)); - Class expectedPostingsFormat = PerFieldFormatSupplier.USE_DEFAULT_LUCENE_POSTINGS_FORMAT.isEnabled() - && timeSeries == false ? Lucene101PostingsFormat.class : ES812PostingsFormat.class; + Class expectedPostingsFormat = ES812PostingsFormat.class; assertThat(perFieldMapperCodec.getPostingsFormatForField("another_field"), instanceOf(expectedPostingsFormat)); } @@ -110,9 +108,7 @@ public void testUseBloomFilterWithTimestampFieldEnabled() throws IOException { public void testUseBloomFilterWithTimestampFieldEnabled_noTimeSeriesMode() throws IOException { PerFieldFormatSupplier perFieldMapperCodec = createFormatSupplier(true, false, false); assertThat(perFieldMapperCodec.useBloomFilter("_id"), is(false)); - Class expectedPostingsFormat = PerFieldFormatSupplier.USE_DEFAULT_LUCENE_POSTINGS_FORMAT.isEnabled() - ? Lucene101PostingsFormat.class - : ES812PostingsFormat.class; + Class expectedPostingsFormat = ES812PostingsFormat.class; assertThat(perFieldMapperCodec.getPostingsFormatForField("_id"), instanceOf(expectedPostingsFormat)); }