Skip to content

Commit ff4218f

Browse files
committed
Fix swift migration ring push and race condition in data check
Updated rings were only pushed to the first controller node, resulting in a data movement loop: controller 1 pushed data to OpenShift and removed it locally, while controller 2 and 3 were detecting missing data on controller 1 (because they were still using old rings) and replicating back to controller 1. Update both the docs and the test role to distribute rings to all three controller nodes and restart Swift services on each. Also add the -ignore_readdir_race option to the find command that checks for remaining .data/.db files on the standalone node. The replicator may remove empty directories while find is iterating, causing spurious errors. JIRA: OSPCIX-1318 Signed-off-by: Christian Schwede <cschwede@redhat.com>
1 parent 624a414 commit ff4218f

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)