HDDS-10658. audit log message having transaction id#6863
HDDS-10658. audit log message having transaction id#6863sumitagrawl wants to merge 4 commits intoapache:masterfrom
Conversation
adoroszlai
left a comment
There was a problem hiding this comment.
Thanks @sumitagrawl for the patch.
| OzoneManagerProtocolProtos.UserInfo userInfo, TermIndex termIndex) { | ||
| if (null != auditMap) { | ||
| auditMap.put("Transaction", "" + termIndex.getIndex()); | ||
| } |
There was a problem hiding this comment.
This method is for building the audit message based on the input map. termIndex should not be added as a parameter. It should be added to the map by the caller.
There was a problem hiding this comment.
Chances of missing adding termIndex at every caller is high, so its done at common place. This is to avoid coding mistake, as this should be mandatory parameter for logging, and required for logging. Other parameter can be optional and based on specific request type.
There was a problem hiding this comment.
This piece of code (passing -1):
suggests that it is not mandatory for all requests. On closer look this call is from preExecute, which doesn't have termIndex. Only requests related to delegation tokens do audit failures in preExecute. We may want to fix that.
I think we should change the place where audit logging happens for OM requests:
- start building
AuditMessage.Builderin requests, but do notbuild()and log it yet - add the in-progress
AuditMessage.Builderto theOMClientResponsereturned fromvalidateAndUpdateCache - central server-side request/response handler (
OzoneManagerProtocolServerSideTranslatorPBOzoneManagerRequestHandler) can add common information liketermIndex, finish buildingAuditMessageand log it OzoneManagerProtocolServerSideTranslatorPBcan also log failures that occur inpreExecute
|
Can you include some before and after log message examples in the PR description for others to quickly reference? |
|
Changes are udpated in new pull request #6949 |
What changes were proposed in this pull request?
For debuggability of om transaction and audit log mapping, audit log is included with transaction Id. And additionally unknown failure case, also having audit log with exception message and transaction id.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-10658
How was this patch tested?