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

Add retention for file request logs #12559

Merged
merged 2 commits into from
Jul 27, 2022
Merged

Conversation

a2l007
Copy link
Contributor

@a2l007 a2l007 commented May 23, 2022

Description

This PR adds a new property druid.request.logging.durationToRetain that provides support to specify retention periods for request logs stored on disk. This property works only for the file-based request logger and the retention period must be at least 1 day so that it avoids deleting the request log for the current day. It is disabled by default to preserve existing behavior.


Key changed/added classes in this PR
  • FileRequestLogger

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • been tested in a test Druid cluster.

Copy link
Contributor

@capistrant capistrant left a comment

Choose a reason for hiding this comment

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

This LGTM. Crazy that file request logger has been around this long with no automatic cleanup being contributed back by a user who accidentally filled up their logging partition with request logs

@a2l007
Copy link
Contributor Author

a2l007 commented Jul 25, 2022

Thanks for the review @capistrant !
Since the build wasn't run recently, let me re-run it before merge.

@a2l007 a2l007 merged commit 93a9a4b into apache:master Jul 27, 2022
@abhishekagarwal87 abhishekagarwal87 added this to the 24.0.0 milestone Aug 26, 2022
@amankothari04
Copy link

@a2l007
I see
this.durationToRetain == null || this.durationToRetain.compareTo(Duration.standardDays(1)) >= 0, "request logs retention period must be atleast P1D"
Shouldnt it be
this.durationToRetain.compareTo(Duration.standardDays(1)) <= 0 ?

We want durationToRetain to be more than a day right? Then why throw error-comment when its more than a day?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants