Skip to content

DataRetention cannot be extended by distributions built on OpenMetadata #31987

Closed

Description

@pmbrull

Problem

DataRetention (openmetadata-service/.../apps/bundles/dataRetention/DataRetention.java) hardcodes every cleanup it performs. A distribution built on OpenMetadata that adds its own tables has no way to prune them on the same schedule.

Its only options today are:

  • run a second scheduled app, duplicating the batching, entity stats, ACTIVE_ERROR reporting and failure isolation that DataRetention already implements; or
  • not prune at all.

Neither is good. The retention job is exactly the right place for this work — it already knows how to drain a table in batches, record per-entity stats, and mark a run partially failed without aborting the rest.

Proposal

A DataRetentionExtension SPI, following the MigrationProcessExtensionProvider idiom already used for out-of-tree migrations (ServiceLoader + META-INF/services). A provider contributes named RetentionSteps; DataRetention feeds each through its existing executeWithStatsTracking, so extensions inherit the same batching, stats and error reporting as the built-ins.

Extensions run after every built-in cleanup, so a job that fails partway still leaves OpenMetadata's own tables pruned. A provider that throws is isolated and reported rather than allowed to stop the others.

Extension config rides a new extensions map on DataRetentionConfiguration. This is load-bearing rather than cosmetic: DataRetention.init converts with the strict JsonUtils.OBJECT_MAPPER (FAIL_ON_UNKNOWN_PROPERTIES is only disabled on OBJECT_MAPPER_LENIENT), so a downstream key added anywhere but a declared property throws at app init. Declaring it keeps the outer additionalProperties: false, so typos in the built-in keys are still caught.

Nothing changes for an installation with no extensions registered.

Activity

  1. moved this to Release Backlog 🚧 in Shippingon Aug 25, 2026
  2. self-assigned this
    on Aug 26, 2026
  3. moved this from Release Backlog 🚧 to In Review / QA 👀 in Shippingon Aug 26, 2026
  4. moved this from In Review / QA 👀 to Done ✅ in Shippingon Aug 26, 2026
  5. added a commit that references this issue on Aug 26, 2026
    ded7910
  6. added a commit that references this issue on Aug 27, 2026
    3d82f20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

  • Status
    Done ✅
  • Status
    Done ✅

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions