Skip to content

Conversation

@adoroszlai
Copy link
Contributor

What changes were proposed in this pull request?

ozone admin commands use loggers to print to standard output. They ignore logging configuration due to hard-coded info level. Log output also lack details like timestamp, thread name, etc. to mimic regular output.

This change replaces LOG.info with printing to System.out, LOG.error with printing to System.err. Log messages from other parts of the code can now be displayed if needed.

LOG messages are kept in UpgradeManager and UpgradeTask (container layout v2 to v3 upgrade tool, introduced recently), which have more complex output. I think they can benefit from using regular logging.

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

How was this patch tested?

Tested few commands manually in ozone compose environment.

Tested debug level logging with log4j.logger.org.apache.hadoop.security.SaslRpcClient=DEBUG:

$ ozone admin reconfig --address datanode:19864 properties
2024-02-22 13:33:21,378 [main] DEBUG security.SaslRpcClient: Sending sasl message state: NEGOTIATE

2024-02-22 13:33:21,383 [main] DEBUG security.SaslRpcClient: Get kerberos info proto:interface org.apache.hadoop.hdds.protocolPB.ReconfigureProtocolPB info:@org.apache.hadoop.security.KerberosInfo(clientPrincipal="", serverPrincipal="hdds.scm.kerberos.principal")
2024-02-22 13:33:21,385 [main] DEBUG security.SaslRpcClient: getting serverKey: hdds.scm.kerberos.principal conf value: scm/[email protected] principal: scm/[email protected]
An error occurred while executing the command for :datanode:19864
java.io.IOException: DestHost:destPort datanode:19864 , LocalHost:localPort scm/192.168.64.9:0. Failed on local exception: java.io.IOException: Couldn't set up IO streams: java.lang.IllegalArgumentException: Server has invalid Kerberos principal: dn/[email protected], expecting: scm/[email protected]

CI:
https://github.com/adoroszlai/ozone/actions/runs/7994077722

@adoroszlai adoroszlai self-assigned this Feb 22, 2024
Copy link
Contributor

@ChenSammi ChenSammi left a comment

Choose a reason for hiding this comment

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

LTGM. Thanks @adoroszlai for fixing the issue.

@adoroszlai adoroszlai merged commit 0bac7ef into apache:master Feb 23, 2024
@adoroszlai adoroszlai deleted the HDDS-10405 branch February 23, 2024 21:00
@adoroszlai
Copy link
Contributor Author

Thanks @ChenSammi, @kerneltime for the review.

adoroszlai added a commit to adoroszlai/ozone that referenced this pull request Mar 5, 2024
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.

3 participants