Skip to content
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

HDDS-4730. Use separate Ratis admin and client ports #1887

Merged
merged 28 commits into from Feb 8, 2021

Conversation

adoroszlai
Copy link
Contributor

What changes were proposed in this pull request?

Move Datanode's Ratis server-to-server and admin communication to other ports and use separate TLS config.

  • Add new ports with default config.
  • Only use new ports if datanode has not been initialized previously. Ratis stores peer addresses with port in Raft log, so if the ring is already created, we cannot simply move server-to-server communication to another port.
  • Store "separate ports" as feature in datanode details YAML. Currently this is the only feature, but I think it's better to have a list of features than to introduce "random" fields.
  • Add acceptance test for restarting Ozone (with the same version, no upgrade).
  • Enabled TLS for datanode GRPC in ozonesecure cluster.

https://issues.apache.org/jira/browse/HDDS-4730

How was this patch tested?

Regular CI:
https://github.com/adoroszlai/hadoop-ozone/actions/runs/531656927

@@ -73,6 +74,7 @@
private String buildDate;
private HddsProtos.NodeOperationalState persistedOpState;
private long persistedOpStateExpiryEpochSec = 0;
private final List<String> features = new ArrayList<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

I might have missed something:

Is there a JIRA or design doc that says what features in Datanode are?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just a way to help distinguish newly initialized datanodes from existing ones being restarted with new code version. No further features planned currently.

Copy link
Contributor

@lokeshj1703 lokeshj1703 left a comment

Choose a reason for hiding this comment

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

@adoroszlai Thanks for working on this! The changes look good to me. I have few minor comments inline.

Comment on lines 132 to 133
public static final String SEPARATE_RATIS_PORTS_AVAILABLE = "RatisPorts";

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 define features in a separate class? We could also define them as enums.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I can move it to separate class. I'd rather avoid enums, which are more type-safe, but worse for compatibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Although not sure if it's worth extracting to another class at this time.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was suggesting separate class so that in future if new features are defined, it could all be in the same class for better accessibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @lokeshj1703 for the suggestion. Extracted to separate class. Also changed to using version numbers instead of "features". I think this will be simpler in the long run. Features of the datanode can be mapped at runtime (eg. if version > 0, then we have this "separate ports" feature).

@adoroszlai adoroszlai marked this pull request as draft February 5, 2021 18:10
@adoroszlai adoroszlai marked this pull request as ready for review February 6, 2021 11:38
@adoroszlai
Copy link
Contributor Author

@elek @bshashikant @lokeshj1703 @amaliujia Thanks for the reviews so far. Do you have any comment on the latest patch, can I merge it?

Copy link
Contributor

@lokeshj1703 lokeshj1703 left a comment

Choose a reason for hiding this comment

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

@adoroszlai Thanks for updating the PR! The changes look good to me. +1.

@adoroszlai adoroszlai merged commit 375da4d into apache:master Feb 8, 2021
@adoroszlai adoroszlai deleted the HDDS-4730 branch February 8, 2021 12:25
@adoroszlai
Copy link
Contributor Author

Thanks all for the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants