Skip to content

Commit

Permalink
Bump version of Hadoop dependencies to 3.3.5 (opensearch-project#6995)
Browse files Browse the repository at this point in the history
Signed-off-by: Tianli Feng <[email protected]>
Signed-off-by: Andriy Redko <[email protected]>
  • Loading branch information
Tianli Feng authored Jul 25, 2023
1 parent b9b5e5c commit 6786608
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Bump `com.netflix.nebula.ospackage-base` from 11.3.0 to 11.4.0 ([#8838](https://github.com/opensearch-project/OpenSearch/pull/8838))
- Bump `com.google.http-client:google-http-client-gson` from 1.43.2 to 1.43.3 ([#8840](https://github.com/opensearch-project/OpenSearch/pull/8840))
- OpenJDK Update (July 2023 Patch releases) ([#8868](https://github.com/opensearch-project/OpenSearch/pull/8868)
- Bump `hadoop` libraries from 3.3.4 to 3.3.6 ([#6995](https://github.com/opensearch-project/OpenSearch/pull/6995))

### Changed
- Perform aggregation postCollection in ContextIndexSearcher after searching leaves ([#8303](https://github.com/opensearch-project/OpenSearch/pull/8303))
Expand Down
3 changes: 3 additions & 0 deletions distribution/src/config/jvm.options
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,6 @@ ${error.file}
# JDK 20+ Incubating Vector Module for SIMD optimizations;
# disabling may reduce performance on vector optimized lucene
20:--add-modules=jdk.incubator.vector

# HDFS ForkJoinPool.common() support by SecurityManager
-Djava.util.concurrent.ForkJoinPool.common.threadFactory=org.opensearch.secure_sm.SecuredForkJoinWorkerThreadFactory
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

package org.opensearch.secure_sm;

import java.security.AccessControlContext;
import java.security.AccessController;
import java.security.Permission;
import java.security.Permissions;
import java.security.PrivilegedAction;
import java.security.ProtectionDomain;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory;
import java.util.concurrent.ForkJoinWorkerThread;

public class SecuredForkJoinWorkerThreadFactory implements ForkJoinWorkerThreadFactory {
static AccessControlContext contextWithPermissions(Permission... perms) {
Permissions permissions = new Permissions();
for (Permission perm : perms)
permissions.add(perm);
return new AccessControlContext(new ProtectionDomain[] { new ProtectionDomain(null, permissions) });
}

// ACC for access to the factory
private static final AccessControlContext ACC = contextWithPermissions(
new RuntimePermission("getClassLoader"),
new RuntimePermission("setContextClassLoader"),
new RuntimePermission("modifyThreadGroup"),
new RuntimePermission("modifyThread")
);

public final ForkJoinWorkerThread newThread(ForkJoinPool pool) {
return AccessController.doPrivileged(new PrivilegedAction<>() {
public ForkJoinWorkerThread run() {
return new ForkJoinWorkerThread(pool) {

};
}
}, ACC);
}
}
6 changes: 5 additions & 1 deletion plugins/repository-hdfs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ opensearchplugin {
}

versions << [
'hadoop3': '3.3.4'
'hadoop3': '3.3.6'
]

testFixtures.useFixture ":test:fixtures:krb5kdc-fixture", "hdfs"
Expand Down Expand Up @@ -440,3 +440,7 @@ thirdPartyAudit {
'org.apache.avro.reflect.FieldAccessUnsafe$UnsafeShortField',
)
}

tasks.withType(JavaForkOptions) {
systemProperty "java.util.concurrent.ForkJoinPool.common.threadFactory", "org.opensearch.secure_sm.SecuredForkJoinWorkerThreadFactory"
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12ac6f103a0ff29fce17a078c7c64d25320b6165

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
81065531e63fccbe85fb04a3274709593fb00d3c

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ba40aca60f39599d5b1f1d32b35295bfde1f3c8b
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
* to ignore the offending thread until a version of Hadoop is released that addresses the incorrect
* interrupt handling.
*
* In Hadoop 3.3.6, the org.apache.hadoop.fs.statistics.impl.EvaluatingStatisticsMap uses ForkJoinPool
* to perform statistics calculation, leaving dangling workers.
*
* @see <a href="https://issues.apache.org/jira/browse/HADOOP-12829">https://issues.apache.org/jira/browse/HADOOP-12829</a>
* @see "org.apache.hadoop.fs.FileSystem.Statistics.StatisticsDataReferenceCleaner"
* @see "org.apache.hadoop.fs.FileSystem.Statistics"
Expand All @@ -53,6 +56,6 @@ public final class HdfsClientThreadLeakFilter implements ThreadFilter {

@Override
public boolean reject(Thread t) {
return t.getName().equals(OFFENDING_THREAD_NAME);
return t.getName().equals(OFFENDING_THREAD_NAME) || t.getName().startsWith("ForkJoinPool.commonPool-");
}
}

0 comments on commit 6786608

Please sign in to comment.