Skip to content
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

Restore services of service set on restoring service set. #2420

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

raviks789
Copy link
Collaborator

@raviks789 raviks789 commented Oct 28, 2021

All the services which were under the service set when it was deleted must be restored when it is restored from activity log.

dependent on PR: #2418

fix #1065

@lippserd
Copy link
Member

ref/IP/35863

@Thomas-Gelf
Copy link
Contributor

Hi @raviks789,

thank you for this PR! Main problems:

  • it doesn't work with PostgreSQL (can be fixed)
  • it's a wild hack (per design, that's not your fault - it's a tricky task)

You correctly figured out, that related Service activities must have their Activity (Removal) Log somehow being triggered. I'd have had preferred a direct call to DirectorActivityLog::logRemoval() for each service - depending on a specific onDelete-Implementation is fragile.

But please let me propose a different implementation. The main issue here is how deletion takes place. A user issues a single operation ("Delete a Service Set"), but behind the scenes, multiple operations take place. For a better end user experience, this should be "one step" throughout the UI. Read: there should be only one entry in the Activity Log.

This sounds tricky, but the good news is: most of the related work has already been done. IcingaServiceSet implements the ExportInterface, and therefore has import/export-Methods. They're being used by our Configuration Baskets, and have one big advantage: no fiddling with IDs on restore. It is up to you to figure out, how this then fits into our current Show-Config-Diff-Implementation ;-)

Could you please give that approach a try? Only if you find the time of course, otherwise please let me know. I'm allowed to dedicate some time to similar tasks this week.

Thanks a lot,
Thomas

Copy link
Contributor

@Thomas-Gelf Thomas-Gelf left a comment

Choose a reason for hiding this comment

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

.

@raviks789 raviks789 force-pushed the fix/serviceset-services-restore branch from 6f5c617 to 47cf140 Compare March 10, 2022 15:24
@raviks789 raviks789 force-pushed the fix/serviceset-services-restore branch 3 times, most recently from 4c8d82a to 7774455 Compare March 10, 2022 15:40
@raviks789 raviks789 force-pushed the fix/serviceset-services-restore branch from 7774455 to 19dea6b Compare March 22, 2022 17:08
@tbauriedel
Copy link
Member

ref/NC/732413

@raviks789 raviks789 force-pushed the fix/serviceset-services-restore branch 2 times, most recently from 8bc15dc to 278f855 Compare February 2, 2024 12:00
@raviks789 raviks789 requested review from nilmerg and removed request for Thomas-Gelf February 2, 2024 12:04
Copy link
Member

@nilmerg nilmerg left a comment

Choose a reason for hiding this comment

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

The export/import logic wasn't removed, only moved. (56f81b9) Isn't it still applicable here?

@raviks789 raviks789 force-pushed the fix/serviceset-services-restore branch from 376434d to 278f855 Compare February 7, 2024 10:30
@raviks789 raviks789 force-pushed the fix/serviceset-services-restore branch from 278f855 to e990694 Compare February 7, 2024 12:07
All the services which were under the service set when it was deleted must be restored when it is restored from activity log.
@raviks789 raviks789 force-pushed the fix/serviceset-services-restore branch from e990694 to 485474f Compare February 7, 2024 12:09
@nilmerg nilmerg added this to the v1.11.1 milestone Feb 7, 2024
@nilmerg nilmerg merged commit e48ddd2 into master Feb 7, 2024
15 checks passed
@nilmerg nilmerg deleted the fix/serviceset-services-restore branch February 7, 2024 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Service Sets aren't fully restored if one is accidentally deleted.
5 participants