Unverified Commit 0dfb0250 authored by Binbin's avatar Binbin Committed by GitHub
Browse files

Fix GETEX db delete call to emit DB_FLAG_KEY_EXPIRED on expiration (#12243)

We should emit DB_FLAG_KEY_EXPIRED instead of DB_FLAG_KEY_DELETED.
This is an overlook in #9406.
parent da8f7428
...@@ -388,8 +388,7 @@ void getexCommand(client *c) { ...@@ -388,8 +388,7 @@ void getexCommand(client *c) {
if (((flags & OBJ_PXAT) || (flags & OBJ_EXAT)) && checkAlreadyExpired(milliseconds)) { if (((flags & OBJ_PXAT) || (flags & OBJ_EXAT)) && checkAlreadyExpired(milliseconds)) {
/* When PXAT/EXAT absolute timestamp is specified, there can be a chance that timestamp /* When PXAT/EXAT absolute timestamp is specified, there can be a chance that timestamp
* has already elapsed so delete the key in that case. */ * has already elapsed so delete the key in that case. */
int deleted = server.lazyfree_lazy_expire ? dbAsyncDelete(c->db, c->argv[1]) : int deleted = dbGenericDelete(c->db, c->argv[1], server.lazyfree_lazy_expire, DB_FLAG_KEY_EXPIRED);
dbSyncDelete(c->db, c->argv[1]);
serverAssert(deleted); serverAssert(deleted);
robj *aux = server.lazyfree_lazy_expire ? shared.unlink : shared.del; robj *aux = server.lazyfree_lazy_expire ? shared.unlink : shared.del;
rewriteClientCommandVector(c,2,aux,c->argv[1]); rewriteClientCommandVector(c,2,aux,c->argv[1]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment