From 3245201af1d5a2895f1baa1be90171f44823fbd1 Mon Sep 17 00:00:00 2001
From: James McCarthy <james.m.mccarthy@oracle.com>
Date: Fri, 24 Nov 2017 14:28:30 +0000
Subject: [PATCH] Update swift for replication issues

There are corresponding image changes to go with these ansible
changes - changes in rsyncd template, and add
environment settings for RSYNC_CONNECT_PROG (i.e. nc)

nc allows for rsync replication to easily target {{ swift_rsync_port }}

update the lock file and chroot settings in template - see bug
for more details.

Change-Id: Ic81b7de8fad8aec9416e4e27e8ffda6d03be293c
Closes-Bug: #1733851
---
 ansible/roles/swift/tasks/start.yml          | 2 ++
 ansible/roles/swift/templates/rsyncd.conf.j2 | 9 ++++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/ansible/roles/swift/tasks/start.yml b/ansible/roles/swift/tasks/start.yml
index b714bf6f4d..af7ccc0960 100644
--- a/ansible/roles/swift/tasks/start.yml
+++ b/ansible/roles/swift/tasks/start.yml
@@ -179,6 +179,8 @@
   kolla_docker:
     action: "start_container"
     common_options: "{{ docker_common_options }}"
+    environment:
+      RSYNC_CONNECT_PROG: "nc %H {{ swift_rsync_port }}"
     image: "{{ swift_object_image_full }}"
     name: "swift_object_replicator"
     volumes:
diff --git a/ansible/roles/swift/templates/rsyncd.conf.j2 b/ansible/roles/swift/templates/rsyncd.conf.j2
index 82576ff109..d7125981f8 100644
--- a/ansible/roles/swift/templates/rsyncd.conf.j2
+++ b/ansible/roles/swift/templates/rsyncd.conf.j2
@@ -7,7 +7,8 @@ address = {{ api_interface_address }}
 max connections = 2
 path = {{ swift_devices_mount_point }}
 read only = false
-lock file = /var/lock/account.lock
+use chroot = no
+lock file = /var/lib/swift/lock/account.lock
 {% endif %}
 
 {% if inventory_hostname in groups['swift-container-server'] %}
@@ -15,7 +16,8 @@ lock file = /var/lock/account.lock
 max connections = 4
 path = {{ swift_devices_mount_point }}
 read only = false
-lock file = /var/lock/container.lock
+use chroot = no
+lock file = /var/lib/swift/lock/container.lock
 {% endif %}
 
 {% if inventory_hostname in groups['swift-object-server'] %}
@@ -23,5 +25,6 @@ lock file = /var/lock/container.lock
 max connections = 8
 path = {{ swift_devices_mount_point }}
 read only = false
-lock file = /var/lock/object.lock
+use chroot = no
+lock file = /var/lib/swift/lock/object.lock
 {% endif %}
-- 
GitLab