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

Update/Reload without downtime #713

Draft
wants to merge 30 commits into
base: master
Choose a base branch
from
Draft

Update/Reload without downtime #713

wants to merge 30 commits into from

Conversation

daipom
Copy link
Contributor

@daipom daipom commented Nov 5, 2024

Enhancements on the package side to support the following:

kenhys and others added 21 commits November 5, 2024 13:30
deb:
 * preinst: detect locally installed plugins
   * collect plugin information via fluent-diagtool
 * postinst: install locally installed plugins
   * if network access is denied, giving up install plugins

rpm:
 * %pre $1 == 2 (upgrade): detect locally installed plugins
   * collect plugin information via fluent-diagtool
 * %post $1 == 2 (upgrade): install locally installed plugins
   * if network access is denied, giving up install plugins
Signed-off-by: Kentaro Hayashi <[email protected]>
auto: Automatically restart service without downtime.
      service restart will be fired during %preun (upgrade).

manual: Manually restart service by user. If user select manual,
      suppress auto-restart with automatically generated service hook
      %post and %systemd_postun_with_restart.
      when downgrading from v6, use manual and uninstall v6 then
      reinstall v5.

Signed-off-by: Kentaro Hayashi <[email protected]>
Accidentally debug print in preinst was pushed in 26785ce.

Signed-off-by: Kentaro Hayashi <[email protected]>
When upgrading package, the following hook is executed:
plugins should be installed before restarting service.

Before:

* old prerm
* new preinst collect plugin information
* old postrm auto restart
* new postinst install plugins

After:

* old prerm collect plugin information
* new preinst
* old postrm
* new postinst install plugins and auto restart

Signed-off-by: Kentaro Hayashi <[email protected]>
fluentd_auto_restart will be launched during
"configure" phase, so there is no need to check that action.

This is occurred by migrating restart logic from postrm to postinst.

Signed-off-by: Kentaro Hayashi <[email protected]>
It is useful to investigate maintainer scripts.

Signed-off-by: Kentaro Hayashi <[email protected]>
Added if guard to check whether specified hook script exist or not.

Signed-off-by: Kentaro Hayashi <[email protected]>
Signed-off-by: Shizuo Fujita <[email protected]>
lxc launch will fail (/var/snap/lxd/common/lxd/unix.socket: connect:
permission denied) in some cases, but not sure why yet.

To investigate further more, try to collect snap information when
workflow was failed.

Signed-off-by: Kentaro Hayashi <[email protected]>
To verify major upgrade in workflow, it needs
more package build time.

Signed-off-by: Kentaro Hayashi <[email protected]>
Use this to test this feature.

* fluent/fluentd#4624

Signed-off-by: Daijiro Fukuda <[email protected]>
This PR adds testing to ensure that package upgrades succeed without
data loss.
At present, the following plugins will be checked:

- in_tcp
- in_udp
- in_syslog

Signed-off-by: Shizuo Fujita <[email protected]>
* enable debug by default
* support any package and architecture
* untabify

Signed-off-by: Kentaro Hayashi <[email protected]>
Before:

* missing fluent-plugin was installed

After:

* missing fluent-plugin was installed
* missing dependency gem was also installed

NOTE:

* if missing gem requires development packages to build it, it will
fail.
* fluent-diagtool depends on highly systemd service, so it is simple
just to use fluent-gem detecting missing gems.

---------

Signed-off-by: Kentaro Hayashi <[email protected]>
add test to update with auto / manual feature.

Signed-off-by: Shizuo Fujita <[email protected]>
@daipom daipom added the enhancement New feature or request label Nov 5, 2024
Watson1978 and others added 8 commits November 6, 2024 14:36
Remove environment variables that prevent the Update/Reload without
downtime feature. This is because an upgrade with a Ruby version update
will not work correctly due to environment variables for the old Ruby.

Signed-off-by: Shizuo Fujita <[email protected]>
Since Ubuntu 24.04, needrestart package kicks service
restart out of package maintainer scripts.
Take back fluentd service under control for us,
it had better to suppress it.

NOTE: It seems that needrestart package is available from
EPEL 8/9, but it is broken for a long time, so just ignore it.

Needrestart package missing dependency
https://bugzilla.redhat.com/show_bug.cgi?id=2154293

Signed-off-by: Kentaro Hayashi <[email protected]>
Even though needrestart package was installed, service will not be
restarted out of the maintainer script (hook).

Signed-off-by: Kentaro Hayashi <[email protected]>
This should fix following error when build Windows package on
`feature-nodowntime` branch.

```
Downloading fluentd-1.17.1 revealed dependencies not in the API or the lockfile 
(logger (~> 1.6)).
Either installing with `--full-index` or running `bundle update fluentd` should 
fix the problem.

rake aborted! 

Command failed with status (34): [C:/opt/fluent/bin/bundle _2.3.27_ install ...]
C:/fluent-package-5.1.0/fluent-package/Rakefile:462:in `block (2 levels) in defi
ne'
Tasks: TOP => msi:selfbuild => build:all => build:licenses => build:gems => buil
d:ruby_gems
(See full trace by running task with --trace)
rake aborted!
```

Signed-off-by: Shizuo Fujita <[email protected]>
Update the test to ensure :

* There is no issue even if an upgrade is performed that includes a Ruby
major version update.
* There is no data loss even if data is sent until the main process is
replaced.

---------

Signed-off-by: Shizuo Fujita <[email protected]>
Signed-off-by: Shizuo Fujita <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants