fix(ingest/gc): retain non-ingestion execution requests via source.type fallback#18258
Merged
Conversation
…pe fallback datahub-gc's execution_request_cleanup grouped execution requests for retention solely by source.ingestionSource, and hard-deleted any request without one as a "corrupted" record on every run - bypassing the min/max-count, max-age, and RUNNING/PENDING safeguards. Only ingestion runs populate ingestionSource. Non-ingestion execution requests (assertion/monitor "observe" workloads, agent tasks, evals, connection tests) legitimately set only source.type, so they were being deleted immediately regardless of age or status. Fall back to source.type when ingestionSource is absent so these records get real, bucketed retention, and add per-source.type retention overrides so non-ingestion requests can use a different (typically shorter) policy than ingestion runs. A record is treated as corrupted only when it has neither ingestionSource nor source.type. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Add a test asserting two distinct ingestion sources are retained in independent buckets, guarding against a regression that collapses grouping by source.type instead of ingestion source URN. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
skrydal
reviewed
Jul 9, 2026
skrydal
reviewed
Jul 9, 2026
- Drop the dead corrupted-record branch; unattributable records (no ingestion source and no source.type) now fall into a single UNKNOWN bucket capped at UNKNOWN_SOURCE_MAX_COUNT instead of being deleted. - Make CleanupRecord.source_type non-defaulted, consistent with siblings. - Keep the bootstrap recipe's source_type_overrides empty by default; deployments provide overrides via DATAHUB_GC_BOOTSTRAP_VALUES. - Use a generic source.type in tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
sgomezvillamor
approved these changes
Jul 10, 2026
Connector Tests ResultsAll connector tests passed for commit To skip connector tests, add the Autogenerated by the connector-tests CI pipeline. |
skrydal
reviewed
Jul 14, 2026
Comment on lines
285
to
+297
| if key not in state: | ||
| state[key] = {} | ||
| state[key]["cutoffTimestamp"] = ( | ||
| entry.requested_at - self.config.keep_history_max_milliseconds() | ||
| # Retention is resolved once per bucket, from the source.type of the | ||
| # record that opens it, so a per-type override can apply a distinct policy. | ||
| retention = self.config.get_retention( | ||
| entry.source_type or UNKNOWN_SOURCE_KEY | ||
| ) | ||
| state[key] = _BucketState( | ||
| min_count=retention.min_count, | ||
| max_count=retention.max_count, | ||
| cutoff_timestamp=entry.requested_at - retention.max_milliseconds, | ||
| ) | ||
|
|
||
| state[key]["count"] = state[key].get("count", 0) + 1 | ||
| bucket = state[key] |
Collaborator
There was a problem hiding this comment.
Minor suggestion, not a blocker. This mechanism might be simplified with defaultdict and a dedicated helper function to create a new bucket.
asikowitz
pushed a commit
that referenced
this pull request
Jul 14, 2026
…pe fallback (#18258) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
No description provided.