commit aeb95779c7bea4117ccb69b17eab31d452397964
Author: Morgan Fainberg <email address hidden>
Date: Fri Mar 22 12:35:16 2019 -0700
Pass `flush_on_reconnect` to memcache pooled backend
If a memcache server disappears and then reconnects when multiple memcache
servers are used (specific to the python-memcached based backends) it is
possible that the server will contain stale data. The default is now to
supply the ``flush_on_reconnect`` optional argument to the backend. This
means that when the service connects to a memcache server, it will flush
all cached data in the server. The pooled backend is more likely to
run into issues with this as it does not explicitly use a thread.local
for the client. The non-pooled backend was not touched, it is not
the recommended production use-case.
See the help from python-memcached:
@param flush_on_reconnect: optional flag which prevents a
scenario that can cause stale data to be read: If there's more
than one memcached server and the connection to one is
interrupted, keys that mapped to that server will get
reassigned to another. If the first server comes back, those
keys will map to it again. If it still has its data, get()s
can read stale data that was overwritten on another
server. This flag is off by default for backwards
compatibility.
Change-Id: I3e335261f749ad065e8abe972f4ac476d334e6b3
closes-bug: #1819957
(cherry picked from commit 1192f185a5fd2fa6177655f157146488a3de81d1)
Signed-off-by: Matthew Thode <email address hidden>
Reviewed: https:/ /review. opendev. org/656419 /git.openstack. org/cgit/ openstack/ oslo.cache/ commit/ ?id=aeb95779c7b ea4117ccb69b17e ab31d452397964
Committed: https:/
Submitter: Zuul
Branch: stable/stein
commit aeb95779c7bea41 17ccb69b17eab31 d452397964
Author: Morgan Fainberg <email address hidden>
Date: Fri Mar 22 12:35:16 2019 -0700
Pass `flush_ on_reconnect` to memcache pooled backend
If a memcache server disappears and then reconnects when multiple memcache on_reconnect` ` optional argument to the backend. This
servers are used (specific to the python-memcached based backends) it is
possible that the server will contain stale data. The default is now to
supply the ``flush_
means that when the service connects to a memcache server, it will flush
all cached data in the server. The pooled backend is more likely to
run into issues with this as it does not explicitly use a thread.local
for the client. The non-pooled backend was not touched, it is not
the recommended production use-case.
See the help from python-memcached:
@param flush_on_reconnect: optional flag which prevents a
scenario that can cause stale data to be read: If there's more
than one memcached server and the connection to one is
interrupted, keys that mapped to that server will get
reassigned to another. If the first server comes back, those
keys will map to it again. If it still has its data, get()s
can read stale data that was overwritten on another
server. This flag is off by default for backwards
compatibility.
Change-Id: I3e335261f749ad 065e8abe972f4ac 476d334e6b3 6177655f1571464 88a3de81d1)
closes-bug: #1819957
(cherry picked from commit 1192f185a5fd2fa
Signed-off-by: Matthew Thode <email address hidden>