Skip to content

Conversation

@nandakumar131
Copy link
Contributor

@nandakumar131 nandakumar131 commented Dec 17, 2024

What changes were proposed in this pull request?

ContainerSafeModeRule Refactor

Currently, the Safemode Rule validation is driven by processing of reports sent by Datanodes, this is unnecessary and this also introduces additional complexity as the ContainerSafeModeRule is maintaining the same information that the ContainerManager is maintaining.

Since the information about Containers are maintained at two different places, this can go out of sync and introduce bugs into ContainerSafeModeRule logic. (eg: HDDS-5263)

We will move to a simpler model where ContainerSafeModeRule will not care about report processing but check ContainerManager to validate the rule.

This is part-1 of the change where we introduce logic to use ContainerManager for rule validation, this new logic is disabled by default (using validateBasedOnReportProcessing flag). The new logic will be enabled once all the SafeModeRules are updated with new logic.

What is the link to the Apache JIRA

HDDS-11731

How was this patch tested?

Existing unit and acceptance tests.

Additional unit test will be added in HDDS-12000

@nandakumar131 nandakumar131 marked this pull request as ready for review January 2, 2025 07:30
@nandakumar131 nandakumar131 marked this pull request as draft January 2, 2025 10:27
@nandakumar131 nandakumar131 marked this pull request as ready for review January 3, 2025 08:27
Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @nandakumar131 for the patch.

Comment on lines 850 to 851
containerManager.getContainers(), containerManager,
pipelineManager, eventQueue, serviceManager, scmContext);
containerManager, pipelineManager, eventQueue,
serviceManager, scmContext);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: previous indent was correct

nandakumar131 and others added 2 commits January 4, 2025 07:52
…m/safemode/ContainerSafeModeRule.java

Co-authored-by: Doroszlai, Attila <6454655+adoroszlai@users.noreply.github.com>
@nandakumar131
Copy link
Contributor Author

Thanks @adoroszlai for the review. Addressed the review comments.

@adoroszlai adoroszlai merged commit 2dd8a71 into apache:master Jan 4, 2025
42 checks passed
@adoroszlai
Copy link
Contributor

Thanks @nandakumar131 for updating the patch.

@nandakumar131
Copy link
Contributor Author

Thanks @adoroszlai for the review and merge!

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