mirror of
https://github.com/redis/redis.git
synced 2026-06-09 08:55:06 -04:00
Clarify that if CAS fails we insert blocking.
This commit is contained in:
parent
e3243819ef
commit
c2d80e8ced
1 changed files with 3 additions and 0 deletions
3
vset.c
3
vset.c
|
|
@ -407,6 +407,9 @@ int VADD_CASReply(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
|
|||
if (ic == NULL ||
|
||||
(newnode = hnsw_try_commit_insert(vset->hnsw, ic)) == NULL)
|
||||
{
|
||||
/* If we are here, the CAS insert failed. We need to insert
|
||||
* again with full locking for neighbors selection and
|
||||
* actual insertion. This time we can't fail: */
|
||||
newnode = hnsw_insert(vset->hnsw, vec, NULL, 0, 0, nv, ef);
|
||||
RedisModule_Assert(newnode != NULL);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue