From 3c234603a9c8e443dc3d38989e3e78147757d1da Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rados=C5=82aw=20Piliszek?= <radoslaw.piliszek@gmail.com>
Date: Mon, 13 Apr 2020 17:33:02 +0200
Subject: [PATCH] Fix Designate not to use etcd coordination backend

etcd via tooz does not support group membership required by
Designate coordination.
The best k-a can do is not to configure etcd in Designate.

Change-Id: I2f64f928e730355142ac369d8868cf9f65ca357e
Closes-bug: #1872205
Related-bug: #1840070
---
 ansible/group_vars/all.yml                           |  4 ++--
 ansible/roles/designate/templates/designate.conf.j2  | 10 ++++------
 doc/source/reference/networking/designate-guide.rst  |  9 +++++----
 etc/kolla/globals.yml                                |  4 ++--
 releasenotes/notes/bug-1872205-2eb7e57e0a334fb7.yaml |  7 +++++++
 5 files changed, 20 insertions(+), 14 deletions(-)
 create mode 100644 releasenotes/notes/bug-1872205-2eb7e57e0a334fb7.yaml

diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml
index d31fc2e106..dc73795ab6 100644
--- a/ansible/group_vars/all.yml
+++ b/ansible/group_vars/all.yml
@@ -880,8 +880,8 @@ designate_backend: "bind9"
 designate_ns_record: "sample.openstack.org"
 designate_backend_external: "no"
 designate_backend_external_bind9_nameservers: ""
-# Valid options are [ '', redis, etcd ]
-designate_coordination_backend: "{{ 'redis' if enable_redis|bool else 'etcd' if enable_etcd|bool else '' }}"
+# Valid options are [ '', redis ]
+designate_coordination_backend: "{{ 'redis' if enable_redis|bool else '' }}"
 
 #######################
 # Neutron options
diff --git a/ansible/roles/designate/templates/designate.conf.j2 b/ansible/roles/designate/templates/designate.conf.j2
index a2283029e9..5e6cc08fb5 100644
--- a/ansible/roles/designate/templates/designate.conf.j2
+++ b/ansible/roles/designate/templates/designate.conf.j2
@@ -103,10 +103,8 @@ policy_file = {{ designate_policy_file }}
 [coordination]
 {% if designate_coordination_backend == 'redis' %}
 backend_url = {{ redis_connection_string }}
-{% elif designate_coordination_backend == 'etcd' %}
-# NOTE(yoctozepto): etcd-compatible tooz drivers do not support multiple endpoints here (verified in Stein, Train)
-# NOTE(yoctozepto): we must use etcd3gw (aka etcd3+http) due to issues with alternative (etcd3) and eventlet (as used by designate)
-# see https://bugs.launchpad.net/kolla-ansible/+bug/1854932
-# and https://review.opendev.org/466098 for details
-backend_url = etcd3+http://{{ 'api' | kolla_address(groups['etcd'][0]) | put_address_in_context('url') }}:{{ etcd_client_port }}
 {% endif %}
+{#
+  NOTE(yoctozepto): etcd is not supported due to lack of group membership
+                    support via tooz, see https://launchpad.net/bugs/1872205
+#}
diff --git a/doc/source/reference/networking/designate-guide.rst b/doc/source/reference/networking/designate-guide.rst
index acac51a062..da427d2a20 100644
--- a/doc/source/reference/networking/designate-guide.rst
+++ b/doc/source/reference/networking/designate-guide.rst
@@ -39,10 +39,11 @@ Configure Designate options in ``/etc/kolla/globals.yml``
 
 .. important::
 
-   If multiple nodes are assigned to be Designate workers then you must
-   enable a supported coordination backend, currently either 'redis' or
-   'etcd'. The backend choice can be overridden by the
-   ``designate_coordination_backend`` variable.
+   If multiple nodes are assigned to be Designate workers, then you must
+   enable a supported coordination backend, currently only ``redis``
+   is supported. The backend choice can be overridden via the
+   ``designate_coordination_backend`` variable. It defaults to ``redis``
+   when ``redis`` is enabled (``enable_redis`` is set to ``yes``).
 
 The following additional variables are required depending on which backend you
 intend to use:
diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml
index 55c2b1cb01..b6100a578a 100644
--- a/etc/kolla/globals.yml
+++ b/etc/kolla/globals.yml
@@ -499,8 +499,8 @@
 # Valid options are [ bind9 ]
 #designate_backend: "bind9"
 #designate_ns_record: "sample.openstack.org"
-# Valid options are [ '', redis, etcd ]
-#designate_coordination_backend: "{{ 'redis' if enable_redis|bool else 'etcd' if enable_etcd|bool else '' }}"
+# Valid options are [ '', redis ]
+#designate_coordination_backend: "{{ 'redis' if enable_redis|bool else '' }}"
 
 ########################
 # Nova - Compute Options
diff --git a/releasenotes/notes/bug-1872205-2eb7e57e0a334fb7.yaml b/releasenotes/notes/bug-1872205-2eb7e57e0a334fb7.yaml
new file mode 100644
index 0000000000..11e6874a5f
--- /dev/null
+++ b/releasenotes/notes/bug-1872205-2eb7e57e0a334fb7.yaml
@@ -0,0 +1,7 @@
+---
+fixes:
+  - |
+    Fixes ``designate-worker`` not to use ``etcd`` as its coordination backend
+    because it is not supported by Designate (no group membership support
+    available via tooz).
+    `LP#1872205 <https://launchpad.net/bugs/1872205>`__