Skip to content

Commit 9a88327

Browse files
committed
Merge branch 'main' into fips_compliance2
2 parents 458f2c0 + 1acba95 commit 9a88327

File tree

48 files changed

+2186
-402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2186
-402
lines changed

.github/workflows/dependabot_pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
- name: Update the changelog
5959
uses: dangoslen/dependabot-changelog-helper@v4
6060
with:
61-
version: 'Unreleased 2.x'
61+
version: 'Unreleased 3.x'
6262

6363
- name: Commit the changes
6464
uses: stefanzweifel/git-auto-commit-action@v5

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
## [Unreleased 3.x]
77
### Added
88
- Change priority for scheduling reroute during timeout([#16445](https://github.com/opensearch-project/OpenSearch/pull/16445))
9+
- [Rule Based Auto-tagging] Add rule schema for auto tagging ([#17238](https://github.com/opensearch-project/OpenSearch/pull/17238))
910
- Renaming the node role search to warm ([#17573](https://github.com/opensearch-project/OpenSearch/pull/17573))
1011
- Introduce a new search node role to hold search only shards ([#17620](https://github.com/opensearch-project/OpenSearch/pull/17620))
12+
- Fix systemd integTest on deb regarding path ownership check ([#17641](https://github.com/opensearch-project/OpenSearch/pull/17641))
13+
- Add dfs transformation function in XContentMapValues ([#17612](https://github.com/opensearch-project/OpenSearch/pull/17612))
14+
15+
### Changed
16+
- Migrate BC libs to their FIPS counterparts ([#14912](https://github.com/opensearch-project/OpenSearch/pull/14912))
1117

1218
### Changed
1319
- Migrate BC libs to their FIPS counterparts ([#3420](https://github.com/opensearch-project/OpenSearch/pull/14912))
1420

1521
### Dependencies
22+
- Bump `com.nimbusds:nimbus-jose-jwt` from 9.41.1 to 10.0.2 ([#17607](https://github.com/opensearch-project/OpenSearch/pull/17607))
23+
- Bump `com.google.api:api-common` from 1.8.1 to 2.46.1 ([#17604](https://github.com/opensearch-project/OpenSearch/pull/17604))
1624
- Bump `ch.qos.logback:logback-core` from 1.5.16 to 1.5.17 ([#17609](https://github.com/opensearch-project/OpenSearch/pull/17609))
1725
- Bump `org.jruby.joni:joni` from 2.2.3 to 2.2.5 ([#17608](https://github.com/opensearch-project/OpenSearch/pull/17608))
1826
- Bump `dangoslen/dependabot-changelog-helper` from 3 to 4 ([#17498](https://github.com/opensearch-project/OpenSearch/pull/17498))
27+
- Bump `com.google.api:gax` from 2.35.0 to 2.63.1 ([#17465](https://github.com/opensearch-project/OpenSearch/pull/17465))
1928

2029
### Changed
2130

benchmarks/src/main/java20/org/opensearch/common/round/RoundableSupplier.java

Lines changed: 0 additions & 36 deletions
This file was deleted.

client/rest/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
*/
3030

3131
import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis
32+
import org.opensearch.gradle.precommit.TestingConventionsTasks
3233

3334
apply plugin: 'opensearch.build'
3435
apply plugin: 'opensearch.publish'

client/rest/src/test/java/org/opensearch/client/RestClientBuilderIntegTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public void makeRequest(KeyStoreType keyStoreType) throws Exception {
103103
try (RestClient client = buildRestClient()) {
104104
try {
105105
client.performRequest(new Request("GET", "/"));
106-
fail("connection should have been rejected due to SSL failure");
106+
fail("connection should have been rejected due to SSL handshake");
107107
} catch (Exception e) {
108108
assertThat(e.getCause(), instanceOf(SSLException.class));
109109
}

distribution/tools/keystore-cli/src/test/java/org/opensearch/tools/cli/keystore/KeyStoreWrapperTests.java

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -528,77 +528,6 @@ private byte[] generateV2() throws Exception {
528528
return fileBytes;
529529
}
530530

531-
private void generateV1() throws IOException, NoSuchAlgorithmException, NoSuchProviderException, CertificateException,
532-
InvalidKeySpecException, KeyStoreException {
533-
Path configDir = env.configDir();
534-
NIOFSDirectory directory = new NIOFSDirectory(configDir);
535-
try (IndexOutput output = EndiannessReverserUtil.createOutput(directory, "opensearch.keystore", IOContext.DEFAULT)) {
536-
CodecUtil.writeHeader(output, "opensearch.keystore", 1);
537-
output.writeByte((byte) 0); // hasPassword = false
538-
output.writeString("PKCS12");
539-
output.writeString("PBE");
540-
541-
SecretKeyFactory secretFactory = SecretKeyFactory.getInstance("PBE", "SunJCE");
542-
KeyStore keystore = KeyStoreFactory.getInstance(KeyStoreType.PKCS_12, "SUN");
543-
keystore.load(null, null);
544-
SecretKey secretKey = secretFactory.generateSecret(new PBEKeySpec("stringSecretValue".toCharArray()));
545-
KeyStore.ProtectionParameter protectionParameter = new KeyStore.PasswordProtection(new char[0]);
546-
keystore.setEntry("string_setting", new KeyStore.SecretKeyEntry(secretKey), protectionParameter);
547-
548-
ByteArrayOutputStream keystoreBytesStream = new ByteArrayOutputStream();
549-
keystore.store(keystoreBytesStream, new char[0]);
550-
byte[] keystoreBytes = keystoreBytesStream.toByteArray();
551-
output.writeInt(keystoreBytes.length);
552-
output.writeBytes(keystoreBytes, keystoreBytes.length);
553-
CodecUtil.writeFooter(output);
554-
}
555-
}
556-
557-
private byte[] generateV2() throws Exception {
558-
Path configDir = env.configDir();
559-
NIOFSDirectory directory = new NIOFSDirectory(configDir);
560-
byte[] fileBytes = new byte[20];
561-
random().nextBytes(fileBytes);
562-
try (IndexOutput output = EndiannessReverserUtil.createOutput(directory, "opensearch.keystore", IOContext.DEFAULT)) {
563-
564-
CodecUtil.writeHeader(output, "opensearch.keystore", 2);
565-
output.writeByte((byte) 0); // hasPassword = false
566-
output.writeString("PKCS12");
567-
output.writeString("PBE"); // string algo
568-
output.writeString("PBE"); // file algo
569-
570-
output.writeVInt(2); // num settings
571-
output.writeString("string_setting");
572-
output.writeString("STRING");
573-
output.writeString("file_setting");
574-
output.writeString("FILE");
575-
576-
SecretKeyFactory secretFactory = SecretKeyFactory.getInstance("PBE", "SunJCE");
577-
KeyStore keystore = KeyStoreFactory.getInstance(KeyStoreType.PKCS_12, "SUN");
578-
keystore.load(null, null);
579-
SecretKey secretKey = secretFactory.generateSecret(new PBEKeySpec("stringSecretValue".toCharArray()));
580-
KeyStore.ProtectionParameter protectionParameter = new KeyStore.PasswordProtection(new char[0]);
581-
keystore.setEntry("string_setting", new KeyStore.SecretKeyEntry(secretKey), protectionParameter);
582-
583-
byte[] base64Bytes = Base64.getEncoder().encode(fileBytes);
584-
char[] chars = new char[base64Bytes.length];
585-
for (int i = 0; i < chars.length; ++i) {
586-
chars[i] = (char) base64Bytes[i]; // PBE only stores the lower 8 bits, so this narrowing is ok
587-
}
588-
secretKey = secretFactory.generateSecret(new PBEKeySpec(chars));
589-
keystore.setEntry("file_setting", new KeyStore.SecretKeyEntry(secretKey), protectionParameter);
590-
591-
ByteArrayOutputStream keystoreBytesStream = new ByteArrayOutputStream();
592-
keystore.store(keystoreBytesStream, new char[0]);
593-
byte[] keystoreBytes = keystoreBytesStream.toByteArray();
594-
output.writeInt(keystoreBytes.length);
595-
output.writeBytes(keystoreBytes, keystoreBytes.length);
596-
CodecUtil.writeFooter(output);
597-
}
598-
599-
return fileBytes;
600-
}
601-
602531
private byte[] toByteArray(final InputStream is) throws IOException {
603532
final ByteArrayOutputStream os = new ByteArrayOutputStream();
604533
final byte[] buffer = new byte[1024];

libs/ssl-config/src/main/java/org/opensearch/common/ssl/PemUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060

6161
final class PemUtils {
6262

63-
private static final String BCFIPS = "BCFIPS";
63+
public static final String BCFIPS = "BCFIPS";
6464

6565
PemUtils() {
6666
throw new IllegalStateException("Utility class should not be instantiated");

plugins/repository-azure/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ dependencies {
6363
api "net.java.dev.jna:jna-platform:${versions.jna}"
6464
api 'com.microsoft.azure:msal4j:1.18.0'
6565
api 'com.nimbusds:oauth2-oidc-sdk:11.21'
66-
api 'com.nimbusds:nimbus-jose-jwt:9.41.1'
66+
api 'com.nimbusds:nimbus-jose-jwt:10.0.2'
6767
api 'com.nimbusds:content-type:2.3'
6868
api 'com.nimbusds:lang-tag:1.7'
6969
// Both msal4j:1.14.3 and oauth2-oidc-sdk:11.9.1 has compile dependency on different versions of json-smart,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
93347ea9247ae09e095575e10f9cae79c195fbb8

plugins/repository-azure/licenses/nimbus-jose-jwt-9.41.1.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.

plugins/repository-gcs/build.gradle

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ opensearchplugin {
4848
}
4949

5050
dependencies {
51-
api 'com.google.api:api-common:1.8.1'
52-
api 'com.google.api:gax:2.35.0'
51+
api 'com.google.api:api-common:2.46.1'
52+
api 'com.google.api:gax:2.63.1'
5353
api 'com.google.api:gax-httpjson:2.42.0'
5454

5555
api 'com.google.apis:google-api-services-storage:v1-rev20230617-2.0.0'
@@ -202,9 +202,26 @@ thirdPartyAudit {
202202
'javax.jms.Message',
203203
'javax.servlet.ServletContextEvent',
204204
'javax.servlet.ServletContextListener',
205-
// Bump for gax 2.42.0
206-
'com.google.api.gax.rpc.EndpointContext',
207-
'com.google.api.gax.rpc.RequestMutator'
205+
206+
// opentelemetry-api is an optional dependency of com.google.api:gax
207+
'io.opentelemetry.api.OpenTelemetry',
208+
'io.opentelemetry.api.common.Attributes',
209+
'io.opentelemetry.api.common.AttributesBuilder',
210+
'io.opentelemetry.api.metrics.DoubleHistogram',
211+
'io.opentelemetry.api.metrics.DoubleHistogramBuilder',
212+
'io.opentelemetry.api.metrics.LongCounter',
213+
'io.opentelemetry.api.metrics.LongCounterBuilder',
214+
'io.opentelemetry.api.metrics.Meter',
215+
'io.opentelemetry.api.metrics.MeterBuilder',
216+
217+
// slf4j is an optional dependency of com.google.api:gax
218+
'org.slf4j.ILoggerFactory',
219+
'org.slf4j.Logger',
220+
'org.slf4j.LoggerFactory',
221+
'org.slf4j.MDC',
222+
'org.slf4j.event.Level',
223+
'org.slf4j.helpers.NOPLogger',
224+
'org.slf4j.spi.LoggingEventBuilder'
208225
)
209226
}
210227

plugins/repository-gcs/licenses/api-common-1.8.1.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
b38a684c734963a72c204aa208dd31018d79bf3a

plugins/repository-gcs/licenses/gax-2.35.0.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6c9a340608a63e24dc8acd8da84afd8ffecca4b7

plugins/repository-s3/src/internalClusterTest/java/org/opensearch/repositories/s3/S3RemoteStoreIT.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakScope;
1212

13+
import org.apache.lucene.tests.util.LuceneTestCase;
1314
import org.opensearch.action.admin.indices.delete.DeleteIndexRequest;
1415
import org.opensearch.common.SuppressForbidden;
1516
import org.opensearch.common.blobstore.BlobPath;
@@ -42,6 +43,7 @@
4243
import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertAcked;
4344

4445
@ThreadLeakScope(ThreadLeakScope.Scope.NONE)
46+
@LuceneTestCase.AwaitsFix(bugUrl = "Flakiness seen for this class")
4547
public class S3RemoteStoreIT extends RemoteStoreCoreTestCase {
4648

4749
@Override

qa/systemd-test/src/test/java/org/opensearch/systemdinteg/SystemdIntegTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ public void testReadWritePaths() throws IOException, InterruptedException {
116116
assertTrue("Path should exist: " + path, checkPathExists(path));
117117
assertTrue("Path should be readable: " + path, checkPathReadable(path));
118118
assertTrue("Path should be writable: " + path, checkPathWritable(path));
119-
assertEquals("Path should be owned by opensearch:opensearch", "opensearch:opensearch", getPathOwnership(path));
119+
String ownership = getPathOwnership(path);
120+
assertTrue("Path should be owned by opensearch:opensearch or opensearch:adm", ownership.equals("opensearch:opensearch") || ownership.equals("opensearch:adm"));
120121
}
121122
}
122123

Lines changed: 35 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,21 @@
2121
import java.util.stream.Collectors;
2222

2323
import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_REPLICATION_TYPE;
24-
import static org.opensearch.cluster.routing.allocation.decider.SearchReplicaAllocationDecider.SEARCH_REPLICA_ROUTING_INCLUDE_GROUP_SETTING;
2524

2625
@OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.TEST, numDataNodes = 0)
27-
public class SearchReplicaFilteringAllocationIT extends RemoteStoreBaseIntegTestCase {
26+
public class SearchReplicaAllocationIT extends RemoteStoreBaseIntegTestCase {
2827

2928
@Override
3029
protected Settings featureFlagSettings() {
3130
return Settings.builder().put(super.featureFlagSettings()).put(FeatureFlags.READER_WRITER_SPLIT_EXPERIMENTAL, Boolean.TRUE).build();
3231
}
3332

34-
public void testSearchReplicaDedicatedIncludes() {
35-
List<String> nodesIds = internalCluster().startNodes(3);
36-
final String node_0 = nodesIds.get(0);
37-
final String node_1 = nodesIds.get(1);
38-
final String node_2 = nodesIds.get(2);
39-
assertEquals(3, cluster().size());
33+
public void testSearchReplicaAllocatedToDedicatedSearchNode() {
34+
internalCluster().startClusterManagerOnlyNode();
35+
String primaryNode = internalCluster().startDataOnlyNode();
36+
internalCluster().startSearchOnlyNode();
4037

41-
client().admin()
42-
.cluster()
43-
.prepareUpdateSettings()
44-
.setTransientSettings(
45-
Settings.builder().put(SEARCH_REPLICA_ROUTING_INCLUDE_GROUP_SETTING.getKey() + "_name", node_1 + "," + node_0)
46-
)
47-
.execute()
48-
.actionGet();
38+
assertEquals(3, cluster().size());
4939

5040
createIndex(
5141
"test",
@@ -57,42 +47,16 @@ public void testSearchReplicaDedicatedIncludes() {
5747
.build()
5848
);
5949
ensureGreen("test");
60-
// ensure primary is not on node 0 or 1,
50+
// ensure primary is not on searchNode
6151
IndexShardRoutingTable routingTable = getRoutingTable();
62-
assertEquals(node_2, getNodeName(routingTable.primaryShard().currentNodeId()));
63-
64-
String existingSearchReplicaNode = getNodeName(routingTable.searchOnlyReplicas().get(0).currentNodeId());
65-
String emptyAllowedNode = existingSearchReplicaNode.equals(node_0) ? node_1 : node_0;
66-
67-
// set the included nodes to the other open node, search replica should relocate to that node.
68-
client().admin()
69-
.cluster()
70-
.prepareUpdateSettings()
71-
.setTransientSettings(Settings.builder().put(SEARCH_REPLICA_ROUTING_INCLUDE_GROUP_SETTING.getKey() + "_name", emptyAllowedNode))
72-
.execute()
73-
.actionGet();
74-
ensureGreen("test");
75-
76-
routingTable = getRoutingTable();
77-
assertEquals(node_2, getNodeName(routingTable.primaryShard().currentNodeId()));
78-
assertEquals(emptyAllowedNode, getNodeName(routingTable.searchOnlyReplicas().get(0).currentNodeId()));
52+
assertEquals(primaryNode, getNodeName(routingTable.primaryShard().currentNodeId()));
7953
}
8054

8155
public void testSearchReplicaDedicatedIncludes_DoNotAssignToOtherNodes() {
82-
List<String> nodesIds = internalCluster().startNodes(3);
83-
final String node_0 = nodesIds.get(0);
84-
final String node_1 = nodesIds.get(1);
85-
final String node_2 = nodesIds.get(2);
56+
internalCluster().startNodes(2);
57+
final String node_1 = internalCluster().startSearchOnlyNode();
8658
assertEquals(3, cluster().size());
8759

88-
// set filter on 1 node and set search replica count to 2 - should leave 1 unassigned
89-
client().admin()
90-
.cluster()
91-
.prepareUpdateSettings()
92-
.setTransientSettings(Settings.builder().put(SEARCH_REPLICA_ROUTING_INCLUDE_GROUP_SETTING.getKey() + "_name", node_1))
93-
.execute()
94-
.actionGet();
95-
9660
logger.info("--> creating an index with no replicas");
9761
createIndex(
9862
"test",
@@ -115,9 +79,32 @@ public void testSearchReplicaDedicatedIncludes_DoNotAssignToOtherNodes() {
11579
assertEquals(1, routingTable.searchOnlyReplicas().stream().filter(ShardRouting::unassigned).count());
11680
}
11781

82+
public void testSearchReplicaDedicatedIncludes_WhenNotSetDoNotAssign() {
83+
internalCluster().startNodes(2);
84+
assertEquals(2, cluster().size());
85+
86+
createIndex(
87+
"test",
88+
Settings.builder()
89+
.put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1)
90+
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)
91+
.put(IndexMetadata.SETTING_NUMBER_OF_SEARCH_REPLICAS, 1)
92+
.put(SETTING_REPLICATION_TYPE, ReplicationType.SEGMENT)
93+
.build()
94+
);
95+
ensureYellowAndNoInitializingShards("test");
96+
IndexShardRoutingTable routingTable = getRoutingTable();
97+
assertNull(routingTable.searchOnlyReplicas().get(0).currentNodeId());
98+
99+
// Add a search node
100+
final String searchNode = internalCluster().startSearchOnlyNode();
101+
102+
ensureGreen("test");
103+
assertEquals(searchNode, getNodeName(getRoutingTable().searchOnlyReplicas().get(0).currentNodeId()));
104+
}
105+
118106
private IndexShardRoutingTable getRoutingTable() {
119-
IndexShardRoutingTable routingTable = getClusterState().routingTable().index("test").getShards().get(0);
120-
return routingTable;
107+
return getClusterState().routingTable().index("test").getShards().get(0);
121108
}
122109

123110
private String getNodeName(String id) {

0 commit comments

Comments
 (0)