Skip to content
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

HDDS-2946. Rename audit log should contain both srcKey and dstKey not just key #535

Closed
wants to merge 1 commit into from

Conversation

fapifta
Copy link
Contributor

@fapifta fapifta commented Feb 7, 2020

#478 What changes were proposed in this pull request?
In the audit log of a rename request we just log the key to be renamed. The purpose of this PR is to replace key to srcKey and dstKey in the audit log message in case of a rename.

What is the link to the Apache JIRA

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

How was this patch tested?

I haven't find any particular junit test that tests actual audit log messages, and I haven't added one, though I have this patch applied on a cluster, and used the new type of audit log to trace down multiple renames properly. I am happy to discuss how to add a junit test if there is any place for it, and if there is any reason to test the particular queries audit contents, I don't see it necessary as the general facilities we are using for audit log message creation are already tested.

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 @fapifta for the contribution.

For unit test, I think a good place to add an assertion about audit map contents would be in TestOMKeyRenameRequest. It uses a mock AuditLogger (inherited from TestOMKeyRequest).

Copy link
Member

@elek elek left a comment

Choose a reason for hiding this comment

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

+1 thanks the improvement @fapifta and the review @adoroszlai

As it's a small change I will commit it with the existing test, if you open a new Jira to improve the test coverage of this area (as suggested by @adoroszlai ) I promise a quick review ;-)

@elek elek closed this in fb90756 Feb 10, 2020
@fapifta fapifta deleted the HDDS-2946 branch January 18, 2021 16:31
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