Skip to content

HDDS-10198. Improve Logging in AbstractFindTargetGreedy#6090

Merged
adoroszlai merged 1 commit intoapache:masterfrom
siddhantsangwan:HDDS-10198
Jan 25, 2024
Merged

HDDS-10198. Improve Logging in AbstractFindTargetGreedy#6090
adoroszlai merged 1 commit intoapache:masterfrom
siddhantsangwan:HDDS-10198

Conversation

@siddhantsangwan
Copy link
Contributor

What changes were proposed in this pull request?

Simple DEBUG level logging improvement for Container Balancer.

This jira is to improve logging around a Datanode being removed from the collection of potential targets in ContainerBalancer. This can help us understand why a particular Datanode wasn't chosen as a target for container move when we think it's the optimal choice.

A Datanode may not be selected in multiple situations - it has already had enough size moved into it and has reached the limit, doesn't follow placement policy, already has the container's replica etc. I saw a situation in which a particular Datanode was the best choice when considering network distance and was also a potential target, but balancer did not choose it. I want to debug why this happened and more logging will help with this.

What is the link to the Apache JIRA

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

How was this patch tested?

Existing tests.

@siddhantsangwan
Copy link
Contributor Author

@ashishkumar50 @Tejaskriya Can you please review?

@Tejaskriya
Copy link
Contributor

LGTM

Copy link
Contributor

@ashishkumar50 ashishkumar50 left a comment

Choose a reason for hiding this comment

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

Looks good except a suggestion.

//reorder
potentialTargets.add(nodeManager.getUsageInfo(target));
} else {
logger.debug("Datanode {} removed from the list of potential targets. The total size of data entering it in " +
Copy link
Contributor

Choose a reason for hiding this comment

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

You can add LOGGER.isDebugEnabled() before logging

Copy link
Contributor

Choose a reason for hiding this comment

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

There is no need to wrap it in an IF statement unless there is expensive logic to form the message. Inside the logger it has the isDebugEnabled check already.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ya I see it's there inside as well so not required.

Copy link
Contributor

@sodonnel sodonnel left a comment

Choose a reason for hiding this comment

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

LGTM

@adoroszlai adoroszlai merged commit 6a129ac into apache:master Jan 25, 2024
@adoroszlai
Copy link
Contributor

Thanks @siddhantsangwan for the patch, @ashishkumar50, @sodonnel, @TaiJuWu, @Tejaskriya for the review.

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.

6 participants