-
Notifications
You must be signed in to change notification settings - Fork 593
HDDS-3186. Introduce generic SCMRatisRequest and SCMRatisResponse. #959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
/pending "Not ready for review" |
There was a problem hiding this 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"
timmylicheng
left a comment
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://issues.apache.org/jira/browse/HDDS-3660 Track it here
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
/ready |
Blocking review request is removed.
| .setReplicationFactor(pipeline.getFactor()) | ||
| .setReplicationType(pipeline.getType()) | ||
| .build(); | ||
| containerStateManager.addContainer(containerInfo); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
|
+1 merge in dev branch and pending on following JIRAs to resolve remaining works. |
|
@timmylicheng thanks for the merge! |
What changes were proposed in this pull request?
This PR will introduce generic
SCMRatisRequestandSCMRatisResponsewhich will be used by all the Ratis operations inside SCM. We also have a genericStateMachinewhich 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