Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在实现基于 CAS 的 memcached 检索,并且有一个可能很愚蠢的问题。如果没有特定键的条目,即第一次存储,我应该如何设置 cas id?
每当您设置 memcached 中不存在的新键时,cas 值应为 0。如果将其设置为 0 以外的值,您将收到 NOT_FOUND 错误。此错误的原因是 memcached 将尝试根据您尝试在 memcached 中设置的键检查您提供的 cas 值。由于该密钥尚不存在,因此您会得到 NOT_FOUND。