Skip to content

feat(inkless:retention): add LastSuccessfulFileCleanupAgeMs [KC-412] - #746

Merged
jclarysse merged 1 commit into
mainfrom
jeqo/file-cleaner-last-success
Aug 13, 2026
Merged

jclarysse merged 1 commit into
mainfrom
jeqo/file-cleaner-last-success

Conversation

@jeqo

@jeqo jeqo commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

#735 added age-of-last-success gauges so a stuck operation surfaces before a customer reports it, but FileCleaner did not get one. Its counters are all cumulative, so a cleaner that has stopped cycling looks exactly like one with nothing to delete.

Follow the same pattern as LastSuccessfulFileCommitAgeMs: record the clock at the end of every cycle that completes without error and expose the age, returning -1 until the first completion so "never ran" is distinguishable from "just ran".

Cycles with no work count as successful. The gauge answers whether the cleaner is running, not whether it is deleting; delete volume is already covered by FileCleanerFilesRate.

This overlaps with GetFilesToDeleteLastSuccessfulQueryAgeMs, which #735 generated for every control-plane query and which also goes stale when the cleaner stops cycling. The difference is what happens when a cycle starts but never finishes - an S3 delete stalling under throttling keeps the query gauge fresh while no cleanup completes. That case is the reason to scope this to the cycle rather than rely on the query gauge.

@jeqo
jeqo requested a balanced review from Copilot August 12, 2026 16:15

Copilot AI 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.

Pull request overview

Adds a FileCleaner liveness gauge reporting time since the last successful cleanup cycle.

Changes:

  • Records successful cleanup completion, including no-work cycles.
  • Exposes and documents LastSuccessfulFileCleanupAgeMs.
  • Tests successful and failed cycle tracking.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
FileCleaner.java Records successful cycle completion.
FileCleanerMetrics.java Implements and registers the gauge.
FileCleanerMockedTest.java Tests success and failure behavior.
docs/inkless/metrics.rst Documents the new metric.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@jeqo
jeqo marked this pull request as ready for review August 13, 2026 07:54
@jeqo
jeqo requested a review from jclarysse August 13, 2026 07:54
@jeqo jeqo changed the title feat(inkless:retention): add LastSuccessfulFileCleanupAgeMs feat(inkless:retention): add LastSuccessfulFileCleanupAgeMs [KC-412] Aug 13, 2026
jclarysse
jclarysse previously approved these changes Aug 13, 2026

@jclarysse jclarysse 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.

LGTM 👍

@jclarysse
jclarysse enabled auto-merge (squash) August 13, 2026 10:25
@jclarysse
jclarysse disabled auto-merge August 13, 2026 10:29
reports it, but FileCleaner did not get one. Its counters are all cumulative, so a
cleaner that has stopped cycling looks exactly like one with nothing to delete.

Follow the same pattern as LastSuccessfulFileCommitAgeMs: record the clock at the end
of every cycle that completes without error and expose the age, returning -1 until the
first completion so "never ran" is distinguishable from "just ran".

Cycles with no work count as successful. The gauge answers whether the cleaner is
running, not whether it is deleting; delete volume is already covered by
FileCleanerFilesRate.

This overlaps with GetFilesToDeleteLastSuccessfulQueryAgeMs, which #735 generated for
every control-plane query and which also goes stale when the cleaner stops cycling.
The difference is what happens when a cycle starts but never finishes - an S3 delete
stalling under throttling keeps the query gauge fresh while no cleanup completes. That
case is the reason to scope this to the cycle rather than rely on the query gauge.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jeqo
jeqo force-pushed the jeqo/file-cleaner-last-success branch from 18af185 to b905ef8 Compare August 13, 2026 10:33
@jeqo
jeqo requested a review from jclarysse August 13, 2026 11:57

@jclarysse jclarysse 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.

LGTM 👍

@jclarysse
jclarysse merged commit 917413e into main Aug 13, 2026
7 checks passed
@jclarysse
jclarysse deleted the jeqo/file-cleaner-last-success branch August 13, 2026 12:41
jeqo added a commit that referenced this pull request Aug 19, 2026
reports it, but FileCleaner did not get one. Its counters are all cumulative, so a
cleaner that has stopped cycling looks exactly like one with nothing to delete.

Follow the same pattern as LastSuccessfulFileCommitAgeMs: record the clock at the end
of every cycle that completes without error and expose the age, returning -1 until the
first completion so "never ran" is distinguishable from "just ran".

Cycles with no work count as successful. The gauge answers whether the cleaner is
running, not whether it is deleting; delete volume is already covered by
FileCleanerFilesRate.

This overlaps with GetFilesToDeleteLastSuccessfulQueryAgeMs, which #735 generated for
every control-plane query and which also goes stale when the cleaner stops cycling.
The difference is what happens when a cycle starts but never finishes - an S3 delete
stalling under throttling keeps the query gauge fresh while no cleanup completes. That
case is the reason to scope this to the cycle rather than rely on the query gauge.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
jeqo added a commit that referenced this pull request Aug 19, 2026
reports it, but FileCleaner did not get one. Its counters are all cumulative, so a
cleaner that has stopped cycling looks exactly like one with nothing to delete.

Follow the same pattern as LastSuccessfulFileCommitAgeMs: record the clock at the end
of every cycle that completes without error and expose the age, returning -1 until the
first completion so "never ran" is distinguishable from "just ran".

Cycles with no work count as successful. The gauge answers whether the cleaner is
running, not whether it is deleting; delete volume is already covered by
FileCleanerFilesRate.

This overlaps with GetFilesToDeleteLastSuccessfulQueryAgeMs, which #735 generated for
every control-plane query and which also goes stale when the cleaner stops cycling.
The difference is what happens when a cycle starts but never finishes - an S3 delete
stalling under throttling keeps the query gauge fresh while no cleanup completes. That
case is the reason to scope this to the cycle rather than rely on the query gauge.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
jeqo added a commit that referenced this pull request Aug 19, 2026
Covers inkless-release-0.46..inkless-release-0.47. Generated via the
inkless-changelog skill and curated:

- Metric deltas cross-checked against source commits (#716, #735, #743,
  #746, #715); all trace to real, shipped metrics, no documentation
  catch-up noise this increment.
- Postgres migration headers (V23-V26) checked for lock impact; V25 takes
  ACCESS EXCLUSIVE on files for a full-table scan at broker startup, V26
  offers a pre-upgrade CONCURRENTLY workaround.
- Added two config default changes the generator's diff-only detection
  missed (existing keys, not new ones): file.cleaner.interval.ms
  (5min -> 2min, #745) and retention.enforcement.interval.ms /
  max.batches.per.request (#744).
jeqo added a commit that referenced this pull request Sep 9, 2026
Covers inkless-release-0.46..inkless-release-0.47. Generated via the
inkless-changelog skill and curated:

- Metric deltas cross-checked against source commits (#716, #735, #743,
  #746, #715); all trace to real, shipped metrics, no documentation
  catch-up noise this increment.
- Postgres migration headers (V23-V26) checked for lock impact; V25 takes
  ACCESS EXCLUSIVE on files for a full-table scan at broker startup, V26
  offers a pre-upgrade CONCURRENTLY workaround.
- Added two config default changes the generator's diff-only detection
  missed (existing keys, not new ones): file.cleaner.interval.ms
  (5min -> 2min, #745) and retention.enforcement.interval.ms /
  max.batches.per.request (#744).
jeqo added a commit that referenced this pull request Sep 9, 2026
Covers inkless-release-0.46..inkless-release-0.47. Generated via the
inkless-changelog skill and curated:

- Metric deltas cross-checked against source commits (#716, #735, #743,
  #746, #715); all trace to real, shipped metrics, no documentation
  catch-up noise this increment.
- Postgres migration headers (V23-V26) checked for lock impact; V25 takes
  ACCESS EXCLUSIVE on files for a full-table scan at broker startup, V26
  offers a pre-upgrade CONCURRENTLY workaround.
- Added two config default changes the generator's diff-only detection
  missed (existing keys, not new ones): file.cleaner.interval.ms
  (5min -> 2min, #745) and retention.enforcement.interval.ms /
  max.batches.per.request (#744).
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