-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fixes #27040: Guard postDelete() with hardDelete check in IngestionPipeline, DataContract, App #27043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fixes #27040: Guard postDelete() with hardDelete check in IngestionPipeline, DataContract, App #27043
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -240,13 +240,15 @@ protected void postUpdate(DataContract original, DataContract updated) { | |
| @Override | ||
| protected void postDelete(DataContract dataContract, boolean hardDelete) { | ||
| super.postDelete(dataContract, hardDelete); | ||
| if (!nullOrEmpty(dataContract.getQualityExpectations())) { | ||
| deleteTestSuite(dataContract); | ||
| if (hardDelete) { | ||
| if (!nullOrEmpty(dataContract.getQualityExpectations())) { | ||
| deleteTestSuite(dataContract); | ||
| } | ||
| // Clean status | ||
| daoCollection | ||
| .entityExtensionTimeSeriesDao() | ||
| .delete(dataContract.getFullyQualifiedName(), RESULT_EXTENSION); | ||
| } | ||
|
Comment on lines
241
to
251
|
||
| // Clean status | ||
| daoCollection | ||
| .entityExtensionTimeSeriesDao() | ||
| .delete(dataContract.getFullyQualifiedName(), RESULT_EXTENSION); | ||
| } | ||
|
|
||
| private void postCreateOrUpdate(DataContract dataContract) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -474,18 +474,20 @@ public EntityRepository<IngestionPipeline>.EntityUpdater getUpdater( | |
| @Override | ||
| protected void postDelete(IngestionPipeline entity, boolean hardDelete) { | ||
| super.postDelete(entity, hardDelete); | ||
| // Delete deployed pipeline in the Pipeline Service Client | ||
| if (pipelineServiceClient != null) { | ||
| pipelineServiceClient.deletePipeline(entity); | ||
| } else { | ||
| LOG.debug( | ||
| "Skipping pipeline service delete for '{}' because pipeline service client is not configured.", | ||
| entity.getFullyQualifiedName()); | ||
| if (hardDelete) { | ||
| // Delete deployed pipeline in the Pipeline Service Client | ||
| if (pipelineServiceClient != null) { | ||
| pipelineServiceClient.deletePipeline(entity); | ||
| } else { | ||
| LOG.debug( | ||
| "Skipping pipeline service delete for '{}' because pipeline service client is not configured.", | ||
| entity.getFullyQualifiedName()); | ||
| } | ||
| // Clean pipeline status | ||
| daoCollection | ||
| .entityExtensionTimeSeriesDao() | ||
| .delete(entity.getFullyQualifiedName(), PIPELINE_STATUS_EXTENSION); | ||
| } | ||
|
Comment on lines
475
to
490
|
||
| // Clean pipeline status | ||
| daoCollection | ||
| .entityExtensionTimeSeriesDao() | ||
| .delete(entity.getFullyQualifiedName(), PIPELINE_STATUS_EXTENSION); | ||
| } | ||
|
|
||
| @Override | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a test to ensure that on soft delete (hardDelete=false) the app run STATUS time series is preserved (so restore brings back run history), while hard delete still cleans it up. This guards the regression this PR is addressing.