Skip to content

Commit 4139c86

Browse files
Merge branch 'main' into fix_invalid_geo
2 parents 0c0119c + 01f59f0 commit 4139c86

File tree

13 files changed

+27
-26
lines changed

13 files changed

+27
-26
lines changed

libs/entitlement/src/main/java/org/elasticsearch/entitlement/bootstrap/EntitlementBootstrap.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ public record BootstrapArgs(
4343
Function<Class<?>, PolicyManager.PolicyScope> scopeResolver,
4444
PathLookup pathLookup,
4545
Map<String, Path> sourcePaths,
46-
Set<Class<?>> suppressFailureLogClasses
46+
Set<Package> suppressFailureLogPackages
4747
) {
4848
public BootstrapArgs {
4949
requireNonNull(pluginPolicies);
5050
requireNonNull(scopeResolver);
5151
requireNonNull(pathLookup);
5252
requireNonNull(sourcePaths);
53-
requireNonNull(suppressFailureLogClasses);
53+
requireNonNull(suppressFailureLogPackages);
5454
}
5555
}
5656

@@ -78,7 +78,7 @@ public static BootstrapArgs bootstrapArgs() {
7878
* @param tempDir the temp directory for Elasticsearch
7979
* @param logsDir the log directory for Elasticsearch
8080
* @param pidFile path to a pid file for Elasticsearch, or {@code null} if one was not specified
81-
* @param suppressFailureLogClasses classes for which we do not need or want to log Entitlements failures
81+
* @param suppressFailureLogPackages packages for which we do not need or want to log Entitlements failures
8282
*/
8383
public static void bootstrap(
8484
Policy serverPolicyPatch,
@@ -95,7 +95,7 @@ public static void bootstrap(
9595
Path logsDir,
9696
Path tempDir,
9797
Path pidFile,
98-
Set<Class<?>> suppressFailureLogClasses
98+
Set<Package> suppressFailureLogPackages
9999
) {
100100
logger.debug("Loading entitlement agent");
101101
if (EntitlementBootstrap.bootstrapArgs != null) {
@@ -119,7 +119,7 @@ public static void bootstrap(
119119
settingResolver
120120
),
121121
sourcePaths,
122-
suppressFailureLogClasses
122+
suppressFailureLogPackages
123123
);
124124
exportInitializationToAgent();
125125
loadAgent(findAgentJar());

libs/entitlement/src/main/java/org/elasticsearch/entitlement/initialization/EntitlementInitialization.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private static PolicyManager createPolicyManager() {
9090
EntitlementBootstrap.bootstrapArgs().sourcePaths(),
9191
ENTITLEMENTS_MODULE,
9292
pathLookup,
93-
bootstrapArgs.suppressFailureLogClasses()
93+
bootstrapArgs.suppressFailureLogPackages()
9494
);
9595
}
9696

libs/entitlement/src/main/java/org/elasticsearch/entitlement/runtime/policy/PolicyManager.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ ModuleEntitlements policyEntitlements(String componentName, Path componentPath,
256256
private final Map<String, Map<String, List<Entitlement>>> pluginsEntitlements;
257257
private final Function<Class<?>, PolicyScope> scopeResolver;
258258
private final PathLookup pathLookup;
259-
private final Set<Class<?>> mutedClasses;
259+
private final Set<Package> suppressFailureLogPackages;
260260

261261
public static final String ALL_UNNAMED = "ALL-UNNAMED";
262262

@@ -311,7 +311,7 @@ public PolicyManager(
311311
Map<String, Path> sourcePaths,
312312
Module entitlementsModule,
313313
PathLookup pathLookup,
314-
Set<Class<?>> suppressFailureLogClasses
314+
Set<Package> suppressFailureLogPackages
315315
) {
316316
this.serverEntitlements = buildScopeEntitlementsMap(requireNonNull(serverPolicy));
317317
this.apmAgentEntitlements = apmAgentEntitlements;
@@ -322,7 +322,7 @@ public PolicyManager(
322322
this.sourcePaths = sourcePaths;
323323
this.entitlementsModule = entitlementsModule;
324324
this.pathLookup = requireNonNull(pathLookup);
325-
this.mutedClasses = suppressFailureLogClasses;
325+
this.suppressFailureLogPackages = suppressFailureLogPackages;
326326

327327
List<ExclusiveFileEntitlement> exclusiveFileEntitlements = new ArrayList<>();
328328
for (var e : serverEntitlements.entrySet()) {
@@ -688,8 +688,8 @@ public void checkWriteProperty(Class<?> callerClass, String property) {
688688

689689
private void notEntitled(String message, Class<?> callerClass, ModuleEntitlements entitlements) {
690690
var exception = new NotEntitledException(message);
691-
// Don't emit a log for muted classes, e.g. classes containing self tests
692-
if (mutedClasses.contains(callerClass) == false) {
691+
// Don't emit a log for suppressed packages, e.g. packages containing self tests
692+
if (suppressFailureLogPackages.contains(callerClass.getPackage()) == false) {
693693
entitlements.logger().warn("Not entitled: {}", message, exception);
694694
}
695695
throw exception;

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,6 @@ tests:
438438
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
439439
method: test {lookup-join.MvJoinKeyOnTheLookupIndex ASYNC}
440440
issue: https://github.com/elastic/elasticsearch/issues/128030
441-
- class: org.elasticsearch.compute.aggregation.PercentileIntGroupingAggregatorFunctionTests
442-
method: testManyInitialManyPartialFinalRunner
443-
issue: https://github.com/elastic/elasticsearch/issues/128092
444441
- class: org.elasticsearch.packaging.test.DockerTests
445442
method: test042KeystorePermissionsAreCorrect
446443
issue: https://github.com/elastic/elasticsearch/issues/128018

rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.repository_verify_integrity.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"description":"Verifies the integrity of the contents of a snapshot repository"
66
},
77
"stability":"experimental",
8-
"visibility":"private",
8+
"visibility":"public",
99
"headers": {
1010
"accept": [
1111
"application/json"

server/src/main/java/org/elasticsearch/bootstrap/Elasticsearch.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ private static void initPhase2(Bootstrap bootstrap) throws IOException {
264264
nodeEnv.logsDir(),
265265
nodeEnv.tmpDir(),
266266
args.pidFile(),
267-
Set.of(EntitlementSelfTester.class)
267+
Set.of(EntitlementSelfTester.class.getPackage())
268268
);
269269
EntitlementSelfTester.entitlementSelfTest();
270270

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
*/
2929
public class Elasticsearch900Lucene101Codec extends CodecService.DeduplicateFieldInfosCodec {
3030

31+
static final PostingsFormat DEFAULT_POSTINGS_FORMAT = new Lucene101PostingsFormat();
32+
3133
private final StoredFieldsFormat storedFieldsFormat;
3234

3335
private final PostingsFormat defaultPostingsFormat;
@@ -66,7 +68,7 @@ public Elasticsearch900Lucene101Codec() {
6668
public Elasticsearch900Lucene101Codec(Zstd814StoredFieldsFormat.Mode mode) {
6769
super("Elasticsearch900Lucene101", new Lucene101Codec());
6870
this.storedFieldsFormat = mode.getFormat();
69-
this.defaultPostingsFormat = new Lucene101PostingsFormat();
71+
this.defaultPostingsFormat = DEFAULT_POSTINGS_FORMAT;
7072
this.defaultDVFormat = new Lucene90DocValuesFormat();
7173
this.defaultKnnVectorsFormat = new Lucene99HnswVectorsFormat();
7274
}

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import org.apache.lucene.codecs.DocValuesFormat;
1313
import org.apache.lucene.codecs.KnnVectorsFormat;
1414
import org.apache.lucene.codecs.PostingsFormat;
15-
import org.apache.lucene.codecs.lucene101.Lucene101PostingsFormat;
1615
import org.apache.lucene.codecs.lucene90.Lucene90DocValuesFormat;
1716
import org.apache.lucene.codecs.lucene99.Lucene99HnswVectorsFormat;
1817
import org.elasticsearch.common.util.BigArrays;
@@ -34,13 +33,12 @@
3433
* vectors.
3534
*/
3635
public class PerFieldFormatSupplier {
37-
public static final FeatureFlag USE_LUCENE101_POSTINGS_FORMAT = new FeatureFlag("use_lucene101_postings_format");
36+
public static final FeatureFlag USE_DEFAULT_LUCENE_POSTINGS_FORMAT = new FeatureFlag("use_default_lucene_postings_format");
3837

3938
private static final DocValuesFormat docValuesFormat = new Lucene90DocValuesFormat();
4039
private static final KnnVectorsFormat knnVectorsFormat = new Lucene99HnswVectorsFormat();
4140
private static final ES819TSDBDocValuesFormat tsdbDocValuesFormat = new ES819TSDBDocValuesFormat();
4241
private static final ES812PostingsFormat es812PostingsFormat = new ES812PostingsFormat();
43-
private static final Lucene101PostingsFormat lucene101PostingsFormat = new Lucene101PostingsFormat();
4442
private static final PostingsFormat completionPostingsFormat = PostingsFormat.forName("Completion101");
4543

4644
private final ES87BloomFilterPostingsFormat bloomFilterPostingsFormat;
@@ -53,10 +51,10 @@ public PerFieldFormatSupplier(MapperService mapperService, BigArrays bigArrays)
5351
this.bloomFilterPostingsFormat = new ES87BloomFilterPostingsFormat(bigArrays, this::internalGetPostingsFormatForField);
5452

5553
if (mapperService != null
56-
&& USE_LUCENE101_POSTINGS_FORMAT.isEnabled()
54+
&& USE_DEFAULT_LUCENE_POSTINGS_FORMAT.isEnabled()
5755
&& mapperService.getIndexSettings().getIndexVersionCreated().onOrAfter(IndexVersions.USE_LUCENE101_POSTINGS_FORMAT)
5856
&& mapperService.getIndexSettings().getMode() == IndexMode.STANDARD) {
59-
defaultPostingsFormat = lucene101PostingsFormat;
57+
defaultPostingsFormat = Elasticsearch900Lucene101Codec.DEFAULT_POSTINGS_FORMAT;
6058
} else {
6159
// our own posting format using PFOR
6260
defaultPostingsFormat = es812PostingsFormat;

server/src/main/java/org/elasticsearch/index/store/LuceneFilesExtensions.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ public enum LuceneFilesExtensions {
8383
VEMQ("vemq", "Scalar Quantized Vector Metadata", true, false),
8484
VEQ("veq", "Scalar Quantized Vector Data", false, true),
8585
VEMB("vemb", "Binarized Vector Metadata", true, false),
86-
VEB("veb", "Binarized Vector Data", false, true);
86+
VEB("veb", "Binarized Vector Data", false, true),
87+
// ivf vectors format
88+
MIVF("mivf", "IVF Metadata", true, false),
89+
CENIVF("cenivf", "IVF Centroid Data", false, true),
90+
CLIVF("clivf", "IVF Cluster Data", false, true);
8791

8892
/**
8993
* Allow plugin developers of custom codecs to opt out of the assertion in {@link #fromExtension}

server/src/test/java/org/elasticsearch/index/codec/PerFieldMapperCodecTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public void testUseBloomFilter() throws IOException {
9494
assertThat(perFieldMapperCodec.getPostingsFormatForField("_id"), instanceOf(ES87BloomFilterPostingsFormat.class));
9595
assertThat(perFieldMapperCodec.useBloomFilter("another_field"), is(false));
9696

97-
Class<? extends PostingsFormat> expectedPostingsFormat = PerFieldFormatSupplier.USE_LUCENE101_POSTINGS_FORMAT.isEnabled()
97+
Class<? extends PostingsFormat> expectedPostingsFormat = PerFieldFormatSupplier.USE_DEFAULT_LUCENE_POSTINGS_FORMAT.isEnabled()
9898
&& timeSeries == false ? Lucene101PostingsFormat.class : ES812PostingsFormat.class;
9999
assertThat(perFieldMapperCodec.getPostingsFormatForField("another_field"), instanceOf(expectedPostingsFormat));
100100
}
@@ -110,7 +110,7 @@ public void testUseBloomFilterWithTimestampFieldEnabled() throws IOException {
110110
public void testUseBloomFilterWithTimestampFieldEnabled_noTimeSeriesMode() throws IOException {
111111
PerFieldFormatSupplier perFieldMapperCodec = createFormatSupplier(true, false, false);
112112
assertThat(perFieldMapperCodec.useBloomFilter("_id"), is(false));
113-
Class<? extends PostingsFormat> expectedPostingsFormat = PerFieldFormatSupplier.USE_LUCENE101_POSTINGS_FORMAT.isEnabled()
113+
Class<? extends PostingsFormat> expectedPostingsFormat = PerFieldFormatSupplier.USE_DEFAULT_LUCENE_POSTINGS_FORMAT.isEnabled()
114114
? Lucene101PostingsFormat.class
115115
: ES812PostingsFormat.class;
116116
assertThat(perFieldMapperCodec.getPostingsFormatForField("_id"), instanceOf(expectedPostingsFormat));

0 commit comments

Comments
 (0)