Skip to content

Commit 8de918b

Browse files
authored
Disable utf-8 parsing optimization (elastic#135172)
A yet to be understood issue has emerged with the utf8 parsing optimization and the meantime we should disable the optimization. It looks like the wrong values are returned for fields. In the case of the test failures here, that surfaced as unable to the parse fields with IPs and causing index request to fail. However the impact could be larger.
1 parent 33fdf29 commit 8de918b

File tree

3 files changed

+3
-64
lines changed

3 files changed

+3
-64
lines changed

libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider/json/JsonXContentParser.java

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import com.fasterxml.jackson.core.JsonToken;
1717
import com.fasterxml.jackson.core.exc.InputCoercionException;
1818
import com.fasterxml.jackson.core.exc.StreamConstraintsException;
19-
import com.fasterxml.jackson.core.filter.FilteringParserDelegate;
2019
import com.fasterxml.jackson.core.io.JsonEOFException;
2120

2221
import org.elasticsearch.core.IOUtils;
@@ -27,7 +26,6 @@
2726
import org.elasticsearch.xcontent.XContentParserConfiguration;
2827
import org.elasticsearch.xcontent.XContentString;
2928
import org.elasticsearch.xcontent.XContentType;
30-
import org.elasticsearch.xcontent.provider.OptimizedTextCapable;
3129
import org.elasticsearch.xcontent.provider.XContentParserConfigurationImpl;
3230
import org.elasticsearch.xcontent.support.AbstractXContentParser;
3331

@@ -145,19 +143,7 @@ public String text() throws IOException {
145143

146144
@Override
147145
public XContentString optimizedText() throws IOException {
148-
if (currentToken().isValue() == false) {
149-
throwOnNoText();
150-
}
151-
var parser = this.parser;
152-
if (parser instanceof FilteringParserDelegate delegate) {
153-
parser = delegate.delegate();
154-
}
155-
if (parser instanceof OptimizedTextCapable optimizedTextCapableParser) {
156-
var bytesRef = optimizedTextCapableParser.getValueAsText();
157-
if (bytesRef != null) {
158-
return bytesRef;
159-
}
160-
}
146+
// TODO: enable utf-8 parsing optimization once verified it is completely safe
161147
return new Text(text());
162148
}
163149

muted-tests.yml

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -618,48 +618,12 @@ tests:
618618
- class: org.elasticsearch.search.vectors.CachingEnableFilterQueryTests
619619
method: testBooleanQuery
620620
issue: https://github.com/elastic/elasticsearch/issues/135124
621-
- class: org.elasticsearch.xpack.logsdb.qa.LogsDbVersusLogsDbReindexedIntoStandardModeChallengeRestIT
622-
method: testEsqlTermsAggregationByMethod
623-
issue: https://github.com/elastic/elasticsearch/issues/135125
624-
- class: org.elasticsearch.xpack.logsdb.qa.BulkStoredSourceChallengeRestIT
625-
method: testEsqlTermsAggregationByMethod
626-
issue: https://github.com/elastic/elasticsearch/issues/135126
627-
- class: org.elasticsearch.xpack.logsdb.qa.StandardVersusStandardReindexedIntoLogsDbChallengeRestIT
628-
method: testEsqlTermsAggregationByMethod
629-
issue: https://github.com/elastic/elasticsearch/issues/135127
630-
- class: org.elasticsearch.xpack.logsdb.qa.BulkChallengeRestIT
631-
method: testEsqlTermsAggregationByMethod
632-
issue: https://github.com/elastic/elasticsearch/issues/135128
633621
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
634622
method: test {p0=transform/transforms_start_stop/Test stop transform with force and wait_for_checkpoint true}
635623
issue: https://github.com/elastic/elasticsearch/issues/135135
636624
- class: org.elasticsearch.compute.aggregation.SampleIntAggregatorFunctionTests
637625
method: testSimpleWithCranky
638626
issue: https://github.com/elastic/elasticsearch/issues/135137
639-
- class: org.elasticsearch.xpack.logsdb.qa.BulkStoredSourceChallengeRestIT
640-
method: testTermsAggregation
641-
issue: https://github.com/elastic/elasticsearch/issues/135140
642-
- class: org.elasticsearch.xpack.logsdb.qa.LogsDbVersusLogsDbReindexedIntoStandardModeChallengeRestIT
643-
method: testTermsAggregation
644-
issue: https://github.com/elastic/elasticsearch/issues/135141
645-
- class: org.elasticsearch.xpack.logsdb.qa.BulkChallengeRestIT
646-
method: testTermsAggregation
647-
issue: https://github.com/elastic/elasticsearch/issues/135142
648-
- class: org.elasticsearch.xpack.logsdb.qa.StandardVersusStandardReindexedIntoLogsDbChallengeRestIT
649-
method: testTermsAggregation
650-
issue: https://github.com/elastic/elasticsearch/issues/135143
651-
- class: org.elasticsearch.xpack.logsdb.qa.BulkStoredSourceChallengeRestIT
652-
method: testMatchAllQuery
653-
issue: https://github.com/elastic/elasticsearch/issues/135144
654-
- class: org.elasticsearch.xpack.logsdb.qa.BulkChallengeRestIT
655-
method: testMatchAllQuery
656-
issue: https://github.com/elastic/elasticsearch/issues/135145
657-
- class: org.elasticsearch.xpack.logsdb.qa.LogsDbVersusLogsDbReindexedIntoStandardModeChallengeRestIT
658-
method: testMatchAllQuery
659-
issue: https://github.com/elastic/elasticsearch/issues/135146
660-
- class: org.elasticsearch.xpack.logsdb.qa.StandardVersusStandardReindexedIntoLogsDbChallengeRestIT
661-
method: testMatchAllQuery
662-
issue: https://github.com/elastic/elasticsearch/issues/135147
663627
- class: org.elasticsearch.lucene.RollingUpgradeSearchableSnapshotIndexCompatibilityIT
664628
method: testSearchableSnapshotUpgrade {p0=[9.2.0, 9.2.0, 9.2.0]}
665629
issue: https://github.com/elastic/elasticsearch/issues/135150
@@ -669,18 +633,6 @@ tests:
669633
- class: org.elasticsearch.discovery.ClusterDisruptionIT
670634
method: testAckedIndexing
671635
issue: https://github.com/elastic/elasticsearch/issues/117024
672-
- class: org.elasticsearch.xpack.logsdb.qa.BulkChallengeRestIT
673-
method: testHistogramAggregation
674-
issue: https://github.com/elastic/elasticsearch/issues/135153
675-
- class: org.elasticsearch.xpack.logsdb.qa.LogsDbVersusLogsDbReindexedIntoStandardModeChallengeRestIT
676-
method: testHistogramAggregation
677-
issue: https://github.com/elastic/elasticsearch/issues/135154
678-
- class: org.elasticsearch.xpack.logsdb.qa.StandardVersusStandardReindexedIntoLogsDbChallengeRestIT
679-
method: testHistogramAggregation
680-
issue: https://github.com/elastic/elasticsearch/issues/135155
681-
- class: org.elasticsearch.xpack.logsdb.qa.BulkStoredSourceChallengeRestIT
682-
method: testHistogramAggregation
683-
issue: https://github.com/elastic/elasticsearch/issues/135156
684636
- class: org.elasticsearch.compute.aggregation.SampleBytesRefAggregatorFunctionTests
685637
method: testSimpleWithCranky
686638
issue: https://github.com/elastic/elasticsearch/issues/135157

server/src/test/java/org/elasticsearch/common/xcontent/json/JsonXContentTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ public void testOptimizedTextHasBytes() throws Exception {
5959
assertSame(XContentParser.Token.FIELD_NAME, parser.nextToken());
6060
assertTrue(parser.nextToken().isValue());
6161
Text text = (Text) parser.optimizedText();
62-
assertTrue(text.hasBytes());
62+
// TODO: uncomment after utf8 optimized parsing has been enabled again:
63+
// assertTrue(text.hasBytes());
6364
assertThat(text.string(), equalTo("foo"));
6465
}
6566
}

0 commit comments

Comments
 (0)