Skip to content

Commit d3e6e17

Browse files
Merge pull request #1362 from cschwede/fix-cix-1318
Fix possible race condition in swift_migration check
2 parents e76e3a2 + ff4218f commit d3e6e17

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

docs_user/modules/proc_migrating-object-storage-data-to-rhoso-nodes.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ ssh commands for your existing nodes that store the {object_storage} data:
9898
$ oc extract --confirm cm/swift-ring-files
9999
$ $CONTROLLER1_SSH "tar -C /var/lib/config-data/puppet-generated/swift/etc/swift/ -xzf -" < swiftrings.tar.gz
100100
$ $CONTROLLER1_SSH "systemctl restart tripleo_swift_*"
101+
$ $CONTROLLER2_SSH "tar -C /var/lib/config-data/puppet-generated/swift/etc/swift/ -xzf -" < swiftrings.tar.gz
102+
$ $CONTROLLER2_SSH "systemctl restart tripleo_swift_*"
103+
$ $CONTROLLER3_SSH "tar -C /var/lib/config-data/puppet-generated/swift/etc/swift/ -xzf -" < swiftrings.tar.gz
104+
$ $CONTROLLER3_SSH "systemctl restart tripleo_swift_*"
101105
----
102106

103107
. Track the replication progress by using the `swift-dispersion-report` tool:

tests/roles/swift_migration/tasks/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
ansible.builtin.shell: |
5858
{{ shell_header }}
5959
CONTROLLER1_SSH="{{ controller1_ssh }}"
60-
$CONTROLLER1_SSH "timeout 900s bash -c 'while \$(find /srv/node/ -type f -name \"*.db\" -o -name \"*.data\" | grep -q \".\"); do sleep 5; done'"
60+
$CONTROLLER1_SSH "timeout 900s bash -c 'while \$(find /srv/node/ -ignore_readdir_race -type f -name \"*.db\" -o -name \"*.data\" | grep -q \".\"); do sleep 5; done'"
6161
6262
- name: remove standalone node from rings
6363
ansible.builtin.shell: |

tests/roles/swift_migration/tasks/rebalance_and_wait.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,23 @@
66
swift-ring-tool forced_rebalance
77
swift-ring-tool push'
88
9-
- name: push rings to standalone and restart swift services
9+
- name: push rings to controller nodes and restart swift services
1010
ansible.builtin.shell: |
1111
{{ shell_header }}
1212
{{ oc_header }}
1313
CONTROLLER1_SSH="{{ controller1_ssh }}"
14+
CONTROLLER2_SSH="{{ controller2_ssh }}"
15+
CONTROLLER3_SSH="{{ controller3_ssh }}"
16+
1417
oc extract --confirm cm/swift-ring-files
15-
$CONTROLLER1_SSH "tar -C /var/lib/config-data/puppet-generated/swift/etc/swift/ -xzf -" < swiftrings.tar.gz
16-
$CONTROLLER1_SSH "systemctl restart tripleo_swift_*"
18+
19+
for i in {1..3}; do
20+
SSH_CMD="CONTROLLER${i}_SSH"
21+
if [ ! -z "${!SSH_CMD}" ]; then
22+
${!SSH_CMD} "tar -C /var/lib/config-data/puppet-generated/swift/etc/swift/ -xzf -" < swiftrings.tar.gz
23+
${!SSH_CMD} "systemctl restart tripleo_swift_*"
24+
fi
25+
done
1726
1827
- name: wait until all replicas are 100% available after rebalance
1928
ansible.builtin.shell: |

0 commit comments

Comments
 (0)