Skip to content

Commit 18845df

Browse files
Merge branch 'main' into wlm/rule-sync
Signed-off-by: Kaushal Kumar <[email protected]>
2 parents 63d6678 + a6724d3 commit 18845df

File tree

28 files changed

+377
-213
lines changed

28 files changed

+377
-213
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1111
- Update API of Message in index to add the timestamp for lag calculation in ingestion polling ([#17977](https://github.com/opensearch-project/OpenSearch/pull/17977/))
1212
- Add composite directory factory ([#17988](https://github.com/opensearch-project/OpenSearch/pull/17988))
1313
- [Rule based auto-tagging] Add refresh based synchronization service for `Rule`s ([#18128](https://github.com/opensearch-project/OpenSearch/pull/18128))
14+
- Add pull-based ingestion error metrics and make internal queue size configurable ([#18088](https://github.com/opensearch-project/OpenSearch/pull/18088))
1415

1516
### Changed
16-
- Avoid invalid retries in multiple replicas when querying [#17370](https://github.com/opensearch-project/OpenSearch/pull/17370)
1717

1818
### Dependencies
1919
- Bump `com.google.code.gson:gson` from 2.12.1 to 2.13.0 ([#17923](https://github.com/opensearch-project/OpenSearch/pull/17923))

build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,6 @@ subprojects {
551551
includeClasses.add("org.opensearch.snapshots.SnapshotStatusApisIT")
552552
includeClasses.add("org.opensearch.test.rest.ClientYamlTestSuiteIT")
553553
includeClasses.add("org.opensearch.upgrade.DetectEsInstallationTaskTests")
554-
includeClasses.add("org.opensearch.cluster.MinimumClusterManagerNodesIT")
555554
}
556555
}
557556
}

distribution/packages/src/common/systemd/opensearch.service

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ WorkingDirectory=/usr/share/opensearch
2626
User=opensearch
2727
Group=opensearch
2828

29+
ExecStartPre=/bin/mkdir -p /dev/shm/performanceanalyzer
30+
ExecStartPre=/bin/chown opensearch:opensearch /dev/shm/performanceanalyzer
31+
2932
ExecStart=/usr/share/opensearch/bin/systemd-entrypoint -p ${PID_DIR}/opensearch.pid --quiet
3033

3134
# StandardOutput is configured to redirect to journalctl since
@@ -130,6 +133,7 @@ RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
130133

131134
ReadWritePaths=/var/log/opensearch
132135
ReadWritePaths=/var/lib/opensearch
136+
ReadWritePaths=/dev/shm/
133137
ReadWritePaths=-/etc/opensearch
134138
ReadWritePaths=-/mnt/snapshots
135139

@@ -149,17 +153,25 @@ RestrictNamespaces=true
149153
NoNewPrivileges=true
150154

151155
# Memory and execution protection
152-
MemoryDenyWriteExecute=true # Prevent creating writable executable memory mappings
153-
SystemCallArchitectures=native # Allow only native system calls
154-
KeyringMode=private # Service does not share key material with other services
155-
LockPersonality=true # Prevent changing ABI personality
156-
RestrictSUIDSGID=true # Prevent creating SUID/SGID files
157-
RestrictRealtime=true # Prevent acquiring realtime scheduling
158-
ProtectHostname=true # Prevent changes to system hostname
159-
ProtectKernelLogs=true # Prevent reading/writing kernel logs
160-
ProtectClock=true # Prevent tampering with the system clock
156+
157+
# Allow only native system calls
158+
SystemCallArchitectures=native
159+
# Service does not share key material with other services
160+
KeyringMode=private
161+
# Prevent changing ABI personality
162+
LockPersonality=true
163+
# Prevent creating SUID/SGID files
164+
RestrictSUIDSGID=true
165+
# Prevent acquiring realtime scheduling
166+
RestrictRealtime=true
167+
# Prevent changes to system hostname
168+
ProtectHostname=true
169+
# Prevent reading/writing kernel logs
170+
ProtectKernelLogs=true
171+
# Prevent tampering with the system clock
172+
ProtectClock=true
161173

162174
[Install]
163175
WantedBy=multi-user.target
164176

165-
# Built for ${project.name}-${project.version} (${project.name})
177+
# Built for ${project.name}-${project.version} (${project.name})

libs/core/src/main/java/org/opensearch/OpenSearchException.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -302,12 +302,8 @@ public Map<String, List<String>> getHeaders() {
302302
* Returns the rest status code associated with this exception.
303303
*/
304304
public RestStatus status() {
305-
return status(this);
306-
}
307-
308-
public static RestStatus status(Throwable t) {
309-
Throwable cause = ExceptionsHelper.unwrapCause(t);
310-
if (cause == t) {
305+
Throwable cause = unwrapCause();
306+
if (cause == this) {
311307
return RestStatus.INTERNAL_SERVER_ERROR;
312308
} else {
313309
return ExceptionsHelper.status(cause);

plugins/ingestion-kafka/src/internalClusterTest/java/org/opensearch/plugin/kafka/RemoteStoreKafkaIT.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.opensearch.index.query.BoolQueryBuilder;
2323
import org.opensearch.index.query.RangeQueryBuilder;
2424
import org.opensearch.index.query.TermQueryBuilder;
25+
import org.opensearch.indices.pollingingest.PollingIngestStats;
2526
import org.opensearch.test.InternalTestCluster;
2627
import org.opensearch.test.OpenSearchIntegTestCase;
2728
import org.opensearch.transport.client.Requests;
@@ -135,6 +136,8 @@ public void testErrorStrategy() throws Exception {
135136
// malformed message
136137
produceData("2", "", "");
137138
produceData("3", "name3", "25");
139+
produceData("{\"_op_type\":\"invalid\",\"_source\":{\"name\":\"name4\", \"age\": 25}}");
140+
produceData("5", "name5", "25");
138141

139142
internalCluster().startClusterManagerOnlyNode();
140143
final String node = internalCluster().startDataOnlyNode();
@@ -147,6 +150,7 @@ public void testErrorStrategy() throws Exception {
147150
.put("ingestion_source.type", "kafka")
148151
.put("ingestion_source.error_strategy", "block")
149152
.put("ingestion_source.pointer.init.reset", "earliest")
153+
.put("ingestion_source.internal_queue_size", "1000")
150154
.put("ingestion_source.param.topic", topicName)
151155
.put("ingestion_source.param.bootstrap_servers", kafka.getBootstrapServers())
152156
.put("index.replication.type", "SEGMENT")
@@ -165,7 +169,15 @@ public void testErrorStrategy() throws Exception {
165169
.get();
166170
waitForState(() -> "drop".equalsIgnoreCase(getSettings(indexName, "index.ingestion_source.error_strategy")));
167171
resumeIngestion(indexName);
168-
waitForSearchableDocs(2, Arrays.asList(node));
172+
waitForSearchableDocs(3, Arrays.asList(node));
173+
174+
PollingIngestStats stats = client().admin().indices().prepareStats(indexName).get().getIndex(indexName).getShards()[0]
175+
.getPollingIngestStats();
176+
assertNotNull(stats);
177+
assertThat(stats.getMessageProcessorStats().totalFailedCount(), is(1L));
178+
assertThat(stats.getMessageProcessorStats().totalFailuresDroppedCount(), is(1L));
179+
assertThat(stats.getConsumerStats().totalConsumerErrorCount(), is(0L));
180+
assertThat(stats.getConsumerStats().totalPollerMessageDroppedCount(), is(1L));
169181
}
170182

171183
public void testPauseAndResumeIngestion() throws Exception {
@@ -372,6 +384,13 @@ public void testExternalVersioning() throws Exception {
372384
assertThat(rangeQueryResponse.getHits().getTotalHits().value(), is(2L));
373385
return true;
374386
});
387+
388+
// validate processor stats
389+
PollingIngestStats stats = client().admin().indices().prepareStats(indexName).get().getIndex(indexName).getShards()[0]
390+
.getPollingIngestStats();
391+
assertNotNull(stats);
392+
assertThat(stats.getMessageProcessorStats().totalProcessedCount(), is(11L));
393+
assertThat(stats.getMessageProcessorStats().totalVersionConflictsCount(), is(3L));
375394
}
376395

377396
public void testExternalVersioningWithDisabledGCDeletes() throws Exception {

plugins/transport-reactor-netty4/src/javaRestTest/java/org/opensearch/rest/ReactorNetty4StreamingStressIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public void tearDown() throws Exception {
4444
super.tearDown();
4545
}
4646

47+
@AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/issues/15840")
4748
public void testCloseClientStreamingRequest() throws Exception {
4849
final VirtualTimeScheduler scheduler = VirtualTimeScheduler.create(true);
4950

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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -135,19 +135,6 @@ public void testFileDescriptorLimit() throws IOException, InterruptedException {
135135
limits.contains("Max open files unlimited unlimited"));
136136
}
137137

138-
public void testSystemCallFilter() throws IOException, InterruptedException {
139-
// Check if Seccomp is enabled
140-
String seccomp = executeCommand("sudo su -c 'grep Seccomp /proc/" + opensearchPid + "/status'", "Failed to read Seccomp status");
141-
assertFalse("Seccomp should be enabled", seccomp.contains("0"));
142-
143-
// Test specific system calls that should be blocked
144-
String rebootResult = executeCommand("sudo su opensearch -c 'kill -s SIGHUP 1' 2>&1 || echo 'Operation not permitted'", "Failed to test reboot system call");
145-
assertTrue("Reboot system call should be blocked", rebootResult.contains("Operation not permitted"));
146-
147-
String swapResult = executeCommand("sudo su opensearch -c 'swapon -a' 2>&1 || echo 'Operation not permitted'", "Failed to test swap system call");
148-
assertTrue("Swap system call should be blocked", swapResult.contains("Operation not permitted"));
149-
}
150-
151138
public void testOpenSearchProcessCannotExit() throws IOException, InterruptedException {
152139

153140
String scriptPath;

release-notes/opensearch.release-notes-3.0.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
- Deprecate CamelCase PathHierarchy tokenizer name ([#10894](https://github.com/opensearch-project/OpenSearch/pull/10894))
2626
- Rename Class ending with Plugin to Module under modules dir ([#4042](https://github.com/opensearch-project/OpenSearch/pull/4042))
2727
- Remove deprecated `batch_size` parameter from `_bulk` ([#14283](https://github.com/opensearch-project/OpenSearch/issues/14283))
28+
- Unset discovery nodes for every transport node actions request ([#17682](https://github.com/opensearch-project/OpenSearch/pull/17682))
2829

2930
### Added
3031
- Support for HTTP/2 (server-side) ([#3847](https://github.com/opensearch-project/OpenSearch/pull/3847))
@@ -96,7 +97,6 @@
9697
- Introduce mapping transformer to allow transform mappings during index create/update or index template create/update ([#17635](https://github.com/opensearch-project/OpenSearch/pull/17635))
9798
- Introduce new dynamic cluster setting to tune maxMergeAtOnce at cluster level ([#17774](https://github.com/opensearch-project/OpenSearch/pull/17774))
9899
- Add multi-threaded writer support in pull-based ingestion ([#17912](https://github.com/opensearch-project/OpenSearch/pull/17912))
99-
- Unset discovery nodes for every transport node actions request ([#17682](https://github.com/opensearch-project/OpenSearch/pull/17682))
100100
- [Star Tree] Support of Boolean Queries in Aggregations ([#17941](https://github.com/opensearch-project/OpenSearch/pull/17941))
101101
- Enabled default throttling for all tasks submitted to cluster manager ([#17711](https://github.com/opensearch-project/OpenSearch/pull/17711))
102102

server/src/internalClusterTest/java/org/opensearch/cluster/MinimumClusterManagerNodesIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ public void testTwoNodesNoClusterManagerBlock() throws Exception {
250250
}
251251
}
252252

253+
@AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/issues/14289")
253254
public void testThreeNodesNoClusterManagerBlock() throws Exception {
254255
internalCluster().setBootstrapClusterManagerNodeIndex(2);
255256

server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationResizeRequestIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
@OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.TEST, numDataNodes = 2)
3232
public class SegmentReplicationResizeRequestIT extends SegmentReplicationBaseIT {
3333

34+
@AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/issues/17552")
3435
public void testCreateShrinkIndexThrowsExceptionWhenReplicasBehind() throws Exception {
3536

3637
// create index with -1 as refresh interval as we are blocking segrep and we want to control refreshes.

0 commit comments

Comments
 (0)