[Bug 1117483] New: openvswitch: please consider dropping the use of DISABLE_STOP_ON_REMOVAL/DISABLE_RESTART_ON_UPDATE
http://bugzilla.suse.com/show_bug.cgi?id=1117483 Bug ID: 1117483 Summary: openvswitch: please consider dropping the use of DISABLE_STOP_ON_REMOVAL/DISABLE_RESTART_ON_UPDATE Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Network Assignee: bnc-team-screening@forge.provo.novell.com Reporter: fbui@suse.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- Hi Jaime, After a discussion with Markos, it appears that the use of both DISABLE_STOP_ON_REMOVAL=yes and DISABLE_RESTART_ON_UPDATE=yes in openvswitch.spec is not needed at all. Regarding DISABLE_RESTART_ON_UPDATE=yes and according to Markos, OVS services can now be restarted on package updates because "it's being handled by the upper layers from crowbar or whatever else management tool they use". Even if the package would still need to be restarted on updates, %systemd_postun_with_restart() or %systemd_postun() macros should be used instead of the env variable. Regarding DISABLE_STOP_ON_REMOVAL=yes: this was actually an "addon" on the previous issue but it's not needed at all. It would be nice if it could be dropped especially since a) leaving a daemon running while all its files (binaries, libs, config files, etc...) have been deleted may obviously lead to crashes b) one can expect that the network is going down if a package such as openvswitch is removed. Thanks. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1117483
Franck Bui
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c1
Franck Bui
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c2
Markos Chandras
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c3
--- Comment #3 from Jaime Caamaño Ruiz
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c4
--- Comment #4 from Franck Bui
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c5
--- Comment #5 from Swamp Workflow Management
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c7
Jaime Caamaño Ruiz
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c8
Jaime Caamaño Ruiz
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c9
--- Comment #9 from Jaime Caamaño Ruiz
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c10
Franck Bui
I think I need to revisit this one.
On removing DISABLE_STOP_ON_REMOVAL, I agree.
About DISABLE_RESTART_ON_UPDATE:
[...]
I don't see a real use case in avoiding restart. [...]
But I also don't see a compelling reason to change it, [...]
So it seems that you have mixed opinion about DISABLE_RESTART_ON_UPDATE... Let's me add another argument against it: when service restarting is disabled while upgrading the service package, you're in an inconsistent state. The version of the running daemon doesn't match the one stored on disk and any attempt for the daemon to run libraries, conf files might fail or lead to a crash in the worst scenario... Very few packages (maybe none) need this "feature" and if it was really needed we shouldn't encourage this practice and make it part of the macro API. Instead concerned packages should implement their own stuff. So DISABLE_RESTART_ON_UPDATE is a hack IMHO, and there are much better ways to implement the zero downtime mechanism these days.
While I understand using the systemd macros is preferable, I guess there is a reason why service_del_postun exists and is being used.
The only reason for them is to keep backward compatibilities with SysV init. So basically if you're maintaining a package that was providing SysV init scripts which were then later converted in systemd unit files then you should use the SUSE macros otherwise there's no point and the upstream versions should be preferred as it makes your package portable across various distros. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c11
--- Comment #11 from Franck Bui
The use of %service_del_postun macro and the DISABLE_RESTART_ON_UPDATE is documented on the systemd package guidelines [1], so I think it's fine to use them.
I don't think so and I think the wiki should be updated in order to remove the use of DISABLE_RESTART_ON_UPDATE. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c12
--- Comment #12 from Jaime Caamaño Ruiz
when service restarting is disabled while upgrading the service package, you're in an inconsistent state. The version of the running daemon doesn't match the one stored on disk and any attempt for the daemon to run libraries, conf files might fail or lead to a crash in the worst scenario...
I agree. So on one side we have this problem (and we have 'zypper ps' warning to check it). On the other side, if we restart, the information stored on OVS database is lost, which on a second thought, still may affect ovs standalone users since not all of them will be running an upper management tool and from an ovs package perspective we probably should not make such assumptions. So we have good reasons to go either way.
The only reason for them is to keep backward compatibilities with SysV init. So >basically if you're maintaining a package that was providing SysV init scripts which were then later converted in systemd unit files then you should use the SUSE macros otherwise there's no point and the upstream versions should be preferred as it makes your package portable across various distros.
Understood. It looks like that is the case for the SLES11 upgrade path.
Very few packages (maybe none) need this "feature" and if it was really needed we >shouldn't encourage this practice and make it part of the macro API. Instead concerned >packages should implement their own stuff.
I don't understand the problem with the macro API. We could use %service_del_postun -n" instead of DISABLE_RESTART_ON_UPDATE. %systemd_postun would behave in the same way. --- However, where I wanted to get to if this corresponds to a real need or problem that we have in our field systems or labs. If we have no other reasons, then someone can come back later with a different opinion and then we are in a spiral of changing it back and forth. Why don't we accept the status quo that we have now until we have a good reason to go one way or the other. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c13
--- Comment #13 from Franck Bui
So we have good reasons to go either way.
No. We should not try to promote or claim that using DISABLE_RESTART_ON_UPDATE will magically make things work. Again DISABLE_RESTART_ON_UPDATE put services in inconsistent states. The macros are for the common cases, if any package chooses to implement something hackish for their restart then they should implement that in their own. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c14
--- Comment #14 from Jaime Caamaño Ruiz
We should not try to promote or claim that using DISABLE_RESTART_ON_UPDATE will >magically make things work.
I never claimed that. I just tried to explain there are reasons to consider not restarting the service. I take it that you have a strong opinion that leaving the old service running is the worst option.
The macros are for the common cases, if any package chooses to implement >something hackish for their restart then they should implement that in their >own.
There is not need to implement anything hackish. Upstream %systemd_postun macro "as is" does not restart the service. What is the hack exactly? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c15
--- Comment #15 from Franck Bui
I never claimed that. I just tried to explain there are reasons to consider not restarting the service. I take it that you have a strong opinion that leaving the old service running is the worst option.
In *general* I think so.
The macros are for the common cases, if any package chooses to implement >something hackish for their restart then they should implement that in their >own.
There is not need to implement anything hackish. Upstream %systemd_postun macro "as is" does not restart the service. What is the hack exactly?
From my point of view, the hack is the API proposed by SUSE to allow turning
Sorry it seems that I'm not clear neither ;) the restart of services *globally* via a environment variable DISABLE_RESTART_ON_UPDATE. IOW if this variable is set to yes (via /etc/sysconfig/xxx), then *all* packages won't restart on update which really sounds wrong and dangerous. Services might need to prevent restarting on update (although the only "valid" use case I can see is that the service doesn't support restarting yet) but in this case this should be done at the package level not through a global environment variable like it's proposed currently. Giving the illusion to sysadmin that setting globally DISABLE_RESTART_ON_UPDATE=yes will magically work is a bad idea IMHO. But yes a better alternative would be to provide a new macro (similarly to what upstream does) whose name would explicitly tell that restarting is not done. Hope that makes more sense. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c16
--- Comment #16 from Jaime Caamaño Ruiz
But yes a better alternative would be to provide a new macro (similarly to what upstream does) whose name would explicitly tell that restarting is not done.
Agreed. The macro being used, %service_del_postun, reads DISABLE_RESTART_ON_UPDATE both from environment and from /etc/sysconfig/services. %service_del_postun macro accepts parameter -n to same effect. But the result is not very explicit, arguably less than the environment variable :( -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c17
--- Comment #17 from Franck Bui
%service_del_postun macro accepts parameter -n to same effect. But the result is not very explicit, arguably less than the environment variable :(
That's one of the reason why I would prefer introducing something like "%service_del_postun_without_restart" which should be a hint that it's not the default macros in %postun to use and would allow at least get rid of the global environment variable. And IIRC openvswitch was one of the few users, hence this BZ report. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c18
--- Comment #18 from Jaime Caamaño Ruiz
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c19
--- Comment #19 from Franck Bui
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c20
--- Comment #20 from Jaime Caamaño Ruiz
Could you give me the status of openvswitch ?
Does it still use DISABLE_RESTART_ON_UPDATE ? if so why exactly and how a sysadmin is supposed to use it ? by globally disable the restart of all packages ?
We use DISABLE_RESTART_ON_UPDATE=yes on spec %postun section before using the %service_del_postun macro. This is not a global use of DISABLE_RESTART_ON_UPDATE and only affects services handled in openvswitch package. sysadmin is not expected to do anything other than restarting the affected upgraded services at his convenience. The affected services handled in the openvswitch package are: ovsdb-server.service ovs-vswitchd.service openvswitch.service ovn-northd.service ovn-controller.service ovn-controller-vtep.service openvswitch-testcontroller.service For the first three listed services, the purpose of preventing the restart is to avoid inadvertent loss of information that could happen upon restart. This is aligned to the upstream approach. I am unsure about the other services, but probably the use of DISABLE_RESTART_ON_UPDATE could be dropped for those.
Well as maintainer of systemd-rpm-macros and for the reasons given above, we >want to get rid of DISABLE_RESTART_ON_UPDATE.
We can stop using DISABLE_RESTART_ON_UPDATE. We can use '%service_del_postun -n' instead. Is that OK? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c21
--- Comment #21 from Franck Bui
We can stop using DISABLE_RESTART_ON_UPDATE. We can use '%service_del_postun -n' instead. Is that OK?
Yes please do so as a first step even if I believe this option will be useless once we will get rid of the env var completely. I'll introduce a new macro which will be the counterpart of %systemd_postun_with_restart. It would be nice if you could switch to it eventually. BTW couldn't openvswitch use the upstream macros ? do you need to deal with SysV init script migration ? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c22
--- Comment #22 from Jaime Caamaño Ruiz
BTW couldn't openvswitch use the upstream macros ? do you need to deal with SysV init script migration ?
I think we have an upgrade path from SLE11 for which we need to deal with SysV init script migration. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c23
--- Comment #23 from Franck Bui
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c25
--- Comment #25 from Franck Bui
We can stop using DISABLE_RESTART_ON_UPDATE. We can use '%service_del_postun -n' instead. Is that OK?
FYI, I submitted a new macro "%service_del_postun_without_restart" which has the same effect. It should reach Factory (only) during the next week. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c26
--- Comment #26 from Franck Bui
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c27
--- Comment #27 from Jaime Caamaño Ruiz
Jaime, do you plan to push the changes to Factory as well soon ? (after all this bug was opened against this distro)
Yes, I will submit to Factory as well. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c29
Jaime Caamaño Ruiz
http://bugzilla.suse.com/show_bug.cgi?id=1117483
http://bugzilla.suse.com/show_bug.cgi?id=1117483#c30
--- Comment #30 from Franck Bui
https://bugzilla.suse.com/show_bug.cgi?id=1117483
https://bugzilla.suse.com/show_bug.cgi?id=1117483#c31
Franck Bui
- DISABLE_RESTART_ON_UPDATE was replaced with '%service_del_postun -n' and will be replaced with %service_del_postun_without_restart in next package update.
Could you do so as %service_del_postun_without_restart has been introduced in Factory, SLE12-SP2+, SLE15+ ? Thanks. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1117483
https://bugzilla.suse.com/show_bug.cgi?id=1117483#c39
jun wang
https://bugzilla.suse.com/show_bug.cgi?id=1117483
https://bugzilla.suse.com/show_bug.cgi?id=1117483#c40
--- Comment #40 from Swamp Workflow Management
https://bugzilla.suse.com/show_bug.cgi?id=1117483
https://bugzilla.suse.com/show_bug.cgi?id=1117483#c41
--- Comment #41 from Jaime Caama�o Ruiz
I am testing openvswitch update SUSE:Maintenance:17066:234825, it seems that one of "%service_del_postun" was not replaced by "%service_del_postun_without_restart": https://build.suse.de/package/view_file/SUSE:Maintenance:17066/openvswitch. SUSE_SLE-12-SP2_Update/openvswitch.spec?rev=4 (line 426).
is this expected on SLES12SP2 ?
I guess we are replacing "%service_del_postun -n" not "%service_del_postun". Does it make sense? -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1117483
https://bugzilla.suse.com/show_bug.cgi?id=1117483#c42
--- Comment #42 from Swamp Workflow Management
https://bugzilla.suse.com/show_bug.cgi?id=1117483
https://bugzilla.suse.com/show_bug.cgi?id=1117483#c43
--- Comment #43 from jun wang
(In reply to jun wang from comment #39) I guess we are replacing "%service_del_postun -n" not "%service_del_postun". Does it make sense?
I checked the changelog, yes, we replaced "%service_del_postun -n". Thank you. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1117483
https://bugzilla.suse.com/show_bug.cgi?id=1117483#c44
--- Comment #44 from Swamp Workflow Management
https://bugzilla.suse.com/show_bug.cgi?id=1117483
https://bugzilla.suse.com/show_bug.cgi?id=1117483#c45
--- Comment #45 from Swamp Workflow Management
https://bugzilla.suse.com/show_bug.cgi?id=1117483
https://bugzilla.suse.com/show_bug.cgi?id=1117483#c46
--- Comment #46 from Swamp Workflow Management
https://bugzilla.suse.com/show_bug.cgi?id=1117483
https://bugzilla.suse.com/show_bug.cgi?id=1117483#c47
--- Comment #47 from Swamp Workflow Management
participants (2)
-
bugzilla_noreply@novell.com
-
bugzilla_noreply@suse.com