fix(qdrant): render the stack before flushing its rebuild

svc-ai-mcp-adapter/tasks/rebuild.yml notifies compose-build and compose-up.
00_core.yml then flushed two tasks later, while the stack it was about to act
on had not been rendered yet: qdrant reaches sys-svc-compose only at the end,
through utils/network/routine.yml, not at the start through sys-stk-full.

svc-ai-mcp-adapter/tasks/instance.yml:12-16 already names this hazard in prose
and works around it with five explicit `notify: []` entries, because a
notification raised before the render "fires a compose up against a project
that has no compose.yml yet"; it records that rebuild.yml raises it once both
the context and the compose file exist. The flush in between broke that.

Drop it. The notification now survives to the flush inside
utils/network/routine.yml:13-17, which enters sys-svc-compose with
compose_handlers_flush: true, i.e. after 02_stack_host_prep has rendered and
under qdrant's own application_id.

That alone would move the notification into the window where routine.yml:2-6
pulls in sys-svc-container, whose 00_core.yml:53 is an unconditional
meta: flush_handlers, so a play in which qdrant is the first compose consumer
would drain it before the wrapper exists. The guarded bootstrap ahead of the
notify absorbs that flush against an empty queue, the same shape 252b3e58b2
applies in sys-svc-rdbms.

Only qdrant is affected. The commit that added the sidecars gave ten roles
this shape; the three others that pair rebuild with a flush render first and
are correct: web-svc-libretranslate (sys-stk-full :9, rebuild :13, flush :17),
web-app-prometheus (sys-stk-backend :11, rebuild :56, flush :60) and
web-app-zammad (sys-stk-full :11, rebuild :16, flush :24). qdrant is the only
svc-db role in that set, and svc-db roles load their stack last.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kevinveenbirkenbachandClaude Opus 5 committed 2026-09-04 02:39:11 +02:00
1 parent 847404e5db
commit 7f1025e4a7
1 file changed
+6 -3
+6 -3
View File
@@ -1,6 +1,12 @@
---
- include_tasks: utils/once/flag.yml
- name: "🥾 For '{{ application_id }}': bootstrap the compose host once"
ansible.builtin.include_role:
name: sys-svc-compose
tasks_from: 00_core.yml
when: run_once_sys_svc_compose is not defined
- name: "🔌 Stage the MCP adapter instance for {{ application_id }}"
ansible.builtin.include_tasks: "{{ lookup('path_absolute', 'roles/svc-ai-mcp-adapter/tasks/instance.yml') }}"
vars:
@@ -11,9 +17,6 @@
ansible.builtin.include_tasks: "{{ lookup('path_absolute', 'roles/svc-ai-mcp-adapter/tasks/rebuild.yml') }}"
when: QDRANT_MCP_ENABLED | bool
- name: "🚿 Flush compose handlers for {{ application_id }}"
ansible.builtin.meta: flush_handlers
- name: "🔧 Setup container network for {{ application_id }}"
include_tasks: "{{ lookup('path_absolute', 'roles/sys-svc-compose/tasks/utils/network/routine.yml') }}"
vars: