-
Notifications
You must be signed in to change notification settings - Fork 594
HDDS-7155. [DiskBalancer] Create interface between SCM and DN #3701
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
| message DiskBalancerConfigurationProto { | ||
| optional double threshold = 1; | ||
| optional double diskBandwidth = 2; | ||
| optional string threshold = 1; |
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.
@ChenSammi Currently ConfigurationReflectionUtil can not detect the type of "Double", so I revert the type back to string, please have a look.
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 see. Do you think it's difficult to add a double support in ConfigurationReflectionUtil?
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.
Added "Double" to ConfigType in another PR, please have a look.
https://issues.apache.org/jira/browse/HDDS-7162
|
@ChenSammi @ferhui @lokeshj1703 @siddhantsangwan @sodonnel @neils-dev @JacksonYao287 Could you help to review this PR? |
| // DiskBalancerCommand diskBalancerCommand = (DiskBalancerCommand) command; | ||
| // final boolean shouldRun = diskBalancerCommand.isShouldRun(); | ||
| // final DiskBalancerConfiguration configuration = | ||
| // diskBalancerCommand.getDiskBalancerConfiguration(); |
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.
this code should be either implemented or removed. The code that is commented out, should not go to production code
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.
Thanks for the review, I will comment it.
|
|
||
|
|
||
| /** | ||
| * Publishes Pipeline which will be sent to SCM as part of heartbeat. |
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.
seems to be a copy-paste from PipelineReportPublisher.class
|
Hi @symious , Sammi @ChenSammi gave a comment 'Please use uint64 instead. diskBandwidth is a number without fraction. We can change it in next PR.' in the last PR. Could you change it in this PR? |
| defaultValue = "10", tags = {ConfigTag.DISKBALANCER}, | ||
| description = "The max balance speed.") | ||
| private double diskBandwidth = 10; | ||
| private long diskBandwidth = 10; |
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.
Please check the type of all key, use the proper type instead of ConfigType.AUTO if possible.
|
|
||
| if (heartbeat.hasDiskBalancerReport()) { | ||
| LOG.debug("Dispatching DiskBalancer Report."); | ||
| eventPublisher.fireEvent( |
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.
Copy-paste result?
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.
Yep, let me fix it.
| diskBalancerManager.processDiskBalancerReport( | ||
| diskBalancerReportProto, dn); | ||
| } catch (Exception e) { | ||
| LOGGER.error("Could not process diskBalancer report={} from dn={}.", |
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.
Could not process -> Failed to process
| Preconditions.checkState( | ||
| heartbeatFrequency <= diskBalancerReportInterval, | ||
| HDDS_DISK_BALANCER_REPORT_INTERVAL + | ||
| " cannot be configured lower than heartbeat frequency."); |
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.
Please add the heart frequency value in the message to facilitate problem investigation.
| // Todo: add implementation to stop DiskBalancer | ||
| } | ||
|
|
||
| private void updateDiskBalancerConfiguration(DiskBalancerConfiguration |
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.
updateDiskBalancerConfiguration -> updateDiskBalancer
|
|
||
| message DiskBalancerReportProto { | ||
| required bool isRunning = 1; | ||
| optional int64 balancedBytes = 2; |
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.
int64 -> uint64
|
Hey @symious , I finished one round of review and left some comments. |
|
@ChenSammi Thank you for the detailed review. I will update the PR later. For the "Double" type issue, I will create another PR in master, hope you can have a look and we can rebase and use it in the current branch. Thank you again. |
|
@ferhui Thanks for updating the patch. |
ferhui
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.
+1
lokeshj1703
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.
@symious Thanks for updating the PR! I have few comments inline.
| @@ -112,11 +112,11 @@ public class StateContext { | |||
| private final ConfigurationSource conf; | |||
| private final Set<InetSocketAddress> endpoints; | |||
| // Only the latest full report of each type is kept | |||
| private final AtomicReference<GeneratedMessage> containerReports; | |||
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.
Why do we need this change?
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 to resolve the conflicts with the change of HDDS-7151.
| return statusList; | ||
| // Filter Running Status by default | ||
| HddsProtos.DiskBalancerRunningStatus filterStatus = | ||
| status.orElse(HddsProtos.DiskBalancerRunningStatus.RUNNING); |
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.
Lets not filter by default.
| if (runningStatus != HddsProtos.DiskBalancerRunningStatus.UNKNOWN) { | ||
| builder.setDiskBalancerConf(statusMap.get(dn) | ||
| .getDiskBalancerConfiguration().toProtobufBuilder()); | ||
| } |
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 report conf for STOPPED status dns?
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.
If user specified the STOPEED status dn, I think we should return the information.
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.
But for STOPPED balancer, there should not exist any config right?
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 think they should have a local copy of configuration. So that they can use the latest configuration when we start them.
| return hosts.contains(datanodeDetails); | ||
| boolean shouldReturn = true; | ||
| // If dn not in specified hosts, do not return | ||
| if (hosts != null && !hosts.isEmpty() && !hosts.contains(datanodeDetails)) { |
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.
!hosts.isEmpty() We do not need this check.
|
|
||
| List<DatanodeDetails> finalFilterDns = filterDns; | ||
|
|
||
| return nodeManager.getAllNodes().stream() |
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.
We are still looping through all nodes here. In case hosts is not empty we should only loop through nodes provided by the hosts input parameter.
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.
Updated the for loop logic.
|
@ChenSammi @myskov @lokeshj1703 Thanks for your careful reviews! Do you have any other comments? |
|
Seems no further comments. Will merge it tmr so that @symious can continue. |
|
The patch LGTM, +1. |
|
@symious Thanks for your contribution. @myskov @ChenSammi @lokeshj1703 Thanks for your careful reviews! Merged. |
|
@ChenSammi @ferhui @lokeshj1703 @myskov Thank you for the review. |
What changes were proposed in this pull request?
This ticket is for creating the interface between SCM and DN. The new interfaces are as follows:
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-7155
How was this patch tested?
unit test.