Skip to content

Commit

Permalink
deb rpm: remove manual feature of zero-downtime-restart from uninstal…
Browse files Browse the repository at this point in the history
…l phase (fluent#758)

We were going to support two methods of downgrading with zero downtime.

1. Running v6.x => Install v5.x package by overwriting
2. Running v6.x => Replace `FLUENT_PACKAGE_SERVICE_RESTART` value to
`manual` => uninstall v6.x => Install v5.x

The second method is to keep the Fluentd process running after
uninstalling it.
We decided to remove `2.` method because it may cause confusion for
users.

Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
  • Loading branch information
Watson1978 authored Dec 9, 2024
1 parent e381cb5 commit 685ba07
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,6 @@ esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

. /etc/default/<%= service_name %>
if [ "$FLUENT_PACKAGE_SERVICE_RESTART" = "manual" ]; then
# Do not stop service because removing package will be executed
# for major downgrade (e.g. uninstall v6 then reinstall v5)
# In such a case, missing plugins for v5 cause trouble in
# restarting service.
# so instead of restarting service here, demand users to install
# such plugins in advance then delegate users to restart service
# manually later.
:
else
#DEBHELPER#
fi
#DEBHELPER#

exit 0
13 changes: 1 addition & 12 deletions fluent-package/yum/fluent-package.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -197,18 +197,7 @@ if [ $1 -eq 2 ]; then
fi

%preun
. %{_sysconfdir}/sysconfig/@SERVICE_NAME@
echo "preun FLUENT_PACKAGE_SERVICE_RESTART: $FLUENT_PACKAGE_SERVICE_RESTART"
if [ $1 -eq 0 ]; then
if [ "$FLUENT_PACKAGE_SERVICE_RESTART" = "manual" ]; then
# When rollback to previous version, there is a case that user want to
# restart manually to reduce downtime.
:
else
# disable service here
%systemd_preun @SERVICE_NAME@.service
fi
fi
%systemd_preun @SERVICE_NAME@.service

%post
. %{_sysconfdir}/sysconfig/@SERVICE_NAME@
Expand Down

0 comments on commit 685ba07

Please sign in to comment.