Skip to content

Commit 151a7c9

Browse files
committed
Don't use tsdb codec for recovery_source fields
1 parent a2b6617 commit 151a7c9

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,9 +558,6 @@ tests:
558558
- class: org.elasticsearch.xpack.ml.integration.InferenceIT
559559
method: testInferClassificationModel
560560
issue: https://github.com/elastic/elasticsearch/issues/133448
561-
- class: org.elasticsearch.xpack.logsdb.LogsIndexingIT
562-
method: testShrink
563-
issue: https://github.com/elastic/elasticsearch/issues/133875
564561

565562
# Examples:
566563
#

server/src/main/java/org/elasticsearch/index/codec/PerFieldFormatSupplier.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.elasticsearch.index.mapper.Mapper;
2828
import org.elasticsearch.index.mapper.MapperService;
2929
import org.elasticsearch.index.mapper.SeqNoFieldMapper;
30+
import org.elasticsearch.index.mapper.SourceFieldMapper;
3031
import org.elasticsearch.index.mapper.vectors.DenseVectorFieldMapper;
3132

3233
/**
@@ -127,6 +128,11 @@ boolean useTSDBDocValuesFormat(final String field) {
127128

128129
private boolean excludeFields(String fieldName) {
129130
// TODO: should we just allow all fields to use tsdb doc values codec?
131+
// Values of these doc_values fields can be filtered out in RecoverySourcePruneMergePolicy,
132+
// which leads to inconsistencies between merge stats and actual values.
133+
if (SourceFieldMapper.RECOVERY_SOURCE_SIZE_NAME.equals(fieldName) || SourceFieldMapper.RECOVERY_SOURCE_NAME.equals(fieldName)) {
134+
return true;
135+
}
130136
// Avoid using tsdb codec for fields like _seq_no, _primary_term.
131137
// But _tsid and _ts_routing_hash should always use the tsdb codec.
132138
return fieldName.startsWith("_")

0 commit comments

Comments
 (0)