Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Refresh Swift ring files without restarting containers
Browse files Browse the repository at this point in the history
Updating rings consists of multiple steps today:
1. Apply puppet in the swift_ringbuilder container
2. Copying files in step 3 using swift_copy_rings
3. Run kolla_set_config to copy files to /etc/swift before starting
   Swift service processes

This needs a container restart today, because kolla_set_config will be
executed only on container (re-)starts.

This patch will execute kolla_set_configs at the step 5 of deployment,
and apply all ring changes, if any, for the Swift processes without
a container restart. Swift processes will notice the changed ring files
within 15 seconds and will use the updated rings.

Co-authored-by: Bogdan Dobrelya <[email protected]>
Change-Id: Ibdd783b484a84c0fdfaac84d892a8ea46be85fde
(cherry picked from commit cb98244)
  • Loading branch information
cschwede authored and bogdando committed Jan 13, 2021
1 parent 65ac38b commit 549cfe2
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
features:
- |
Refresh Swift ring files without restarting containers. This makes it
possible to update rings without service restarts, lowering the overhead
for updates.
10 changes: 10 additions & 0 deletions deployment/swift/swift-proxy-container-puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,16 @@ outputs:
when:
- rsyslog_config is changed
- rsyslog_config.rc == 0
- name: Run kolla_set_configs to copy ring files
when: step|int == 5
shell: "{{ container_cli }} exec -u root {{ item }} /usr/local/bin/kolla_set_configs "
become: true
register: kolla_set_configs_result
failed_when:
- kolla_set_configs_result.rc is defined # do not fail in dry run mode
- kolla_set_configs_result.rc not in [0, 125] # ignore containers that are not running
with_items:
- swift_proxy
update_tasks:
- name: Check swift containers log folder/symlink exists
stat:
Expand Down
22 changes: 22 additions & 0 deletions deployment/swift/swift-storage-container-puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,28 @@ outputs:
when:
- rsyslog_config is changed
- rsyslog_config.rc == 0
- name: Run kolla_set_configs to copy ring files
when: step|int == 5
shell: "{{ container_cli }} exec -u root {{ item }} /usr/local/bin/kolla_set_configs"
become: true
register: kolla_set_configs_result
failed_when:
- kolla_set_configs_result.rc is defined # do not fail in dry run mode
- kolla_set_configs_result.rc not in [0, 125] # ignore containers that are not running
with_items:
- swift_account_auditor
- swift_account_reaper
- swift_account_replicator
- swift_account_server
- swift_container_auditor
- swift_container_replicator
- swift_container_server
- swift_container_updater
- swift_object_auditor
- swift_object_expirer
- swift_object_replicator
- swift_object_server
- swift_object_updater
update_tasks:
- name: Check swift containers log folder/symlink exists
stat:
Expand Down

0 comments on commit 549cfe2

Please sign in to comment.