Skip to content

Conversation

@nandakumar131
Copy link
Contributor

@nandakumar131 nandakumar131 commented May 22, 2020

What changes were proposed in this pull request?

This PR will introduce generic SCMRatisRequest and SCMRatisResponse which will be used by all the Ratis operations inside SCM. We also have a generic StateMachine which will dispatch the request to registered handlers.

What is the link to the Apache JIRA

HDDS-3186

How was this patch tested?

This patch is not tested properly.
The following jiras are created for adding unit tests to test the changes introduced in this PR
HDDS-3650, HDDS-3651 and HDDS-3652

@nandakumar131
Copy link
Contributor Author

/pending "Not ready for review"

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.

"Not ready for review"

@nandakumar131 nandakumar131 changed the title HDDS-3186. Initial version. HDDS-3186. Introduce generic SCMRatisRequest and SCMRatisResponse. May 22, 2020
Copy link
Contributor

@timmylicheng timmylicheng left a comment

Choose a reason for hiding this comment

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

Good work on the @replication interface!
We just need to merge two sets of SCMRatisServer and SCMStateMachine into one and we can worry about other TODOs in later commits.

import java.util.Collections;
import java.util.concurrent.TimeUnit;

public class RatisUtil {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we put this into SCMHAUtils?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have moved this to ReflectionUtil class which can be used for all the utility methods related to reflection. I will update the PR soon.

I agree that we should use the existing SCMHAUtil instead of creating new RatisUtil

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I feel it's ok to have ReflectionUtil, RatisUtil, and SCMHAUtil as they serve a different purpose.

import org.apache.ratis.protocol.RaftPeerId;
import org.apache.ratis.server.RaftServer;

public class SCMRatisServer {
Copy link
Contributor

Choose a reason for hiding this comment

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

I've merged SCMRatisServer and SCMStateMachine into one between /ha and /ratis in timmylicheng#1. We can use /ha as your did here, but we need to combine all methods into one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we need to copy all the code/methods from OzoneManagerHA implementation. We can add things to SCMHA related classes whenever required.
It's better not to have code that is not used or needed.

Let's add/update the SCMHA code when needed.

Copy link
Contributor

Choose a reason for hiding this comment

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

How about Snapshot in SCMStateMachine?

Copy link
Contributor

Choose a reason for hiding this comment

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

Track the issue in https://issues.apache.org/jira/browse/HDDS-3661.
This is to split the work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's configure/enable Ratis snapshot after we have some design plan on how to implement the snapshot.

@nandakumar131
Copy link
Contributor Author

/ready

@github-actions github-actions bot dismissed their stale review May 25, 2020 18:26

Blocking review request is removed.

.setReplicationFactor(pipeline.getFactor())
.setReplicationType(pipeline.getType())
.build();
containerStateManager.addContainer(containerInfo);
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 addContainerToDB here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is handled inside ContainerStateManager.

@timmylicheng timmylicheng merged this pull request into apache:HDDS-2823 May 26, 2020
@timmylicheng
Copy link
Contributor

+1 merge in dev branch and pending on following JIRAs to resolve remaining works.

@nandakumar131
Copy link
Contributor Author

@timmylicheng thanks for the merge!

@nandakumar131 nandakumar131 deleted the HDDS-3186 branch May 26, 2020 08:59
timmylicheng pushed a commit that referenced this pull request May 26, 2020
timmylicheng pushed a commit that referenced this pull request Jun 2, 2020
timmylicheng pushed a commit that referenced this pull request Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants