Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into HDDS-9827
Browse files Browse the repository at this point in the history
  • Loading branch information
tejaskriya committed Dec 14, 2023
2 parents 1f2e35a + 82d2759 commit 6aa87d7
Show file tree
Hide file tree
Showing 67 changed files with 1,203 additions and 953 deletions.
5 changes: 5 additions & 0 deletions .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ github:
- big-data
- s3
- kubernetes
autolink_jira:
- HADOOP
- HDDS
- HDFS
- RATIS
enabled_merge_buttons:
squash: true
merge: false
Expand Down
1 change: 1 addition & 0 deletions hadoop-hdds/client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,6 @@ private XceiverClientSpi getClient(Pipeline pipeline, boolean topologyAware)
// create different client different pipeline node based on
// network topology
String key = getPipelineCacheKey(pipeline, topologyAware);
// Append user short name to key to prevent a different user
// from using same instance of xceiverClient.
key = isSecurityEnabled ?
key + UserGroupInformation.getCurrentUser().getShortUserName() : key;
return clientCache.get(key, new Callable<XceiverClientSpi>() {
@Override
public XceiverClientSpi call() throws Exception {
Expand Down Expand Up @@ -297,6 +293,17 @@ private String getPipelineCacheKey(Pipeline pipeline,
e.getMessage());
}
}

if (isSecurityEnabled) {
// Append user short name to key to prevent a different user
// from using same instance of xceiverClient.
try {
key += UserGroupInformation.getCurrentUser().getShortUserName();
} catch (IOException e) {
LOG.error("Failed to get current user to create pipeline cache key:" +
e.getMessage());
}
}
return key;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,18 @@ public static ContainerCommandRequestProto toProto(
final ContainerCommandRequestProto header
= ContainerCommandRequestProto
.parseFrom(bytes.substring(Integer.BYTES, i));
// TODO: setting pipeline id can be avoided if the client is sending it.
// In such case, just have to validate the pipeline id.
final ContainerCommandRequestProto.Builder b = header.toBuilder();
if (groupId != null) {
b.setPipelineID(groupId.getUuid().toString());
final String gidString = groupId.getUuid().toString();
if (header.hasPipelineID()) {
final String pid = header.getPipelineID();
if (!gidString.equals(pid)) {
throw new InvalidProtocolBufferException("ID mismatched: PipelineID " + pid
+ " does not match the groupId " + gidString);
}
} else {
b.setPipelineID(groupId.getUuid().toString());
}
}
final ByteString data = bytes.substring(i);
if (header.getCmdType() == Type.WriteChunk) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,7 @@ public enum ResultCodes {
TIMEOUT,
CA_ROTATION_IN_PROGRESS,
CA_ROTATION_IN_POST_PROGRESS,
CONTAINER_ALREADY_CLOSED,
CONTAINER_ALREADY_CLOSING
}
}
1 change: 1 addition & 0 deletions hadoop-hdds/config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

Expand Down
1 change: 1 addition & 0 deletions hadoop-hdds/container-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>

</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ public final class CommandDispatcher {
private final SCMConnectionManager connectionManager;
private final CommandHandlerMetrics commandHandlerMetrics;

/**
* Constructs a command Dispatcher.
* @param context - Context.
*/
/**
* Constructs a command dispatcher.
*
Expand Down
Loading

0 comments on commit 6aa87d7

Please sign in to comment.