Repository navigation
Add persisted telemetry maintenance - #342
Open
gmemuriuki wants to merge 3 commits into
Open
gmemuriuki wants to merge 3 commits into
gmemuriuki wants to merge 3 commits into
Conversation
gmemuriuki
force-pushed
the
telemetry/recording-maintenance
branch
from
October 14, 2026 07:14
0b71316 to
b67e26c
Compare
gmemuriuki
force-pushed
the
telemetry/recording-maintenance
branch
from
October 14, 2026 07:51
b67e26c to
4f7fdbe
Compare
nikomatsakis
force-pushed
the
telemetry/recording-maintenance
branch
from
October 16, 2026 09:02
4f7fdbe to
322fe43
Compare
gmemuriuki
force-pushed
the
telemetry/recording-maintenance
branch
3 times, most recently
from
October 21, 2026 07:23
121b351 to
82f02a8
Compare
nikomatsakis
force-pushed
the
telemetry/recording-maintenance
branch
8 times, most recently
from
October 27, 2026 12:47
d24b961 to
6fa88e1
Compare
gmemuriuki
force-pushed
the
telemetry/recording-maintenance
branch
2 times, most recently
from
October 28, 2026 13:24
65c7a99 to
5e37ed0
Compare
Create private-state and metric replacement temporaries inside the locked telemetry directory. This gives cleanup one narrow root while preserving atomic replacement when the config and telemetry directories share a filesystem.
Record the last accepted day on which maintenance was attempted and validate it against the private-state high-water mark. Require an accepted recording observation before minting the single-use maintenance token.
Remove D31 daily files and abandoned regular temporaries with one best-effort scan under the telemetry lock. Release maintenance authority only after private state persists and publication has been attempted.
gmemuriuki
force-pushed
the
telemetry/recording-maintenance
branch
from
October 29, 2026 12:58
5e37ed0 to
c4bdeb0
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR adds opportunistic telemetry maintenance to the persisted recording transaction. It does not activate recording in production.
Private state records the last accepted day on which maintenance was attempted and rejects a marker beyond the latest-opened-day high-water mark. Scheduling requires an accepted lifecycle observation, records attempts rather than success, and survives telemetry clear and identifier rotation.
A single-use maintenance token travels through preparation and the persisted-recording receipt. Publication releases it only after private state has been replaced and public writes have been attempted, so cleanup cannot run from a pre-persistence failure path.
Maintenance performs one non-recursive, best-effort scan under the telemetry lock. It removes D31 event and metric files plus abandoned regular replacement temporaries, ignores symlinks, directories, and unknown names, and continues after individual inspection or removal failures. Replacement temporaries now live under that one cleanup root.
Tests cover canonical state round trips, marker validation and lifecycle preservation, D30/D31 retention, future files, temporary cleanup, lock-file survival, per-entry failures, publication failure, and token ordering.
Disclosure questions
AI disclosure.
Questions for reviewers.
Is the persisted attempt throttle paired with the receipt-carried token sufficient to keep cleanup ordered, bounded, and incapable of running before the state that scheduled it is durable?