Skip to content

Fixes #27001: Delete pipeline execution history on hard delete#27037

Open
RajdeepKushwaha5 wants to merge 3 commits intoopen-metadata:mainfrom
RajdeepKushwaha5:fix/27001-pipeline-hard-delete-execution-history
Open

Fixes #27001: Delete pipeline execution history on hard delete#27037
RajdeepKushwaha5 wants to merge 3 commits intoopen-metadata:mainfrom
RajdeepKushwaha5:fix/27001-pipeline-hard-delete-execution-history

Conversation

@RajdeepKushwaha5
Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #27001

When a Pipeline entity is permanently deleted (hardDelete=true), the execution status records in the entity_extension_time_series table were left behind. If a pipeline with the same fully qualified name was recreated later, the stale historical execution data would resurface in the UI's Task Execution tab.

Root cause: PipelineRepository.entitySpecificCleanup() only cleaned up lineage relationships but did not delete time series records. The base EntityRepository.cleanup() deletes from entity_extension but not from entity_extension_time_series — these are separate tables/DAOs.

Fix: Added entityExtensionTimeSeriesDao().delete(fqn, PIPELINE_STATUS_EXTENSION) to entitySpecificCleanup(), which runs within the same transaction as the rest of the hard-delete cleanup. This mirrors the existing pattern in IngestionPipelineRepository.postDelete() (line 487-489) which already handles this correctly for ingestion pipelines.

Testing: The deletion call uses the existing EntityTimeSeriesDAO.delete(entityFQNHash, extension) method which executes a simple DELETE FROM entity_extension_time_series WHERE entityFQNHash = :entityFQNHash AND extension = :extension. This is a well-established DAO method already used by IngestionPipelineRepository, TestCaseRepository, and deletePipelineStatus() within this same class.

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

…delete

When a Pipeline entity was permanently deleted (hardDelete=true), the execution
status records in entity_extension_time_series were left behind. Recreating a
pipeline with the same name would surface stale historical execution data.

Add entityExtensionTimeSeriesDao().delete() call in entitySpecificCleanup() to
remove all pipeline status time series records keyed by the pipeline FQN. This
mirrors the existing pattern in IngestionPipelineRepository.postDelete() and runs
within the same transaction as the rest of the cleanup.
Copilot AI review requested due to automatic review settings April 4, 2026 13:24
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes orphaned pipeline execution history when a Pipeline entity is hard deleted, preventing stale Task Execution data from reappearing if a pipeline is recreated with the same FQN.

Changes:

  • Delete pipeline.pipelineStatus time-series rows from entity_extension_time_series during hard-delete cleanup.
  • Keep existing lineage cleanup behavior intact.

@harshach harshach added the safe to test Add this label to run secure Github workflows on PRs label Apr 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

🟡 Playwright Results — all passed (22 flaky)

✅ 3665 passed · ❌ 0 failed · 🟡 22 flaky · ⏭️ 89 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 479 0 2 4
🟡 Shard 2 652 0 1 7
🟡 Shard 3 651 0 8 1
🟡 Shard 4 631 0 3 27
✅ Shard 5 611 0 0 42
🟡 Shard 6 641 0 8 8
🟡 22 flaky test(s) (passed on retry)
  • Pages/Customproperties-part1.spec.ts › no duplicate card after update (shard 1, 1 retry)
  • Pages/UserCreationWithPersona.spec.ts › Create user with persona and verify on profile (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/IncidentManager.spec.ts › Next, Previous and page indicator (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 2 retries)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Flow/PersonaFlow.spec.ts › Set default persona for team should work properly (shard 3, 1 retry)
  • Pages/Customproperties-part2.spec.ts › entityReferenceList shows item count, scrollable list, no expand toggle (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for Database (shard 4, 1 retry)
  • Pages/DescriptionVisibility.spec.ts › Customized Table detail page Description widget shows long description (shard 4, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › verify create lineage for entity - Table (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: searchIndex (shard 6, 1 retry)
  • Pages/ODCSImportExport.spec.ts › Multi-object ODCS contract - object selector shows all schema objects (shard 6, 1 retry)
  • Pages/ServiceListing.spec.ts › should render the service listing page (shard 6, 1 retry)
  • Pages/UserDetails.spec.ts › Create team with domain and verify visibility of inherited domain in user profile after team removal (shard 6, 1 retry)
  • Pages/Users.spec.ts › Permissions for table details page for Data Consumer (shard 6, 1 retry)
  • VersionPages/EntityVersionPages.spec.ts › Directory (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

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

@gitar-bot
Copy link
Copy Markdown

gitar-bot bot commented Apr 19, 2026

Code Review ✅ Approved

Hard delete operations now remove associated pipeline execution history, resolving the orphaned records issue. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

execution history for deleted pipelines still appearing

3 participants