Repository navigation
Fixes 27041: purge profiler data on table hard delete, and stop the orphan sweep deleting live column profiles - #31556
Conversation
profiler_data_time_series is keyed by FQN hash rather than by table id, so rows survived a hard delete and were silently adopted by the next table created at the same FQN — a re-ingested table served the dead table's row counts and column statistics. TableRepository.entitySpecificCleanup now deletes the table's table.tableProfile and table.systemProfile rows (keyed by the table FQN) and purges table.columnProfile rows, which are keyed by each (possibly nested) column FQN and therefore need a descendant sweep. EntityTimeSeriesDAO gains deleteDescendants(entityFQN, extension), backed by a dialect-aware prefix DELETE that runs in bounded batches (1000 rows per statement, 1000 batches per call) so the purge can never issue an unbounded DELETE. The hook only runs on the hard-delete branch, so soft-deleted tables keep serving their profiles; the bulk cascade routes through the same hook, so a recursive schema/database/service hard delete is covered too. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…olumn profiles ProfilerDataTimeSeriesDAO.deleteOrphanedRecords compared every profiler_data_time_series row against table_entity.fqnHash with no extension filter. FullyQualifiedName.buildHash hashes each FQN part and joins with '.', so a column profile's entityFQNHash carries at least one more segment than a table's four-segment fqnHash and could never match. Every table.columnProfile row of every live table was therefore classified as an orphan and deleted on each weekly DataRetention run. Column-profile rows now resolve to their parent table by taking the first four hash segments — SUBSTRING_INDEX on MySQL, chained split_part on PostgreSQL — which also covers nested columns. Other extensions keep the previous raw-hash comparison, and genuine orphans are still swept. OrphanedTimeSeriesCleanupIT.profilerDataOrphans previously seeded only a table-level row, which is why this went unnoticed; it now covers all three extensions plus a nested-column row and an orphaned column row. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Review follow-ups on the table hard-delete purge. Signal cap exhaustion. deleteDescendants returned only a row total, so "drained" and "stopped at the 1,000,000-row cap" were indistinguishable, and the outcome was logged at DEBUG. It now returns a DescendantPurge record and TableRepository logs at INFO, or WARN when the cap truncated the purge. That case matters: if the table is re-created at the same FQN the leftovers regain a live parent, so the orphan sweep will never reclaim them and only age-based retention will. Skip the purge when there is nothing to purge. The descendant delete matches an FQN-hash prefix, which PostgreSQL cannot serve from the b-tree index under the default collation, so it scans profiler_data_time_series. A recursive service hard delete issued one scan per table, profiled or not. The purge now runs only when the indexed table-level deletes removed rows or an indexed exact-hash probe over the table's columns finds one, so a never-profiled table costs nothing. EntityTimeSeriesDAO.delete returns its row count for this; every existing caller discards it. The new IT seeds one more row than a single batch and writes no table-level profile, so it pins both the drain loop and the probe. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…he gate The gate added in the previous commit skipped the descendant purge unless the table had table-level profiler rows or one of its *current* columns had a profile. Dropping a column does not delete its profiler rows, so a table whose only rows belonged to a since-dropped column satisfied neither signal and was never purged — re-ingesting at the same FQN resurfaced the dead table's profile for that column, which is the bug this issue is about. The purge is unconditional again. The gate existed to avoid a sequential scan, so remove the reason for it instead. Migration 2.1.1 adds a text_pattern_ops index on profiler_data_time_series(entityFQNHash), built CONCURRENTLY. Measured on postgres:15 with en_US.utf8 and 300k rows, the terminal batch of every purge goes from a 24.174 ms parallel seq scan over 11112 buffers to a 0.056 ms index scan over 3. text_pattern_ops rather than varchar_pattern_ops because JDBC binds the prefix as text and the planner compares (entityfqnhash)::text, which the varchar opclass need not match — the same reasoning 1.13.0 recorded for the fqnHash index family. The MySQL script is deliberately statement-free: entityFQNHash is ascii_bin and already leads the unique index, and an IT now pins both that premise and the Postgres index rather than leaving them as assertions. capReached no longer false-positives when the subtree size is an exact multiple of the batch size, and the cap warning states its consequence conditionally, since the orphan sweep does drain the remainder when the table is not re-created. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…ng test The pre-purge existence probe was removed when the gate was withdrawn, but the batching test still described it. The javadoc told a future reader the test pins a probe that no longer exists, and the assertion that no table-level profile row had been written was that probe's precondition — vacuous now that deleteDescendants is unconditional. Comments and one dead assertion only; the test's behaviour, and the seeding at one row beyond a batch that makes it load-bearing, are unchanged. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
There was a problem hiding this comment.
Pull request overview
Fixes profiler-data lifecycle defects for tables by (1) purging profiler_data_time_series on table hard delete (preventing stale profiles from resurfacing on re-creation at the same FQN) and (2) correcting the DataRetention orphan sweep so it no longer deletes live column profiles that cannot match table_entity.fqnHash due to hash-segment length differences.
Changes:
- Wire hard-delete-only profiler purge into
TableRepository.entitySpecificCleanup, including descendant (column) profile deletion. - Add bounded, batched descendant deletion support to
EntityTimeSeriesDAOvia hash-prefix deletes. - Fix
ProfilerDataTimeSeriesDAO.deleteOrphanedRecordsto resolve column-profile rows to their parent table hash (first 4 hash segments). - Add/extend integration tests covering hard/soft delete behaviors, cascade deletes, batching, orphan sweep correctness, and migration/index premises; add Postgres pattern index migration (MySQL intentionally statement-free).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TableRepository.java | Add hard-delete-only cleanup to purge table/system profiles and descendant column profiles, plus operational logging. |
| openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityTimeSeriesDAO.java | Introduce bounded batched hash-prefix deletes and DescendantPurge result for descendant purges. |
| openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/CollectionDAO.java | Fix orphan sweep predicate to preserve live column profiles by matching against parent table hash. |
| openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/TableResourceIT.java | Add integration coverage for hard vs soft delete profiler preservation/purge, cascade deletion, batching, and dropped-column history purge. |
| openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/OrphanedTimeSeriesCleanupIT.java | Expand orphan cleanup test coverage to include all profiler extensions (incl. nested columns) and verify Postgres/MySQL indexing premises. |
| bootstrap/sql/migrations/native/2.1.1/postgres/schemaChanges.sql | Add text_pattern_ops index to support LIKE '<hash>.%' prefix scans for hard-delete descendant purges on Postgres. |
| bootstrap/sql/migrations/native/2.1.1/mysql/schemaChanges.sql | Document why no MySQL schema change is needed (existing collation + unique index supports prefix range scans). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…portable form The MySQL and Postgres variants existed only because Postgres has no SUBSTRING_INDEX -- split_part returns a single field, so the same extraction took four calls and three concatenations. Neither is needed. Every hash segment is MD5 hex, so a table fqnHash is always exactly four 32-char segments plus three dots = 131 characters, and LEFT(entityFQNHash, 131) yields the parent table hash on both engines. The CASE went with them. Extracting the parent is a no-op for table-level rows, which are already 131 characters, so branching on the extension was dead weight; the predicate no longer references TABLE_COLUMN_PROFILE_EXTENSION at all. Verified on a fixture with the real column types, collation and indexes (5,000 tables / 105,250 rows / 250 planted orphans): LEFT(hash,131) differs from the previous extraction on zero rows on either engine, and the sweep returns the same 250 orphans. Timed as the identical query, MySQL 8 goes 89.9ms -> 32.1ms and Postgres 15 36.3ms -> 46.5ms; both keep the Hash Anti Join, so this is a readability change rather than a performance one. Running the exact statements JDBI emits deletes 250 on both -- MySQL 8 accepts a table alias alongside LIMIT in a single-table DELETE, which is what lets the predicate be shared. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
| // table_entity per profiler row: 32s vs 106ms on Postgres 15, 76s vs 247ms on MySQL 8 over 5k | ||
| // tables / 105k rows. 1.9.9/postgres/postDataMigrationSQLScript.sql resolves the same parent | ||
| // for the same reason, noting it is "much faster than LIKE". | ||
| String PARENT_TABLE_HASH = "LEFT(pdts.entityFQNHash, 131)"; |
There was a problem hiding this comment.
This relies on the hash function being constant (i.e. each segment of the fqn is an MD5 hash separated by dots.)
Code Review ✅ Approved 3 resolved / 3 findingsAsynchronous profiler data purging on table hard delete and optimized orphan cleanup predicates for live column profiles. No issues found. ✅ 3 resolved✅ Performance: Table/system profile purge issues one unbounded DELETE
✅ Performance: Orphan sweep predicate is non-sargable, regressing weekly cleanup
✅ Bug: Async profiler purge can delete a re-created table's live profiles
OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
Fixes #27041
I fixed two independent defects in the lifecycle of
profiler_data_time_series, both rooted in the fact that the table is keyed by FQN hash, not by entity id.(A) The filed bug — hard delete leaks profiler rows, and a re-created table inherits them.
TableRepositorynever touchedprofiler_data_time_serieson delete. Nothing else in the hard-delete path does either:EntityRepository.cleanupdeliberately skips time-series children and leaves them to the offlineDataRetentionsweep. So hard-deleting a table left every one of itstable.tableProfile,table.systemProfileandtable.columnProfilerows behind, and because the table is keyed by FQN hash, the next table created at the same FQN (re-ingestion, rename-and-recreate, IaC replay) silently adopted them —GET /v1/tables/{fqn}/tableProfile/latestreturned the dead table's row counts and column statistics for a brand-new table.(B) A second defect found while fixing (A) — the weekly sweep was deleting live column profiles. Please do not skim this one.
CollectionDAO.ProfilerDataTimeSeriesDAO.deleteOrphanedRecordsdeleted any row whereNOT EXISTS (SELECT 1 FROM table_entity te WHERE te.fqnHash = profiler_data_time_series.entityFQNHash), with no extension filter.FullyQualifiedName.buildHashhashes each FQN part (MD5 hex) and joins with., so a table'sfqnHashalways has exactly 4 dot-joined segments (service.database.schema.table) while a column profile'sentityFQNHashhas 5 or more. The two can never be equal. Everytable.columnProfilerow of every live, healthy table was therefore classified as an orphan and deleted on eachDataRetentionrun — a weekly cron (0 0 * * 0). That is silent data loss of column-level profiling history, and it is arguably more severe than the filed bug.It went unnoticed because
OrphanedTimeSeriesCleanupIT.profilerDataOrphansonly ever seeded a table-level row.The fix resolves a column-profile row to its parent table by taking the first four hash segments —
SUBSTRING_INDEX(entityFQNHash, '.', 4)on MySQL, four chainedsplit_part(...)on PostgreSQL. Stripping exactly one segment would be wrong: nested/struct columns have FQNs likeservice.db.schema.table.parent.child, so their hashes carry 6+ segments and would still fail to match. Non-column extensions keep the previous raw-hash comparison, and genuinely orphaned rows are still swept.This second defect was folded into this PR with the maintainer's explicit approval rather than filed separately, because it lives in the same table, is caused by the same hashing property, and the two fixes interact: (A)'s correctness depends on (B) no longer mis-classifying live rows.
Type of change:
High-level design:
(A) Where the purge runs, and the two properties that make it safe.
The purge is issued from
TableRepository.postDelete, on the hard-delete branch only, throughAsyncService.executeDatabaseTask(DatabaseOperation.PROFILER_CLEANUP, …). It is one unboundedDELETEper extension — no batching, no iteration cap.It does not run inside
entitySpecificCleanup, which executes insideEntityRepository.cleanup'stransaction. A table with a long profiling history can own millions of profiler rows; draining them
there holds every row lock for the life of the request, and batching inside a single transaction
buys nothing — the locks are held to the end either way, so it is the same peak cost spread over
~1,700 round-trips instead of one statement.
Two ordering properties make the asynchronous purge safe, and they cover different failures:
table's history — those rows legitimately predate the attempt.
timestamp <= :deletedAt).profiler_data_time_seriescarries no table id, so a purge that lands after the FQN has beenreused cannot otherwise tell the dead table's rows from its successor's. Everything a successor
records happens after the delete, so the watermark makes the purge safe to run at any later
point, and idempotent when it runs more than once.
Property 2 is what removes the need for a cap: the statement is unbounded because it no longer needs
to be bounded to be correct. An earlier revision of this PR ran the purge synchronously and capped it
at 1,001,000 rows; that cap silently truncated large tables, and truncated rows regain a live parent
if the FQN is reused — reintroducing the exact symptom of this issue at scale. Both are gone.
Why a prefix delete is required, not three exact deletes.
Table and system profiles are written under the table FQN, so an exact-match delete suffices.
Column profiles are written under each column FQN (
TableRepository.addTableProfileData, andEntityProfileRepository.addProfileDatafor the standalone endpoint), including nested columns.Those rows are not enumerable from the table's current column list either — dropping a column does
not delete its profiler rows, so the only complete way to reach them is the FQN-hash prefix
'<table hash>.%'.delete_hardDeletePurgesProfilesOfDroppedColumnspins that.(B) Why the orphan predicate resolves the parent from the outer row.
Correlating the other way —
entityFQNHash LIKE te.fqnHash || '.%'— computes the LIKE pattern fromthe inner row, which leaves no equijoin key, so both planners degrade to a nested loop over
table_entityfor every profiler row. Resolving the parent from the outer row keeps a singleequality and preserves the hash anti-join.
Measured on a fixture reproducing the real column types, collation and indexes (5,000 tables /
105,250 profiler rows / 250 planted orphans), issuing the exact statement the DAO issues:
LIKE-correlated (nested loop)Both return the same 250 orphans, with an empty symmetric difference in both directions, on both
engines. The PostgreSQL plans are
Nested Loop Anti JoinwithRows Removed by Join Filter: 263,697,500versusHash Anti Join. Cost is O(profiler_rows × tables), so the nested-loop formstops completing rather than merely slowing on a large catalog — which matters directly here,
because this PR ships no backfill and relies on the sweep to reclaim historical orphans.
Database migration:
Appended to
bootstrap/sql/migrations/native/2.0.0/{postgres,mysql}/schemaChanges.sql.PostgreSQL — adds
idx_profiler_data_time_series_fqnhash_pattern, atext_pattern_opsindex onentityFQNHash, builtCONCURRENTLYso the migration takes no write lock.Without it, the prefix delete cannot use an index. The only persistent index with
entityFQNHashleading is the 1.1.5 unique constraint(entityFQNHash, extension, operation, timestamp); it uses the default operator class and the column inherits the database default collation, neither of which qualifies the planner forLIKE 'prefix%'. (1.9.9 does createidx_pdts_entityFQNHash_prefix, but the same script drops it again at the end — it is a migration-time helper, not a persistent index.) So every table hard delete cost at least one sequential scan ofprofiler_data_time_series, and a recursive service delete cost one per table.Measured on
postgres:15(lc_collate=en_US.utf8, matching managed Postgres/RDS) against the real 1.1.5 DDL with 300k rows / 211 MB, issuing the exact statement the DAO issues with the prefix bound as text the way JDBC binds it:Parallel Seq Scan, 24.174 ms, 11112 buffersIndex Scan, 0.056 ms, 3 buffersSeq Scan, 16.579 ms, 3701 buffersBitmap Heap Scan, 8.647 ms, 1006 buffersIndex size 2776 kB against a 211 MB table.
Why
text_pattern_opsand notvarchar_pattern_ops.entityFQNHashisVARCHAR(768), sovarchar_pattern_opsis the type-matched choice on paper. But the planner normalisesvarchar LIKE text— what every JDBCsetStringbind produces — by casting the column, and the filter in the measured plan is literally(entityfqnhash)::text ~~ ….1.13.0/postgres/schemaChanges.sqlrecords this repo hitting a production environment wherevarchar_pattern_opswas consequently unused and the table seq-scanned, and the existingidx_*_fqnhash_patternfamily settled ontext_pattern_opsfor that reason. To be plain: on PostgreSQL 15 both opclasses planned identically as anIndex Scanin my fixture. This is a consistency-and-robustness choice across versions and environments, not a difference this benchmark demonstrates.MySQL — deliberately statement-free, with the reasoning in the file rather than left as an unexplained empty script.
profiler_data_time_series.entityFQNHashhas beenVARCHAR(768) CHARACTER SET ascii COLLATE ascii_binsince 1.1.5 — a binary collation — so InnoDB already answers aLIKEprefix predicate with a range scan on the leading column of the existing unique index. Adding a second index on the same leading column would be write overhead with no read benefit.Operator runbook — interrupted
CREATE INDEX CONCURRENTLY. An interrupted build leaves an INVALID index behind, andIF NOT EXISTSthen no-ops against it forever. This is a known pattern-level gap shared with the 1.11.0 and 1.13.0 index migrations. The full detection query and remediation are in the migration file header; in short:The version above is 2.0.0, not 2.1.1 —
fcece67moved this migration onto the 2.0 train. Acleanup keyed on 2.1.1 matches nothing.
No data migration is included. With (B) corrected, the existing weekly sweep reclaims genuinely-orphaned historical rows on its own while preserving live column profiles.
Tests:
Use cases covered
GET /v1/tables/{fqn}/tableProfile/latestkeeps serving them (it resolves withInclude.ALL).DataRetentionorphan sweep preserves column profiles of live tables — including nested-column profiles — while still deleting rows whose parent table no longer exists.Unit tests
Not applicable — no unit-testable logic was added. The change is JDBI DAO SQL plus repository wiring, whose behaviour is only meaningful against a real database; asserting it with mocks would test mock wiring rather than whether rows are actually deleted. Covered by integration tests instead.
Backend integration tests
openmetadata-integration-tests/.TableResourceIT.java:delete_hardDeletePurgesProfilerDataprofile == null, allcolumns[*].profile == null, and an emptysystemProfiledataarraydelete_hardDeletePurgeSpareProfilesRecordedAfterTheDeletedelete_softDeletePreservesProfilerDatadelete_hardDeleteOfSchemaPurgesTableProfilerDatadelete_hardDeletePurgesLargeColumnProfileHistorydelete_hardDeletePurgesProfilesOfDroppedColumnsPUT /v1/tables, is still purged on hard delete; asserts its own precondition that dropping a column leaves the rows behindOrphanedTimeSeriesCleanupIT.java:profilerDataOrphansdeleteOrphanedRecords, a live table's table / system / column / nested-column rows all survive, while table-level and column-level rows under a non-existent table are removedprofilerPrefixIndexIsAvailablepg_index.indisvalid. MySQL:entityFQNHashis the leading column of the unique index and its collation isascii_bin— the two facts that make the statement-free MySQL script correctEvery assertion is a row count in
profiler_data_time_seriesor a field of an HTTP response body — no mocks, noverify(), noThread.sleep. The purge is now asynchronous, so the delete-path assertions await withAwaitilityrather than asserting inline.Results — MySQL 8 + Elasticsearch, run in both the
isolated-testsandparallel-testsfailsafe lanes (each applies the whole native migration chain from scratch against a fresh testcontainer, so this also exercises the migration end to end):RED check on the new watermark test. Neutralising the predicate (
AND timestamp <= :deletedAt→ an always-true bound) and re-runningdelete_hardDeletePurgeSpareProfilesRecordedAfterTheDeletefails for exactly the right reason — the purge takes the successor's row too:Ingestion integration tests
Not applicable — no ingestion changes.
Playwright (UI) tests
Not applicable — no UI changes.
Manual testing performed ✅
Re-run end to end against the asynchronous design on a local Docker stack (MySQL 8 + Elasticsearch),
server built from this branch. The instance was returned to its exact starting state afterwards
(195 tables, 3 profiler rows, no leftover fixtures).
A — hard delete purges profiler data. Create service/database/schema/table with columns
idandname, thenPUT /v1/tables/{id}/tableProfilewith a table, column and system profile.SELECT extension, COUNT(*) …— one row per extension;GET /v1/tables/{fqn}/tableProfile/latest?includeColumnProfile=truereturns
profile.rowCount = 42andcolumns[0].profile.uniqueCount = 42.DELETE /v1/tables/{id}?hardDelete=true→ all three counts drain to 0.profile: null, everycolumns[*].profilenull, andGET /v1/tables/{fqn}/systemProfile?startTs=0&endTs={now}returns"data": [].rowCount = 42still served.DELETE /v1/databaseSchemas/{id}?hardDelete=true&recursive=truedrains its rows (the bulk path reaches
postDeleteper entity viabulkHardDeleteSubtree).Scale. A single table seeded with 1,200,000 column-profile rows — deliberately above the
1,001,000 ceiling the removed cap imposed:
One statement, no truncation, on the bounded
AsyncServiceexecutor. Under the capped design thiswould have stopped at 1,001,000 and stranded ~199,000 rows — unreclaimable by the sweep if the FQN
were reused. Timing the raw statement separately: 300,000 rows in 7.27s, so ~29s at 1.2M, all off
the request path. That delete is one transaction, so it holds those row locks for its duration; a
concurrent count over the same rows blocks until it completes.
B — the weekly sweep no longer eats live column profiles. Seeded 297,509 profiler rows across the
instance's 198 live tables (including a nested-column row, 6 hash segments) plus 500 planted orphans,
then triggered
POST /v1/apps/trigger/DataRetentionApplicationwith-H 'Content-Type: application/json' -d '{}':Exactly the 500 orphans removed, every live row kept. Both predicates timed on that same real data,
returning the same 500 orphans:
19.6× at only 198 tables; the gap grows with table count.
C — the index migration. The migration ships in 2.0.0 (moved there by
fcece67); any runbookor check referencing 2.1.1 is stale, including the
server_migration_sql_logscleanup predicate.On MySQL the premises behind the statement-free script were confirmed on a migrated instance: only
the 1.1.5 unique index and
combined_id_tsare present (nothing added),entityFQNHashisvarchar(768) ascii ascii_bin,server_migration_sql_logsholds 93 statements for 2.0.0 and zerofor the index, and
EXPLAINon the purge predicate givestype=range,key=profiler_data_time_series_unique_hash_extension_ts,key_len=1796,Using where; Using index— index-driven, not a scan.
Not verified by hand: the PostgreSQL branch (
idx_profiler_data_time_series_fqnhash_patternandits
indisvalidcheck) — the manual stack and the IT runs were both MySQL. It is covered byOrphanedTimeSeriesCleanupIT.profilerPrefixIndexIsAvailableon a Postgres CI lane.Residual risk:
Stated plainly rather than hedged, so reviewers can weigh them:
AsyncServiceis an in-process executor, so a server restart in that window drops the task. If the table is not re-created, the weekly orphan sweep reclaims the rows normally. If it is re-created at the same FQN before the sweep runs, the leftovers regain a live parent and the sweep can never reclaim them — only age-based retention (profileDataRetentionPeriod, default 1440 days) will. The window is the seconds between commit and drain, versus the permanent leak this PR replaces. A durable queue (background_jobs) would close it; that was judged not worth the machinery for a window this narrow, given the watermark already makes a late purge harmless.PUT .../tableProfilebackfill with an explicit historical timestamp, or clock skew — and the purge is still pending. Closing this fully would need a write-time column on a very large table, which is not worth the migration.table.columnProfilerows for columns dropped from a still-live table are therefore retained until age-based retention removes them. Before this PR they were deleted weekly — but only as collateral damage of defect (B), which deleted every live column's profiles along with them. The trade-off is deliberate.CONCURRENTLYrunbook is documented, not automated. Same gap as 1.11.0 and 1.13.0.UI screen recording / screenshots:
Not applicable — no UI changes.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.🤖 Generated with Claude Code
Greptile Summary
The PR asynchronously purges profiler history after table hard deletion and corrects orphan cleanup so live column profiles resolve to their parent table.
Confidence Score: 4/5
The PR does not yet appear safe to merge because a recreated table can still lose backdated successor profiles to the predecessor's delayed purge.
The purge identifies ownership using a reused FQN and the profile's caller-controlled logical timestamp, so a valid historical profile written by the successor before cleanup runs remains indistinguishable from predecessor data and is deleted.
Files Needing Attention: openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/CollectionDAO.java, openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TableRepository.java
Important Files Changed
Sequence Diagram
Reviews (7): Last reviewed commit: "refactor(profiler): collapse the orphan ..." | Re-trigger Greptile
Context used: