Skip to content

Commit

Permalink
[fix] assert failed when execute GET on expired bitmap key
Browse files Browse the repository at this point in the history
  • Loading branch information
VCgege authored and patpatbear committed Sep 24, 2024
1 parent d2076d3 commit 5d12ea2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ctrip_swap_string.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ static void tryTransStringToBitmap(redisDb *db, robj *key) {
int wholeKeyBeforeCall(swapData *data, keyRequest *key_request,
client *c, void *datactx) {
UNUSED(data), UNUSED(c), UNUSED(datactx);
if (key_request->cmd_flags & CMD_SWAP_DATATYPE_BITMAP) {
robj *o = lookupKey(data->db, data->key, LOOKUP_NOTOUCH);
if ((key_request->cmd_flags & CMD_SWAP_DATATYPE_BITMAP) && o) {
tryTransStringToBitmap(data->db,data->key);
}
return 0;
Expand Down
1 change: 1 addition & 0 deletions src/networking.c
Original file line number Diff line number Diff line change
Expand Up @@ -1426,6 +1426,7 @@ void freeClient(client *c) {
serverAssert(!(server.swap_draining_master && server.master));

if (c->keyrequests_count) {
c->flags &= ~CLIENT_CLOSE_ASAP;
if (server.master && c->flags & CLIENT_MASTER) {
serverLog(LL_WARNING, "Connection with master lost (defer start with %d key requests).", c->keyrequests_count);
server.swap_draining_master = server.master;
Expand Down

0 comments on commit 5d12ea2

Please sign in to comment.