Skip to content

Conversation

@chimney-lee
Copy link
Contributor

What changes were proposed in this pull request?

What changes were proposed in this pull request?
fix scmcli container delete not working

What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-2534
#214

How was this patch tested?
exec bin/ozone scmcli container delete

@chimney-lee
Copy link
Contributor Author

@xiaoyuyao please review. relates to #214

Set<ContainerReplica> replicas =
containerStateManager.getContainerReplicas(containerID);
for(ContainerReplica replica : replicas){
nodeManager.removeContainers(replica.getDatanodeDetails(), Stream.of(
Copy link
Contributor

@xiaoyuyao xiaoyuyao Jan 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create the set of containerID outside the loop with a simpler Java APIs:

Set containerIdSet = Collections.singleton(containerID);
replias.forEach(replica->nodeManager.removeContainers(replica.getDatanodeDetails(), containerIdSet));

" {} from datanode {},delete it.",
replicaProto.getContainerID(),
datanodeDetails);
publisher.fireEvent(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we fireEvent upon receive the scmcli request? Can we add some high level design description wrt the flow of the delete in the PR description? That will help the reviewers.

Copy link
Contributor

@avijayanhwx avijayanhwx Jan 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for @xiaoyuyao's description request. The delete container flow is quite important for Recon to work correctly and hence trying to understand this better. Will there be a case where a user will need to delete a container directly using SCM?

@Override
public void removeContainers(DatanodeDetails datanodeDetails,
Set<ContainerID> containerIds) throws NodeNotFoundException {
nodeStateManager.removeContainers(datanodeDetails.getUuid(), containerIds);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to remove the container from the pipelineContainerMap in SCMPipelineManager?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before delete a container, we should close it; When we close a container , The function SCMContainerManager#updateContainerState will remove the container from pipelineContainerMap in SCMPipelineManager.

Copy link
Contributor

@xiaoyuyao xiaoyuyao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @chimney-lee for working on this. I have some questions commented inline.

Add datanode info in Exception message
@elek
Copy link
Member

elek commented Mar 10, 2020

/pending Questions/suggestions from @xiaoyuyao are not yet addressed in the last commit.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking this issue as un-mergeable as requested.

Please use /ready comment when it's resolved.

Questions/suggestions from @xiaoyuyao are not yet addressed in the last commit.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking this issue as un-mergeable as requested.

Please use /ready comment when it's resolved.

Questions/suggestions from @xiaoyuyao are not yet addressed in the last commit.

@apache apache deleted a comment from github-actions bot Apr 17, 2020
@maobaolong
Copy link
Member

@chimney-lee Thank you for working on this, do you still working on?

@chimney-lee
Copy link
Contributor Author

@chimney-lee Thank you for working on this, do you still working on?

@chimney-lee chimney-lee reopened this May 28, 2020
@chimney-lee
Copy link
Contributor Author

@maobaolong Sorry for this , it has been a long time, glad if someone could contine this work

@maobaolong
Copy link
Member

@chimney-lee Thank you for the past working on this, i will continue this work.

@adoroszlai
Copy link
Contributor

Thanks @chimney-lee for the work on this so far, and @maobaolong for taking it up. I assume @maobaolong will open a new PR for the updated change, so closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants