]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
iscsi: Fix crashes during rolling update
authorMike Christie <mchristi@redhat.com>
Tue, 28 Jan 2020 22:31:55 +0000 (16:31 -0600)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 3 Feb 2020 14:15:15 +0000 (15:15 +0100)
During a rolling update we will run the ceph iscsigw tasks that start
the daemons then run the configure_iscsi.yml tasks which can create
iscsi objects like targets, disks, clients, etc. The problem is that
once the daemons are started they will accept confifguration requests,
or may want to update the system themself. Those operations can then
conflict with the configure_iscsi.yml tasks that setup objects and we
can end up in crashes due to the kernel being in a unsupported state.

This could also happen during creation, but is less likely due to no
objects being setup yet, so there are no watchers or users accessing the
gws yet. The fix in this patch works for both update and initial setup.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1795806

Signed-off-by: Mike Christie <mchristi@redhat.com>
(cherry picked from commit 77f3b5d51b84a6338847c5f6a93f22a3a6a683d2)

roles/ceph-iscsi-gw/tasks/main.yml
roles/ceph-iscsi-gw/tasks/non-container/postrequisites.yml [new file with mode: 0644]
roles/ceph-iscsi-gw/tasks/non-container/prerequisites.yml

index 05732a0dacd56149ef3e46612e98a3166d5da263..0366ce294c3816169d6c0f7f2c8ae3e761702b03 100644 (file)
     - not containerized_deployment | bool
     - not use_new_ceph_iscsi | bool
 
+- name: include non-container/postrequisites.yml
+  include_tasks: non-container/postrequisites.yml
+  when: not containerized_deployment | bool
+
 - name: include containerized.yml
   include_tasks: containerized.yml
   when: containerized_deployment | bool
diff --git a/roles/ceph-iscsi-gw/tasks/non-container/postrequisites.yml b/roles/ceph-iscsi-gw/tasks/non-container/postrequisites.yml
new file mode 100644 (file)
index 0000000..786cf8c
--- /dev/null
@@ -0,0 +1,9 @@
+- name: start rbd-target-api and rbd-target-gw
+  service:
+    name: "{{ item }}"
+    state: started
+    enabled: yes
+    masked: no
+  with_items:
+    - rbd-target-api
+    - rbd-target-gw
index c1a287069c0cf6cf4d21eeab16cf3b6502f614aa..4267c9d9c2f3d5102c1d992fc45f59a6eb58baf9 100644 (file)
     - target.stat.exists
     - not target.stat.islnk
 
-- name: start tcmu-runner, rbd-target-api and rbd-target-gw
+# Only start tcmu-runner, so configure_iscsi.yml can create disks.
+# We must start rbd-target-gw/api after configure_iscsi.yml to avoid
+# races where they are both trying to setup the same object during
+# a rolling update.
+- name: start tcmu-runner
   service:
-    name: "{{ item }}"
+    name: tcmu-runner
     state: started
     enabled: yes
     masked: no
-  with_items:
-    - tcmu-runner
-    - rbd-target-gw
-    - rbd-target-api