Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -456,34 +456,20 @@ tests:
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
method: test {p0=snapshot/20_operator_privileges_disabled/Operator only settings can be set and restored by non-operator user when operator privileges is disabled}
issue: https://github.com/elastic/elasticsearch/issues/120973
- class: org.elasticsearch.xpack.inference.action.filter.ShardBulkInferenceActionFilterIT
method: testBulkOperations {p0=false}
issue: https://github.com/elastic/elasticsearch/issues/120975
- class: org.elasticsearch.packaging.test.DockerTests
issue: https://github.com/elastic/elasticsearch/issues/120978
- class: org.elasticsearch.xpack.esql.qa.multi_node.RestEsqlIT
method: testInternalRange {ASYNC}
issue: https://github.com/elastic/elasticsearch/issues/120979
- class: org.elasticsearch.xpack.esql.qa.multi_node.RestEsqlIT
method: testWarningHeadersOnFailedConversions {ASYNC}
issue: https://github.com/elastic/elasticsearch/issues/120980
- class: org.elasticsearch.xpack.security.authc.jwt.JwtRealmSingleNodeTests
method: testActivateProfileForJWT
issue: https://github.com/elastic/elasticsearch/issues/120983
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
method: testProfileIndexAutoCreation
issue: https://github.com/elastic/elasticsearch/issues/120987
- class: org.elasticsearch.xpack.esql.qa.multi_node.RestEsqlIT
method: testOutOfRangeComparisons {ASYNC}
issue: https://github.com/elastic/elasticsearch/issues/121007
- class: org.elasticsearch.xpack.security.authc.service.ServiceAccountIT
method: testAuthenticateShouldNotFallThroughInCaseOfFailure
issue: https://github.com/elastic/elasticsearch/issues/120902
- class: org.elasticsearch.xpack.security.FileSettingsRoleMappingsRestartIT
method: testReservedStatePersistsOnRestart
issue: https://github.com/elastic/elasticsearch/issues/120923
- class: org.elasticsearch.xpack.esql.qa.multi_node.RestEsqlIT
issue: https://github.com/elastic/elasticsearch/issues/120948
- class: org.elasticsearch.datastreams.DataStreamsClientYamlTestSuiteIT
method: test {p0=data_stream/140_data_stream_aliases/Create data stream alias}
issue: https://github.com/elastic/elasticsearch/issues/120920
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static DirectoryReader create(
// When using synthetic source, the translog operation must always be reindexed into an in-memory Lucene to ensure consistent
// output for realtime-get operations. However, this can degrade the performance of realtime-get and update operations.
// If slight inconsistencies in realtime-get operations are acceptable, the translog operation can be reindexed lazily.
if (mappingLookup.isSourceSynthetic()) {
if (mappingLookup.isSourceSynthetic() || mappingLookup.inferenceFields().isEmpty() == false) {
onSegmentCreated.run();
leafReader = createInMemoryReader(shardId, engineConfig, directory, documentParser, mappingLookup, false, operation);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public boolean assertSameIndexOperation(Translog.Index o1, Translog.Index o2) th
if (super.assertSameIndexOperation(o1, o2)) {
return true;
}
if (engineConfig.getIndexSettings().isRecoverySourceSyntheticEnabled()) {
if (engineConfig.getIndexSettings().isRecoverySourceSyntheticEnabled()
|| engineConfig.getMapperService().mappingLookup().inferenceFields().isEmpty() == false) {
return super.assertSameIndexOperation(synthesizeSource(engineConfig, o1), o2)
|| super.assertSameIndexOperation(o1, synthesizeSource(engineConfig, o2));
}
Expand All @@ -60,26 +61,42 @@ static Translog.Index synthesizeSource(EngineConfig engineConfig, Translog.Index
TrivialQueryCachingPolicy.NEVER,
() -> {}
);
try (
LuceneSyntheticSourceChangesSnapshot snapshot = new LuceneSyntheticSourceChangesSnapshot(
engineConfig.getMapperService(),
searcher,
LuceneSyntheticSourceChangesSnapshot.DEFAULT_BATCH_SIZE,
Integer.MAX_VALUE,
op.seqNo(),
op.seqNo(),
true,
false,
engineConfig.getIndexSettings().getIndexVersionCreated()
)
) {
try (var snapshot = newSnapshot(engineConfig, op, searcher);) {
final Translog.Operation normalized = snapshot.next();
assert normalized != null : "expected one operation; got zero";
return (Translog.Index) normalized;
}
}
}

static Translog.Snapshot newSnapshot(EngineConfig engineConfig, Translog.Index op, Engine.Searcher searcher) throws IOException {
if (engineConfig.getIndexSettings().isRecoverySourceSyntheticEnabled()) {
return new LuceneSyntheticSourceChangesSnapshot(
engineConfig.getMapperService(),
searcher,
LuceneSyntheticSourceChangesSnapshot.DEFAULT_BATCH_SIZE,
Integer.MAX_VALUE,
op.seqNo(),
op.seqNo(),
true,
false,
engineConfig.getIndexSettings().getIndexVersionCreated()
);
} else {
return new LuceneChangesSnapshot(
engineConfig.getMapperService(),
searcher,
LuceneSyntheticSourceChangesSnapshot.DEFAULT_BATCH_SIZE,
op.seqNo(),
op.seqNo(),
true,
false,
false,
engineConfig.getIndexSettings().getIndexVersionCreated()
);
}
}

public boolean assertSameIndexOperation(Translog.Index o1, Translog.Index o2) throws IOException {
return Translog.Index.equalsWithoutAutoGeneratedTimestamp(o1, o2);
}
Expand Down