Skip to content

Add requirePersistence option to worker logGroomerSidecar#65884

Merged
jscheffl merged 4 commits into
apache:chart/v1-2x-testfrom
ericxiao251:ericxiao/log-groomer-require-persistence-flag
Apr 28, 2026
Merged

Add requirePersistence option to worker logGroomerSidecar#65884
jscheffl merged 4 commits into
apache:chart/v1-2x-testfrom
ericxiao251:ericxiao/log-groomer-require-persistence-flag

Conversation

@ericxiao251

Copy link
Copy Markdown
Contributor

Context

Currently, the worker log groomer sidecar only renders when workers.persistence.enabled is true (i.e., StatefulSet mode). This prevents using the log groomer on Deployments with emptyDir volumes for logs.

This change adds a new requirePersistence option that defaults to true, preserving full backwards compatibility. When set to false, the log groomer can be enabled regardless of whether persistence is enabled.

This is useful for deployments that:

  • Use emptyDir for local logs with remote logging (S3, GCS, etc.)
  • Want to clean up local log files to prevent ephemeral storage exhaustion
  • Prefer Deployments over StatefulSets for workers

Configuration

workers:
  logGroomerSidecar:
    enabled: true
    requirePersistence: false  # Allow log groomer on Deployments

Backward Compatibility

This change is fully backwards compatible. The new requirePersistence option defaults to true, which preserves the existing behavior where log groomer only renders when persistence is enabled.

persistence enabled requirePersistence Log groomer renders
true true true (default)
true false true (default)
false true true (default) ✗ (existing behavior)
false true false ✓ (new opt-in behavior)

Was generative AI tooling used to co-author this PR?
  • Yes - Claude (Anthropic)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@jscheffl

Copy link
Copy Markdown
Contributor

I actually favor #65852 over this alternative here.

@potiuk potiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

NICE!

@potiuk

potiuk commented Apr 27, 2026

Copy link
Copy Markdown
Member

I actually favor #65852 over this alternative here.

But this one can be done to v1-2 branch for compatiblity ?.. @ericxiao251 -> maybe you can change the base to chart/v1-2x-test if @jscheffl will be ok with it ?

@ericxiao251

Copy link
Copy Markdown
Contributor Author

I actually favor #65852 over this alternative here.

But this one can be done to v1-2 branch for compatiblity ?.. @ericxiao251 -> maybe you can change the base to chart/v1-2x-test if @jscheffl will be ok with it ?

Awesome, will wait for his response before changing the base branch :).

@jscheffl

Copy link
Copy Markdown
Contributor

I actually favor #65852 over this alternative here.

But this one can be done to v1-2 branch for compatiblity ?.. @ericxiao251 -> maybe you can change the base to chart/v1-2x-test if @jscheffl will be ok with it ?

Awesome, will wait for his response before changing the base branch :).

I'd be okay, but we then need to add a small marker/note to the docs of the (new) parameter that this is only transitional for the chart v1.2x and will be fixed generally in chart 2.x

@ericxiao251 ericxiao251 changed the base branch from chart/v1-2x-test to main April 27, 2026 19:41
@ericxiao251 ericxiao251 force-pushed the ericxiao/log-groomer-require-persistence-flag branch from 5cd40a6 to 41e1586 Compare April 27, 2026 19:44
ericxiao251 and others added 3 commits April 27, 2026 15:46
Currently, the worker log groomer sidecar only renders when
persistence is enabled (i.e., when using StatefulSets). This
prevents using the log groomer on Deployments with emptyDir
volumes for logs.

This change adds a new `requirePersistence` option that defaults
to `true` (preserving backwards compatibility). When set to `false`,
the log groomer can be enabled regardless of whether persistence
is enabled.

This is useful for deployments that:
- Use emptyDir for local logs with remote logging (S3, GCS, etc.)
- Want to clean up local log files without using StatefulSets
- Prefer Deployments over StatefulSets for workers

Configuration:
- `workers.logGroomerSidecar.requirePersistence: false`
- `workers.celery.logGroomerSidecar.requirePersistence: false`

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Updates test cases descriptions.

Remove unrelated check in test.
Document that requirePersistence is transitional for chart 1.2x and
will be removed in chart 2.x when log groomer works without persistence
by default.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ericxiao251 ericxiao251 force-pushed the ericxiao/log-groomer-require-persistence-flag branch from 41e1586 to a698b77 Compare April 27, 2026 19:46
@ericxiao251 ericxiao251 changed the base branch from main to chart/v1-2x-test April 27, 2026 19:46
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ericxiao251

Copy link
Copy Markdown
Contributor Author

I actually favor #65852 over this alternative here.

But this one can be done to v1-2 branch for compatiblity ?.. @ericxiao251 -> maybe you can change the base to chart/v1-2x-test if @jscheffl will be ok with it ?

Awesome, will wait for his response before changing the base branch :).

I'd be okay, but we then need to add a small marker/note to the docs of the (new) parameter that this is only transitional for the chart v1.2x and will be fixed generally in chart 2.x

Ok I've added the notes, fixed the CI that were failing in main and also rebased the PR/commits onto the chart/v1-2x-test branch.

@jscheffl jscheffl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good for me. Also OK for others?

@jscheffl jscheffl merged commit 6686730 into apache:chart/v1-2x-test Apr 28, 2026
2 checks passed
@boring-cyborg

boring-cyborg Bot commented Apr 28, 2026

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

@ericxiao251 ericxiao251 deleted the ericxiao/log-groomer-require-persistence-flag branch April 29, 2026 13:54
@dabla

dabla commented May 7, 2026

Copy link
Copy Markdown
Contributor

Nice work @ericxiao251 we actually needed this thx!

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

Labels

area:helm-chart Airflow Helm Chart

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants