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

RANGER-5102: Enable append mode for audits to hdfs with config param #513

Merged
merged 2 commits into from
Feb 24, 2025

Conversation

kumaab
Copy link
Contributor

@kumaab kumaab commented Jan 20, 2025

What changes were proposed in this pull request?

Ranger audits to HDFS currently use APPEND mode in case of errors/exceptions encountered in writing audits to HDFS destination (to prevent large number of audit files) and fallbacks to WRITE mode if unable to APPEND.

Add a config param to enable APPEND mode (to be used under specific circumstances).

How was this patch tested?

Verified that the config param xasecure.audit.destination.hdfs.file.append.enabled enables/disables append mode in docker with hive, hadoop and ranger containers.

@kumaab kumaab self-assigned this Jan 20, 2025
@rameeshm rameeshm self-requested a review January 20, 2025 22:03
- added new config param to enable/disable append mode
- added unit tests
@kumaab kumaab reopened this Feb 23, 2025
@kumaab
Copy link
Contributor Author

kumaab commented Feb 24, 2025

Verified the changes in HA setup with Hive and the below command:

hdfs debug recoverLease -path /ranger/audit/hive/hiveServer2/20250224/hiveServer2_ranger_audit_hostname.3.log --retries 3

that when append is true, the audit switches to file spool and when writing to destination again it uses the same file whereas when append is false, the audit is switches to file spool and when writing to destination again it creates a new file.

CC: @mneethiraj @rameeshm @vperiasamy

@kumaab kumaab merged commit 87666d3 into apache:master Feb 24, 2025
3 checks passed
@kumaab kumaab deleted the ranger-5102 branch February 24, 2025 23:15
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