Memcached¶
This page is the starting point for memcached, the memcached role: one container, memcached, on the control nodes of
the example inventory (inventory/multinode:116-117), selected by the tags memcached and memcache
(site.yml:417-429). As in 2024.1, no role has a common dependency: common is its own play, tagged common only
(site.yml:88-103), and no role under ansible/roles/ has a meta/ directory, so memcached is not an exception
(Tags §1, row "Role-level tags") CODE. Changed in 2025.1 CODE: the config task notifies no handler any more and the container check is the shared
service-check-containers role (below); the image name takes docker_image_name_prefix
(roles/memcached/defaults/main.yml:27); check.yml runs the service-check role of kolla-ansible check
(roles/memcached/tasks/check.yml:2-4). The lists below say where the study covers how
to operate it, its impact, its dependencies and the evidence, what to check around a run and what stays open; the
service card follows them.
Where to look¶
Operate¶
- Scenario: Change control-plane membership §2, Reconfigure Neutron §3
- Command: Change control-plane membership §1.1
Impact and risk¶
- What the tag executes (
memcached/memcache): Tags §3 and Tags §3.1, rowsmemcached/memcache - Sequence CODE:
deployandreconfigurerunconfig.yml(config directory andconfig.json) thencheck-containers.yml, with no flush, so the restart handler runs at the end of the play (roles/memcached/tasks/deploy.yml:2-4,reconfigure.yml:2);upgraderuns the same two files (roles/memcached/tasks/upgrade.yml:2-4). Changed in 2025.1: theconfig.jsontask notifies nothing (roles/memcached/tasks/config.yml:13-23);check-containers.ymlimportsservice-check-containers(roles/memcached/tasks/check-containers.yml:2-3), which notifiesRestart memcached containeronly whencompare_containerreports the container changed. The handler has nokolla_action != "config"guard any more (roles/memcached/handlers/main.yml:2-13). - Risks: R4
Dependencies¶
- Dependencies: Component dependencies §1, Component dependencies §2
- Who reads the membership CODE: the templates or defaults of 27 roles loop over
groups['memcached'](28 in 2024.1; the swift role is gone). Example:memcached_serversinneutron.conf(roles/neutron/templates/neutron.conf.j2:121), which is rendered for the Open vSwitch agent too (roles/neutron/tasks/config.yml:73-103).
Evidence¶
- Fact sheet: fact sheet A §3
- Image side: Kolla images §5 (row
memcached). The kolladocker/memcacheddirectory is identical to 2024.1's apart from akolla_patch_sources()macro call: amemcacheduser, thememcachedpackage, no start script (kolladocker/memcached/Dockerfile.j2:10-20) CODE.
Before and after a run¶
- Tags §3.1, row
memcached/memcache: safe on its own "yes, off-peak"; prerequisites: none. - R4, precautions for a change of memcached membership: plan as a dataplane change, like
R3/R5: batch with
--limitordeploy -e kolla_serial=N(reconfigureforceskolla_serial=0, F19), network nodes one at a time; low-traffic window. - Settings in the command, now seen by the check CODE. Every memcached setting is in the
commandof itsconfig.json, and itsconfig_fileslist is empty: listen addressapi_interface_address,memcached_port,memcached_connection_limitandmemcached_max_memory(roles/memcached/templates/memcached.json.j2:1-4; defaultsroles/memcached/defaults/main.yml:54-57,group_vars/all.yml:575). In 2024.1kolla_set_configs --checksaw none of them. Changed in 2025.1: it compares thecommandofconfig.jsonwith the command saved in/run_commandwhen the container started (kolladocker/base/set_configs.py:580-586, F14, Kolla images §3.1). What follows for a change of one of these settings:- A normal
deploy/reconfigurewrites the newconfig.json; the check step finds the command different and notifiesRestart memcached container. The restart runskolla_set_configsagain, which writes the newcommandto/run_command, andkolla_startexecutes it (Kolla images §2.2). - Changed in 2025.1: after a separate
genconfig(kolla_action=config), the nextdeploy-containers,deployorreconfiguredetects the change the same way and restarts the container. In 2024.1 the change applied only at the next restart for another reason (Kolla images §6, item 1; Predict and inspect a run, row "See what will restart"). - The other compared items: the image, the volumes, the dimensions and the healthcheck, which are container
parameters compared by
compare_container(roles/service-check-containers/tasks/main.yml:4-29,module_utils/kolla_container_worker.py:58-89), plus the systemd unit text. The healthcheck ishealthcheck_listen memcached <memcached_port>(roles/memcached/defaults/main.yml:36-43), so a port change also changes a compared parameter.
- A normal
- First 2025.1 check of a container that 2024.1 created CODE: the systemd unit text changed again
(F16), so a memcached container that no 2025.1 run has recreated or restarted yet is
restarted at its first 2025.1
deploy/reconfigure(recreated with Docker on Debian or Ubuntu, for the new defaultnofileulimit), on all memcached hosts at once (the play'sserial, below).
Known limits and open points¶
- Known bugs and limitations, row
kolla images, and F14: narrower in 2025.1, the command is now compared, so memcached's settings are detected; only apermissions-only change ofconfig.jsonis still missed CODE. - F6, "Global inputs are rendered into per-host files":
enable_*flags, RabbitMQ/memcached membership, service passwords and the external FQDN end up in compute-side files CODE. - What is not known, row "memcached": the sources do not establish whether cached tokens are lost when the membership changes or the container restarts, and the effect on auth latency and Horizon sessions.
- fact sheet A §3.8, "Operationally notable", four
items. Checked against 2025.1 CODE: all memcached instances restart at once (the play's
serialiskolla_serial, default0,site.yml:422; the play's newmax_fail_percentagedefaults to 100,site.yml:423-426, and so never stops it early); adding or removing a memcached host is expensive (27 roles loop overgroups['memcached']in their templates or defaults, R4); tag aliases differ: only-t memcachedselects the memcached include of the loadbalancer play (site.yml:233-237), and that include renders a frontend only withenable_haproxy_memcached(defaultno,group_vars/all.yml:850,roles/memcached/defaults/main.yml:11-13), so with defaults the two tags differ in nothing visible; "memcached has nocommondependency" is not specific to memcached (no role has one, see above). - Kolla images §6, item 14: memcached has no data volume and no
persistence option (
roles/memcached/defaults/main.yml:45-48,roles/memcached/templates/memcached.json.j2:2) CODE; whether every restart therefore empties the cache is NOT AVAILABLE (memcached semantics).
Service card¶
The rows of the card are explained in How to read a service card.
| Item | Value |
|---|---|
| Play | site.yml:417 |
| Tags | memcache, memcached |
| Play host patterns | memcached |
| Node types in play (example inventory) | control |
| Node types running its containers | control |
| Containers | memcached |
deploy/reconfigure flow (tasks/) |
config → check-containers |
| Task files | check-containers.yml, check.yml, config.yml, config_validate.yml, deploy-containers.yml, deploy.yml, loadbalancer.yml, main.yml, precheck.yml, pull.yml, reconfigure.yml, stop.yml, upgrade.yml |
| Templates | memcached.json.j2 |
| Handlers (definition order) | Restart memcached container |
| Key variables | enable_memcached, memcached_port |
| Role dependencies | none |
Related¶
- Change control-plane membership — a
memcached-only change does not touch nova-compute but still restarts the neutron agents on computes - Component dependencies §1 — the templates
of 27 roles loop over
groups['memcached'](R4) - Keystone — memcached is its token cache
- Horizon — it keeps its sessions in memcached when
horizon_backend_databaseis false (the default,group_vars/all.yml:1267) and thememcachedgroup is not empty (roles/horizon/templates/_9998-kolla-settings.py.j2:19-22) - Predict and inspect a run —
kolla_set_configs --checkand its exit codes - Components — the other component pages