You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/11/18 14:46:57 UTC
[GitHub] [ozone] sadanand48 opened a new pull request #1600: HDDS-4475.Extend DatanodeChunkGenerator to write all on all pipelines…
sadanand48 opened a new pull request #1600:
URL: https://github.com/apache/ozone/pull/1600
… of a set of dns
## What changes were proposed in this pull request?
Currently, DatanodeChunkGeneraor takes a single pipeline as a parameter. This will allow passing a list of pipelines as comma-separated by their pipeline ids and the load will be generated on the dns of the provided pipelines.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-4475
## How was this patch tested?
Tested on docker.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] elek merged pull request #1600: HDDS-4475.Extend DatanodeChunkGenerator to write all on all pipelines…
Posted by GitBox <gi...@apache.org>.
elek merged pull request #1600:
URL: https://github.com/apache/ozone/pull/1600
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] sadanand48 edited a comment on pull request #1600: HDDS-4475.Extend DatanodeChunkGenerator to write all on all pipelines…
Posted by GitBox <gi...@apache.org>.
sadanand48 edited a comment on pull request #1600:
URL: https://github.com/apache/ozone/pull/1600#issuecomment-735915634
Thanks @elek for the comments . The current tool takes only 1 pipelineID as parameter and generates chunks on this pipeline.If any arguments not provided, it will by default select the RATIS THREE pipeline and write to it.
The goal here is to
1. Pass multiple pipelineID's at once and generate write chunk requests on them .
2. Pass datanode/datanodes and select those pipelines of which these datanodes are part of and write to them. I will use the second filter for that like you suggested.
The default behaviour remains the same.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] bshashikant commented on pull request #1600: HDDS-4475.Extend DatanodeChunkGenerator to write all on all pipelines…
Posted by GitBox <gi...@apache.org>.
bshashikant commented on pull request #1600:
URL: https://github.com/apache/ozone/pull/1600#issuecomment-734190824
@sadanand48 , as discuseed offline. Can you make the write chunk tests to run concurrently rather than sequentially?
Also, can we also add support for multiple datanodes along with pipeline Ids?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] elek commented on pull request #1600: HDDS-4475.Extend DatanodeChunkGenerator to write all on all pipelines…
Posted by GitBox <gi...@apache.org>.
elek commented on pull request #1600:
URL: https://github.com/apache/ozone/pull/1600#issuecomment-737122506
(You can ping me offline if it was not clear, need help or if my understanding is till not right ;-) )
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] elek commented on pull request #1600: HDDS-4475.Extend DatanodeChunkGenerator to write all on all pipelines…
Posted by GitBox <gi...@apache.org>.
elek commented on pull request #1600:
URL: https://github.com/apache/ozone/pull/1600#issuecomment-737122197
Thanks to explain it, now I got it.
In that case you should have additional modification to use the current loop:
You should either select the first one OR the pipelines assigned to the datanode.
Change `private XceiverClientSpi xceiverClientSpi` to `private List<XceiverClientSpi> clients` to have clients to all pipelines.
And in `writeChunk` select a random one instead of using the single one.
(You should also initialize the full list of clients and close them...)
Also: how would you like to guarantee that if the selected datanode is the leader of bot pipelines?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] elek commented on a change in pull request #1600: HDDS-4475.Extend DatanodeChunkGenerator to write all on all pipelines…
Posted by GitBox <gi...@apache.org>.
elek commented on a change in pull request #1600:
URL: https://github.com/apache/ozone/pull/1600#discussion_r555138010
##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/DatanodeChunkGenerator.java
##########
@@ -75,70 +82,120 @@
description = "Pipeline to use. By default the first RATIS/THREE "
+ "pipeline will be used.",
defaultValue = "")
- private String pipelineId;
+ private String pipelineIds;
- private XceiverClientSpi xceiverClientSpi;
+ @Option(names = {"-d", "--datanodes"},
+ description = "Datanodes to use. ",
+ defaultValue = "")
+ private String datanodes;
+
+ private XceiverClientManager xceiverClientManager;
+ private List<XceiverClientSpi> xceiverClients;
private Timer timer;
private ByteString dataToWrite;
private ChecksumData checksumProtobuf;
+
@Override
public Void call() throws Exception {
- init();
OzoneConfiguration ozoneConf = createOzoneConfiguration();
+ xceiverClientManager =
+ new XceiverClientManager(ozoneConf);
if (OzoneSecurityUtil.isSecurityEnabled(ozoneConf)) {
throw new IllegalArgumentException(
"Datanode chunk generator is not supported in secure environment");
}
- try (StorageContainerLocationProtocol scmLocationClient =
- createStorageContainerLocationClient(ozoneConf)) {
- List<Pipeline> pipelines = scmLocationClient.listPipelines();
- Pipeline pipeline;
- if (pipelineId != null && pipelineId.length() > 0) {
- pipeline = pipelines.stream()
- .filter(p -> p.getId().toString().equals(pipelineId))
- .findFirst()
- .orElseThrow(() -> new IllegalArgumentException(
- "Pipeline ID is defined, but there is no such pipeline: "
- + pipelineId));
+ List<String> pipelinesFromCmd = Arrays.asList(pipelineIds.split(","));
+ List<String> datanodeHosts = Arrays.asList(this.datanodes.split(","));
+
+ Set<Pipeline> pipelines;
+
+ try (StorageContainerLocationProtocol scmLocationClient =
+ createStorageContainerLocationClient(ozoneConf)) {
+ List<Pipeline> pipelinesFromSCM = scmLocationClient.listPipelines();
+ Pipeline firstPipeline;
+ init();
+ if (!arePipelinesOrDatanodesProvided()) {
+ //default behaviour if no arguments provided
+ firstPipeline = pipelinesFromSCM.stream()
+ .filter(p -> p.getFactor() == ReplicationFactor.THREE)
+ .findFirst()
+ .orElseThrow(() -> new IllegalArgumentException(
+ "Pipeline ID is NOT defined, and no pipeline " +
+ "has been found with factor=THREE"));
+ XceiverClientSpi xceiverClientSpi = xceiverClientManager
+ .acquireClient(firstPipeline);
+ xceiverClients = new ArrayList<>();
+ xceiverClients.add(xceiverClientSpi);
+ LOG.info("Using pipeline {}", firstPipeline.getId());
Review comment:
```suggestion
```
You don't need this line as you log the same information in the loop bellow.
##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/DatanodeChunkGenerator.java
##########
@@ -75,70 +82,120 @@
description = "Pipeline to use. By default the first RATIS/THREE "
+ "pipeline will be used.",
defaultValue = "")
- private String pipelineId;
+ private String pipelineIds;
- private XceiverClientSpi xceiverClientSpi;
+ @Option(names = {"-d", "--datanodes"},
+ description = "Datanodes to use. ",
Review comment:
```suggestion
description = "Datanodes to use. Test will write to all the existing pipelines which this datanode is member of.",
```
##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/DatanodeChunkGenerator.java
##########
@@ -75,70 +82,120 @@
description = "Pipeline to use. By default the first RATIS/THREE "
+ "pipeline will be used.",
defaultValue = "")
- private String pipelineId;
+ private String pipelineIds;
- private XceiverClientSpi xceiverClientSpi;
+ @Option(names = {"-d", "--datanodes"},
+ description = "Datanodes to use. ",
+ defaultValue = "")
+ private String datanodes;
+
+ private XceiverClientManager xceiverClientManager;
+ private List<XceiverClientSpi> xceiverClients;
private Timer timer;
private ByteString dataToWrite;
private ChecksumData checksumProtobuf;
+
@Override
public Void call() throws Exception {
- init();
OzoneConfiguration ozoneConf = createOzoneConfiguration();
+ xceiverClientManager =
+ new XceiverClientManager(ozoneConf);
if (OzoneSecurityUtil.isSecurityEnabled(ozoneConf)) {
throw new IllegalArgumentException(
"Datanode chunk generator is not supported in secure environment");
}
- try (StorageContainerLocationProtocol scmLocationClient =
- createStorageContainerLocationClient(ozoneConf)) {
- List<Pipeline> pipelines = scmLocationClient.listPipelines();
- Pipeline pipeline;
- if (pipelineId != null && pipelineId.length() > 0) {
- pipeline = pipelines.stream()
- .filter(p -> p.getId().toString().equals(pipelineId))
- .findFirst()
- .orElseThrow(() -> new IllegalArgumentException(
- "Pipeline ID is defined, but there is no such pipeline: "
- + pipelineId));
+ List<String> pipelinesFromCmd = Arrays.asList(pipelineIds.split(","));
+ List<String> datanodeHosts = Arrays.asList(this.datanodes.split(","));
+
+ Set<Pipeline> pipelines;
+
+ try (StorageContainerLocationProtocol scmLocationClient =
+ createStorageContainerLocationClient(ozoneConf)) {
+ List<Pipeline> pipelinesFromSCM = scmLocationClient.listPipelines();
+ Pipeline firstPipeline;
+ init();
+ if (!arePipelinesOrDatanodesProvided()) {
+ //default behaviour if no arguments provided
+ firstPipeline = pipelinesFromSCM.stream()
+ .filter(p -> p.getFactor() == ReplicationFactor.THREE)
+ .findFirst()
+ .orElseThrow(() -> new IllegalArgumentException(
+ "Pipeline ID is NOT defined, and no pipeline " +
+ "has been found with factor=THREE"));
+ XceiverClientSpi xceiverClientSpi = xceiverClientManager
+ .acquireClient(firstPipeline);
+ xceiverClients = new ArrayList<>();
+ xceiverClients.add(xceiverClientSpi);
+ LOG.info("Using pipeline {}", firstPipeline.getId());
+ runTest();
} else {
- pipeline = pipelines.stream()
- .filter(p -> p.getFactor() == ReplicationFactor.THREE)
- .findFirst()
- .orElseThrow(() -> new IllegalArgumentException(
- "Pipeline ID is NOT defined, and no pipeline " +
- "has been found with factor=THREE"));
- LOG.info("Using pipeline {}", pipeline.getId());
+ xceiverClients = new ArrayList<>();
+ pipelines = new HashSet<>();
+ for(String pipelineId:pipelinesFromCmd){
+ List<Pipeline> selectedPipelines = pipelinesFromSCM.stream()
+ .filter((p -> p.getId().toString()
+ .equals("PipelineID=" + pipelineId)
+ || pipelineContainsDatanode(p, datanodeHosts)))
+ .collect(Collectors.toList());
+ pipelines.addAll(selectedPipelines);
+ }
+ for (Pipeline p:pipelines){
+ LOG.info("Writing to pipeline: " + p.getId());
+ xceiverClients.add(xceiverClientManager.acquireClient(p));
+ }
+ if (pipelines.isEmpty()){
+ throw new IllegalArgumentException(
+ "Coudln't find the any/the selected pipeline");
Review comment:
```suggestion
"Couldn't find the any/the selected pipeline");
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] sadanand48 edited a comment on pull request #1600: HDDS-4475.Extend DatanodeChunkGenerator to write all on all pipelines…
Posted by GitBox <gi...@apache.org>.
sadanand48 edited a comment on pull request #1600:
URL: https://github.com/apache/ozone/pull/1600#issuecomment-735915634
Thanks @elek for the comments . The current tool takes only 1 pipeline as parameter and generates chunks on this pipeline.If any arguments not provided, it will by default select the RATIS THREE pipeline and write to it.
The goal here is to
1. Pass multiple pipelines at once and generate write chunk requests on them .
2. Pass datanode/datanodes and select those pipelines of which these datanodes are part of and write to them. I will use the second filter for that like you suggested.
The default behaviour remains the same.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] bshashikant commented on pull request #1600: HDDS-4475.Extend DatanodeChunkGenerator to write all on all pipelines…
Posted by GitBox <gi...@apache.org>.
bshashikant commented on pull request #1600:
URL: https://github.com/apache/ozone/pull/1600#issuecomment-734191066
@elek , can you plz have a look at this?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] sadanand48 commented on pull request #1600: HDDS-4475.Extend DatanodeChunkGenerator to write all on all pipelines…
Posted by GitBox <gi...@apache.org>.
sadanand48 commented on pull request #1600:
URL: https://github.com/apache/ozone/pull/1600#issuecomment-735915634
Thanks @elek for thr comments . The current tool takes only 1 pipeline as parameter and generates chunks on this pipeline.If any arguments not provided, it will by default select the RATIS THREE pipeline and write to it.
The goal here is to
1. Pass multiple pipelines at once and generate write chunk requests on them .
2. Pass datanode/datanodes and select those pipelines of which these datanodes are part of and write to them. I will use the second filter for that like you suggested.
The default behaviour remains the same.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] elek commented on pull request #1600: HDDS-4475.Extend DatanodeChunkGenerator to write all on all pipelines…
Posted by GitBox <gi...@apache.org>.
elek commented on pull request #1600:
URL: https://github.com/apache/ozone/pull/1600#issuecomment-756029374
Thanks the update @sadanand48
This part seems to be suspicious:
```
179 │ private void writeOnPipeline(OzoneConfiguration ozoneConf,
180 │ List<Pipeline> pipelines) throws IOException {
181 │ LOG.info("Inside write Pipeline and pipeline size" + pipelines.size());
182 │ xceiverClients = new ArrayList<>();
183 │ for (Pipeline p: pipelines){
184 │ init();
185 │ LOG.info("run test on pipeline" + p.getId().toString());
186 │ XceiverClientSpi clientSpi = xceiverClientManager.acquireClient(p);
187 │ xceiverClients.add(clientSpi);
188 │ runTest(clientSpi);
189 │ }
190 │ }
```
It has multiple `init()` calls which reset all the counters. `runTest` should be called only once IMHO.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] elek commented on pull request #1600: HDDS-4475.Extend DatanodeChunkGenerator to write all on all pipelines…
Posted by GitBox <gi...@apache.org>.
elek commented on pull request #1600:
URL: https://github.com/apache/ozone/pull/1600#issuecomment-758497034
Merging it. Thanks for the continuous improvement @sadanand48
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org