Resolved merge conflicts in prior commit

Former-commit-id: b88f06b16f3d9e58ec884c61d2d074d7a489775e
This commit is contained in:
VivekSainiEQ 2021-10-21 22:35:15 +00:00
parent 1d882b5ddd
commit 93b0482376
34 changed files with 173 additions and 828 deletions

View File

@ -462,10 +462,7 @@ clean:
distclean: clean distclean: clean
-(cd ../deps && $(MAKE) distclean) -(cd ../deps && $(MAKE) distclean)
-(cd modules && $(MAKE) clean) -(cd modules && $(MAKE) clean)
<<<<<<< HEAD
=======
-(cd ../tests/modules && $(MAKE) clean) -(cd ../tests/modules && $(MAKE) clean)
>>>>>>> 6.2.6
-(rm -f .make-*) -(rm -f .make-*)
.PHONY: distclean .PHONY: distclean

View File

@ -1895,15 +1895,7 @@ void addACLLogEntry(client *c, int reason, int argpos, sds username) {
void aclCommand(client *c) { void aclCommand(client *c) {
char *sub = szFromObj(c->argv[1]); char *sub = szFromObj(c->argv[1]);
if (!strcasecmp(sub,"setuser") && c->argc >= 3) { if (!strcasecmp(sub,"setuser") && c->argc >= 3) {
<<<<<<< HEAD:src/acl.cpp
/* Consider information about passwords or permissions
* to be sensitive, which will be the arguments for this
* subcommand. */
preventCommandLogging(c);
sds username = szFromObj(c->argv[2]); sds username = szFromObj(c->argv[2]);
=======
sds username = c->argv[2]->ptr;
>>>>>>> 6.2.6:src/acl.c
/* Check username validity. */ /* Check username validity. */
if (ACLStringHasSpaces(username,sdslen(username))) { if (ACLStringHasSpaces(username,sdslen(username))) {
addReplyErrorFormat(c, addReplyErrorFormat(c,

View File

@ -75,7 +75,7 @@ static int aeApiCreate(aeEventLoop *eventLoop) {
return -1; return -1;
} }
anetCloexec(state->kqfd); anetCloexec(state->kqfd);
state->eventsMask = zmalloc(EVENT_MASK_MALLOC_SIZE(eventLoop->setsize)); state->eventsMask = zmalloc(EVENT_MASK_MALLOC_SIZE(eventLoop->setsize), MALLOC_LOCAL);
memset(state->eventsMask, 0, EVENT_MASK_MALLOC_SIZE(eventLoop->setsize)); memset(state->eventsMask, 0, EVENT_MASK_MALLOC_SIZE(eventLoop->setsize));
eventLoop->apidata = state; eventLoop->apidata = state;
return 0; return 0;
@ -84,13 +84,9 @@ static int aeApiCreate(aeEventLoop *eventLoop) {
static int aeApiResize(aeEventLoop *eventLoop, int setsize) { static int aeApiResize(aeEventLoop *eventLoop, int setsize) {
aeApiState *state = (aeApiState*)eventLoop->apidata; aeApiState *state = (aeApiState*)eventLoop->apidata;
<<<<<<< HEAD
state->events = (struct kevent*)zrealloc(state->events, sizeof(struct kevent)*setsize, MALLOC_LOCAL); state->events = (struct kevent*)zrealloc(state->events, sizeof(struct kevent)*setsize, MALLOC_LOCAL);
======= state->eventsMask = (char*)zrealloc(state->eventsMask, EVENT_MASK_MALLOC_SIZE(setsize), MALLOC_LOCAL);
state->events = zrealloc(state->events, sizeof(struct kevent)*setsize);
state->eventsMask = zrealloc(state->eventsMask, EVENT_MASK_MALLOC_SIZE(setsize));
memset(state->eventsMask, 0, EVENT_MASK_MALLOC_SIZE(setsize)); memset(state->eventsMask, 0, EVENT_MASK_MALLOC_SIZE(setsize));
>>>>>>> 6.2.6
return 0; return 0;
} }

View File

@ -131,7 +131,7 @@ void installAofRewriteEvent()
g_pserver->aof_rewrite_pending = true; g_pserver->aof_rewrite_pending = true;
int res = aePostFunction(g_pserver->rgthreadvar[IDX_EVENT_LOOP_MAIN].el, [] { int res = aePostFunction(g_pserver->rgthreadvar[IDX_EVENT_LOOP_MAIN].el, [] {
g_pserver->aof_rewrite_pending = false; g_pserver->aof_rewrite_pending = false;
if (g_pserver->aof_pipe_write_data_to_child >= 0) if (!g_pserver->aof_stop_sending_diff && g_pserver->aof_pipe_write_data_to_child >= 0)
aeCreateFileEvent(g_pserver->rgthreadvar[IDX_EVENT_LOOP_MAIN].el, g_pserver->aof_pipe_write_data_to_child, AE_WRITABLE, aofChildWriteDiffData, NULL); aeCreateFileEvent(g_pserver->rgthreadvar[IDX_EVENT_LOOP_MAIN].el, g_pserver->aof_pipe_write_data_to_child, AE_WRITABLE, aofChildWriteDiffData, NULL);
}); });
if (res != AE_OK) if (res != AE_OK)
@ -180,16 +180,7 @@ void aofRewriteBufferAppend(unsigned char *s, unsigned long len) {
/* Install a file event to send data to the rewrite child if there is /* Install a file event to send data to the rewrite child if there is
* not one already. */ * not one already. */
<<<<<<< HEAD:src/aof.cpp
installAofRewriteEvent(); installAofRewriteEvent();
=======
if (!server.aof_stop_sending_diff &&
aeGetFileEvents(server.el,server.aof_pipe_write_data_to_child) == 0)
{
aeCreateFileEvent(server.el, server.aof_pipe_write_data_to_child,
AE_WRITABLE, aofChildWriteDiffData, NULL);
}
>>>>>>> 6.2.6:src/aof.c
} }
/* Write the buffer (possibly composed of multiple blocks) into the specified /* Write the buffer (possibly composed of multiple blocks) into the specified

View File

@ -37,15 +37,9 @@
/* Count number of bits set in the binary array pointed by 's' and long /* Count number of bits set in the binary array pointed by 's' and long
* 'count' bytes. The implementation of this function is required to * 'count' bytes. The implementation of this function is required to
* work with an input string length up to 512 MB or more (server.proto_max_bulk_len) */ * work with an input string length up to 512 MB or more (server.proto_max_bulk_len) */
<<<<<<< HEAD:src/bitops.cpp long long redisPopcount(const void *s, long count) {
size_t redisPopcount(const void *s, long count) {
size_t bits = 0;
unsigned char *p = (unsigned char*)s;
=======
long long redisPopcount(void *s, long count) {
long long bits = 0; long long bits = 0;
unsigned char *p = s; unsigned char *p = (unsigned char*)s;
>>>>>>> 6.2.6:src/bitops.c
uint32_t *p4; uint32_t *p4;
static const unsigned char bitsinbyte[256] = {0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8}; static const unsigned char bitsinbyte[256] = {0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8};
@ -104,11 +98,7 @@ long long redisPopcount(void *s, long count) {
* no zero bit is found, it returns count*8 assuming the string is zero * no zero bit is found, it returns count*8 assuming the string is zero
* padded on the right. However if 'bit' is 1 it is possible that there is * padded on the right. However if 'bit' is 1 it is possible that there is
* not a single set bit in the bitmap. In this special case -1 is returned. */ * not a single set bit in the bitmap. In this special case -1 is returned. */
<<<<<<< HEAD:src/bitops.cpp long long redisBitpos(const void *s, unsigned long count, int bit) {
long redisBitpos(const void *s, unsigned long count, int bit) {
=======
long long redisBitpos(void *s, unsigned long count, int bit) {
>>>>>>> 6.2.6:src/bitops.c
unsigned long *l; unsigned long *l;
unsigned char *c; unsigned char *c;
unsigned long skipval, word = 0, one; unsigned long skipval, word = 0, one;
@ -538,13 +528,8 @@ const unsigned char *getObjectReadOnlyString(robj_roptr o, long *len, char *llbu
/* SETBIT key offset bitvalue */ /* SETBIT key offset bitvalue */
void setbitCommand(client *c) { void setbitCommand(client *c) {
robj *o; robj *o;
<<<<<<< HEAD:src/bitops.cpp
const char *err = "bit is not an integer or out of range"; const char *err = "bit is not an integer or out of range";
size_t bitoffset;
=======
char *err = "bit is not an integer or out of range";
uint64_t bitoffset; uint64_t bitoffset;
>>>>>>> 6.2.6:src/bitops.c
ssize_t byte, bit; ssize_t byte, bit;
int byteval, bitval; int byteval, bitval;
long on; long on;
@ -1020,13 +1005,8 @@ struct bitfieldOp {
* when flags is set to BITFIELD_FLAG_READONLY: in this case only the * when flags is set to BITFIELD_FLAG_READONLY: in this case only the
* GET subcommand is allowed, other subcommands will return an error. */ * GET subcommand is allowed, other subcommands will return an error. */
void bitfieldGeneric(client *c, int flags) { void bitfieldGeneric(client *c, int flags) {
<<<<<<< HEAD:src/bitops.cpp
robj_roptr o; robj_roptr o;
size_t bitoffset;
=======
robj *o;
uint64_t bitoffset; uint64_t bitoffset;
>>>>>>> 6.2.6:src/bitops.c
int j, numops = 0, changes = 0; int j, numops = 0, changes = 0;
struct bitfieldOp *ops = NULL; /* Array of ops to execute at end. */ struct bitfieldOp *ops = NULL; /* Array of ops to execute at end. */
int owtype = BFOVERFLOW_WRAP; /* Overflow type. */ int owtype = BFOVERFLOW_WRAP; /* Overflow type. */

View File

@ -88,15 +88,12 @@ typedef struct bkinfo {
* flag is set client query buffer is not longer processed, but accumulated, * flag is set client query buffer is not longer processed, but accumulated,
* and will be processed when the client is unblocked. */ * and will be processed when the client is unblocked. */
void blockClient(client *c, int btype) { void blockClient(client *c, int btype) {
<<<<<<< HEAD:src/blocked.cpp
serverAssert(GlobalLocksAcquired()); serverAssert(GlobalLocksAcquired());
=======
/* Master client should never be blocked unless pause or module */ /* Master client should never be blocked unless pause or module */
serverAssert(!(c->flags & CLIENT_MASTER && serverAssert(!(c->flags & CLIENT_MASTER &&
btype != BLOCKED_MODULE && btype != BLOCKED_MODULE &&
btype != BLOCKED_PAUSE)); btype != BLOCKED_PAUSE));
>>>>>>> 6.2.6:src/blocked.c
c->flags |= CLIENT_BLOCKED; c->flags |= CLIENT_BLOCKED;
c->btype = btype; c->btype = btype;
g_pserver->blocked_clients++; g_pserver->blocked_clients++;

View File

@ -746,7 +746,7 @@ void clusterAcceptHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
} }
connNonBlock(conn); connNonBlock(conn);
connEnableTcpNoDelay(conn); connEnableTcpNoDelay(conn);
connKeepAlive(conn,server.cluster_node_timeout * 2); connKeepAlive(conn,g_pserver->cluster_node_timeout * 2);
/* Use non-blocking I/O for cluster messages. */ /* Use non-blocking I/O for cluster messages. */
serverLog(LL_VERBOSE,"Accepting cluster node connection from %s:%d", cip, cport); serverLog(LL_VERBOSE,"Accepting cluster node connection from %s:%d", cip, cport);
@ -5191,7 +5191,7 @@ void mvccrestoreCommand(client *c) {
rio payload; rio payload;
rioInitWithBuffer(&payload,szFromObj(c->argv[4])); rioInitWithBuffer(&payload,szFromObj(c->argv[4]));
if (((type = rdbLoadObjectType(&payload)) == -1) || if (((type = rdbLoadObjectType(&payload)) == -1) ||
((obj = rdbLoadObject(type,&payload,szFromObj(key), OBJ_MVCC_INVALID)) == NULL)) ((obj = rdbLoadObject(type,&payload,szFromObj(key),NULL,OBJ_MVCC_INVALID)) == NULL))
{ {
addReplyError(c,"Bad data format"); addReplyError(c,"Bad data format");
return; return;
@ -5277,11 +5277,7 @@ void restoreCommand(client *c) {
rioInitWithBuffer(&payload,szFromObj(c->argv[3])); rioInitWithBuffer(&payload,szFromObj(c->argv[3]));
if (((type = rdbLoadObjectType(&payload)) == -1) || if (((type = rdbLoadObjectType(&payload)) == -1) ||
<<<<<<< HEAD:src/cluster.cpp ((obj = rdbLoadObject(type,&payload,szFromObj(key),NULL,OBJ_MVCC_INVALID)) == NULL))
((obj = rdbLoadObject(type,&payload,szFromObj(key), OBJ_MVCC_INVALID)) == NULL))
=======
((obj = rdbLoadObject(type,&payload,key->ptr,NULL)) == NULL))
>>>>>>> 6.2.6:src/cluster.c
{ {
addReplyError(c,"Bad data format"); addReplyError(c,"Bad data format");
return; return;
@ -5464,31 +5460,19 @@ void migrateCommand(client *c) {
return; return;
} }
j++; j++;
<<<<<<< HEAD:src/cluster.cpp
password = szFromObj(c->argv[j]); password = szFromObj(c->argv[j]);
} else if (!strcasecmp(szFromObj(c->argv[j]),"auth2")) {
=======
password = c->argv[j]->ptr;
redactClientCommandArgument(c,j); redactClientCommandArgument(c,j);
} else if (!strcasecmp(c->argv[j]->ptr,"auth2")) { } else if (!strcasecmp(szFromObj(c->argv[j]),"auth2")) {
>>>>>>> 6.2.6:src/cluster.c
if (moreargs < 2) { if (moreargs < 2) {
addReply(c,shared.syntaxerr); addReply(c,shared.syntaxerr);
return; return;
} }
<<<<<<< HEAD:src/cluster.cpp
username = szFromObj(c->argv[++j]); username = szFromObj(c->argv[++j]);
redactClientCommandArgument(c,j);
password = szFromObj(c->argv[++j]); password = szFromObj(c->argv[++j]);
redactClientCommandArgument(c,j);
} else if (!strcasecmp(szFromObj(c->argv[j]),"keys")) { } else if (!strcasecmp(szFromObj(c->argv[j]),"keys")) {
if (sdslen(szFromObj(c->argv[3])) != 0) { if (sdslen(szFromObj(c->argv[3])) != 0) {
=======
username = c->argv[++j]->ptr;
redactClientCommandArgument(c,j);
password = c->argv[++j]->ptr;
redactClientCommandArgument(c,j);
} else if (!strcasecmp(c->argv[j]->ptr,"keys")) {
if (sdslen(c->argv[3]->ptr) != 0) {
>>>>>>> 6.2.6:src/cluster.c
addReplyError(c, addReplyError(c,
"When using MIGRATE KEYS option, the key argument" "When using MIGRATE KEYS option, the key argument"
" must be set to the empty string"); " must be set to the empty string");

View File

@ -30,11 +30,8 @@
#include "server.h" #include "server.h"
#include "cluster.h" #include "cluster.h"
#include "atomicvar.h" #include "atomicvar.h"
<<<<<<< HEAD:src/db.cpp
#include "aelocker.h" #include "aelocker.h"
=======
#include "latency.h" #include "latency.h"
>>>>>>> 6.2.6:src/db.c
#include <signal.h> #include <signal.h>
#include <ctype.h> #include <ctype.h>
@ -1678,16 +1675,17 @@ expireEntry *getExpire(redisDb *db, robj_roptr key) {
void deleteExpiredKeyAndPropagate(redisDb *db, robj *keyobj) { void deleteExpiredKeyAndPropagate(redisDb *db, robj *keyobj) {
mstime_t expire_latency; mstime_t expire_latency;
latencyStartMonitor(expire_latency); latencyStartMonitor(expire_latency);
if (server.lazyfree_lazy_expire) if (g_pserver->lazyfree_lazy_expire) {
dbAsyncDelete(db,keyobj); dbAsyncDelete(db,keyobj);
else } else {
dbSyncDelete(db,keyobj); dbSyncDelete(db,keyobj);
}
latencyEndMonitor(expire_latency); latencyEndMonitor(expire_latency);
latencyAddSampleIfNeeded("expire-del",expire_latency); latencyAddSampleIfNeeded("expire-del",expire_latency);
notifyKeyspaceEvent(NOTIFY_EXPIRED,"expired",keyobj,db->id); notifyKeyspaceEvent(NOTIFY_EXPIRED,"expired",keyobj,db->id);
signalModifiedKey(NULL, db, keyobj); signalModifiedKey(NULL,db,keyobj);
propagateExpire(db,keyobj,server.lazyfree_lazy_expire); propagateExpire(db,keyobj,g_pserver->lazyfree_lazy_expire);
server.stat_expiredkeys++; g_pserver->stat_expiredkeys++;
} }
/* Propagate expires into slaves and the AOF file. /* Propagate expires into slaves and the AOF file.
@ -1843,20 +1841,7 @@ int expireIfNeeded(redisDb *db, robj *key) {
if (checkClientPauseTimeoutAndReturnIfPaused()) return 1; if (checkClientPauseTimeoutAndReturnIfPaused()) return 1;
/* Delete the key */ /* Delete the key */
<<<<<<< HEAD:src/db.cpp
if (g_pserver->lazyfree_lazy_expire) {
dbAsyncDelete(db,key);
} else {
dbSyncDelete(db,key);
}
g_pserver->stat_expiredkeys++;
propagateExpire(db,key,g_pserver->lazyfree_lazy_expire);
notifyKeyspaceEvent(NOTIFY_EXPIRED,
"expired",key,db->id);
signalModifiedKey(NULL,db,key);
=======
deleteExpiredKeyAndPropagate(db,key); deleteExpiredKeyAndPropagate(db,key);
>>>>>>> 6.2.6:src/db.c
return 1; return 1;
} }

View File

@ -44,7 +44,6 @@
* *
* The parameter 'now' is the current time in milliseconds as is passed * The parameter 'now' is the current time in milliseconds as is passed
* to the function to avoid too many gettimeofday() syscalls. */ * to the function to avoid too many gettimeofday() syscalls. */
<<<<<<< HEAD:src/expire.cpp
void activeExpireCycleExpireFullKey(redisDb *db, const char *key) { void activeExpireCycleExpireFullKey(redisDb *db, const char *key) {
robj *keyobj = createStringObject(key,sdslen(key)); robj *keyobj = createStringObject(key,sdslen(key));
mstime_t expire_latency; mstime_t expire_latency;
@ -78,15 +77,6 @@ int activeExpireCycleExpire(redisDb *db, expireEntry &e, long long now, size_t &
{ {
activeExpireCycleExpireFullKey(db, e.key()); activeExpireCycleExpireFullKey(db, e.key());
++tried; ++tried;
=======
int activeExpireCycleTryExpire(redisDb *db, dictEntry *de, long long now) {
long long t = dictGetSignedIntegerVal(de);
if (now > t) {
sds key = dictGetKey(de);
robj *keyobj = createStringObject(key,sdslen(key));
deleteExpiredKeyAndPropagate(db,keyobj);
decrRefCount(keyobj);
>>>>>>> 6.2.6:src/expire.c
return 1; return 1;
} }

View File

@ -518,16 +518,8 @@ void georadiusGeneric(client *c, int srcKeyIndex, int flags) {
int storedist = 0; /* 0 for STORE, 1 for STOREDIST. */ int storedist = 0; /* 0 for STORE, 1 for STOREDIST. */
/* Look up the requested zset */ /* Look up the requested zset */
<<<<<<< HEAD:src/geo.cpp robj_roptr zobj = lookupKeyRead(c->db, c->argv[srcKeyIndex]);
robj_roptr zobj = nullptr;
if ((zobj = lookupKeyReadOrReply(c, c->argv[srcKeyIndex], shared.emptyarray)) == nullptr ||
checkType(c, zobj, OBJ_ZSET)) {
return;
}
=======
robj *zobj = lookupKeyRead(c->db, c->argv[srcKeyIndex]);
if (checkType(c, zobj, OBJ_ZSET)) return; if (checkType(c, zobj, OBJ_ZSET)) return;
>>>>>>> 6.2.6:src/geo.c
/* Find long/lat to use for radius or box search based on inquiry type */ /* Find long/lat to use for radius or box search based on inquiry type */
int base_args; int base_args;
@ -621,7 +613,7 @@ void georadiusGeneric(client *c, int srcKeyIndex, int flags) {
!fromloc) !fromloc)
{ {
/* No source key, proceed with argument parsing and return an error when done. */ /* No source key, proceed with argument parsing and return an error when done. */
if (zobj == NULL) { if (!zobj) {
frommember = 1; frommember = 1;
i++; i++;
continue; continue;
@ -696,13 +688,13 @@ void georadiusGeneric(client *c, int srcKeyIndex, int flags) {
} }
/* Return ASAP when src key does not exist. */ /* Return ASAP when src key does not exist. */
if (zobj == NULL) { if (!zobj) {
if (storekey) { if (storekey) {
/* store key is not NULL, try to delete it and return 0. */ /* store key is not NULL, try to delete it and return 0. */
if (dbDelete(c->db, storekey)) { if (dbDelete(c->db, storekey)) {
signalModifiedKey(c, c->db, storekey); signalModifiedKey(c, c->db, storekey);
notifyKeyspaceEvent(NOTIFY_GENERIC, "del", storekey, c->db->id); notifyKeyspaceEvent(NOTIFY_GENERIC, "del", storekey, c->db->id);
server.dirty++; g_pserver->dirty++;
} }
addReply(c, shared.czero); addReply(c, shared.czero);
} else { } else {

View File

@ -104,14 +104,9 @@ intset *intsetNew(void) {
/* Resize the intset */ /* Resize the intset */
static intset *intsetResize(intset *is, uint32_t len) { static intset *intsetResize(intset *is, uint32_t len) {
<<<<<<< HEAD
uint32_t size = len*intrev32ifbe(is->encoding);
is = zrealloc(is,sizeof(intset)+size, MALLOC_SHARED);
=======
uint64_t size = (uint64_t)len*intrev32ifbe(is->encoding); uint64_t size = (uint64_t)len*intrev32ifbe(is->encoding);
assert(size <= SIZE_MAX - sizeof(intset)); assert(size <= SIZE_MAX - sizeof(intset));
is = zrealloc(is,sizeof(intset)+size); is = zrealloc(is,sizeof(intset)+size, MALLOC_SHARED);
>>>>>>> 6.2.6
return is; return is;
} }

View File

@ -2632,11 +2632,7 @@ int RM_StringTruncate(RedisModuleKey *key, size_t newlen) {
if (newlen > curlen) { if (newlen > curlen) {
key->value->m_ptr = sdsgrowzero(szFromObj(key->value),newlen); key->value->m_ptr = sdsgrowzero(szFromObj(key->value),newlen);
} else if (newlen < curlen) { } else if (newlen < curlen) {
<<<<<<< HEAD:src/module.cpp sdssubstr(szFromObj(key->value),0,newlen);
sdsrange(szFromObj(key->value),0,newlen-1);
=======
sdssubstr(key->value->ptr,0,newlen);
>>>>>>> 6.2.6:src/module.c
/* If the string is too wasteful, reallocate it. */ /* If the string is too wasteful, reallocate it. */
if (sdslen(szFromObj(key->value)) < sdsavail(szFromObj(key->value))) if (sdslen(szFromObj(key->value)) < sdsavail(szFromObj(key->value)))
key->value->m_ptr = sdsRemoveFreeSpace(szFromObj(key->value)); key->value->m_ptr = sdsRemoveFreeSpace(szFromObj(key->value));
@ -5790,7 +5786,7 @@ int moduleBlockedClientMayTimeout(client *c) {
if (c->btype != BLOCKED_MODULE) if (c->btype != BLOCKED_MODULE)
return 1; return 1;
RedisModuleBlockedClient *bc = c->bpop.module_blocked_handle; RedisModuleBlockedClient *bc = (RedisModuleBlockedClient*)c->bpop.module_blocked_handle;
return (bc && bc->timeout_callback != NULL); return (bc && bc->timeout_callback != NULL);
} }

View File

@ -156,12 +156,7 @@ void execCommandAbort(client *c, sds error) {
/* Send EXEC to clients waiting data from MONITOR. We did send a MULTI /* Send EXEC to clients waiting data from MONITOR. We did send a MULTI
* already, and didn't send any of the queued commands, now we'll just send * already, and didn't send any of the queued commands, now we'll just send
* EXEC so it is clear that the transaction is over. */ * EXEC so it is clear that the transaction is over. */
<<<<<<< HEAD:src/multi.cpp
if (listLength(g_pserver->monitors) && !g_pserver->loading)
replicationFeedMonitors(c,g_pserver->monitors,c->db->id,c->argv,c->argc); replicationFeedMonitors(c,g_pserver->monitors,c->db->id,c->argv,c->argc);
=======
replicationFeedMonitors(c,server.monitors,c->db->id,c->argv,c->argc);
>>>>>>> 6.2.6:src/multi.c
} }
void execCommand(client *c) { void execCommand(client *c) {
@ -198,7 +193,6 @@ void execCommand(client *c) {
return; return;
} }
{ // GOTO Protectect Variable Scope
uint64_t old_flags = c->flags; uint64_t old_flags = c->flags;
/* we do not want to allow blocking commands inside multi */ /* we do not want to allow blocking commands inside multi */
@ -285,21 +279,7 @@ void execCommand(client *c) {
afterPropagateExec(); afterPropagateExec();
} }
<<<<<<< HEAD:src/multi.cpp
serverTL->in_exec = 0; serverTL->in_exec = 0;
} // END Goto Variable Protection Scope
handle_monitor:
/* Send EXEC to clients waiting data from MONITOR. We do it here
* since the natural order of commands execution is actually:
* MUTLI, EXEC, ... commands inside transaction ...
* Instead EXEC is flagged as CMD_SKIP_MONITOR in the command
* table, and we do it here with correct ordering. */
if (listLength(g_pserver->monitors) && !g_pserver->loading)
replicationFeedMonitors(c,g_pserver->monitors,c->db->id,c->argv,c->argc);
=======
server.in_exec = 0;
>>>>>>> 6.2.6:src/multi.c
} }
/* ===================== WATCH (CAS alike for MULTI/EXEC) =================== /* ===================== WATCH (CAS alike for MULTI/EXEC) ===================
@ -386,7 +366,7 @@ int isWatchedKeyExpired(client *c) {
if (listLength(c->watched_keys) == 0) return 0; if (listLength(c->watched_keys) == 0) return 0;
listRewind(c->watched_keys,&li); listRewind(c->watched_keys,&li);
while ((ln = listNext(&li))) { while ((ln = listNext(&li))) {
wk = listNodeValue(ln); wk = (watchedKey*)listNodeValue(ln);
if (keyIsExpired(wk->db, wk->key)) return 1; if (keyIsExpired(wk->db, wk->key)) return 1;
} }

View File

@ -112,11 +112,6 @@ static void clientSetDefaultAuth(client *c) {
!(c->user->flags & USER_FLAG_DISABLED); !(c->user->flags & USER_FLAG_DISABLED);
} }
<<<<<<< HEAD:src/networking.cpp
client *createClient(connection *conn, int iel) {
client *c = (client*)zmalloc(sizeof(client), MALLOC_LOCAL);
serverAssert(conn == nullptr || (iel == (serverTL - g_pserver->rgthreadvar)));
=======
int authRequired(client *c) { int authRequired(client *c) {
/* Check if the user is authenticated. This check is skipped in case /* Check if the user is authenticated. This check is skipped in case
* the default user is flagged as "nopass" and is active. */ * the default user is flagged as "nopass" and is active. */
@ -126,9 +121,9 @@ int authRequired(client *c) {
return auth_required; return auth_required;
} }
client *createClient(connection *conn) { client *createClient(connection *conn, int iel) {
client *c = zmalloc(sizeof(client)); client *c = (client*)zmalloc(sizeof(client), MALLOC_LOCAL);
>>>>>>> 6.2.6:src/networking.c serverAssert(conn == nullptr || (iel == (serverTL - g_pserver->rgthreadvar)));
c->iel = iel; c->iel = iel;
/* passing NULL as conn it is possible to create a non connected client. /* passing NULL as conn it is possible to create a non connected client.
@ -1932,7 +1927,7 @@ void ProcessPendingAsyncWrites()
(c->replstate == SLAVE_STATE_ONLINE && !c->repl_put_online_on_ack)))) (c->replstate == SLAVE_STATE_ONLINE && !c->repl_put_online_on_ack))))
continue; continue;
asyncCloseClientOnOutputBufferLimitReached(c); closeClientOnOutputBufferLimitReached(c, 1);
if (c->flags & CLIENT_CLOSE_ASAP) if (c->flags & CLIENT_CLOSE_ASAP)
continue; // we will never write this so don't post an op continue; // we will never write this so don't post an op
@ -2369,10 +2364,7 @@ int processMultibulkBuffer(client *c) {
* 1. The client is reset unless there are reasons to avoid doing it. * 1. The client is reset unless there are reasons to avoid doing it.
* 2. In the case of master clients, the replication offset is updated. * 2. In the case of master clients, the replication offset is updated.
* 3. Propagate commands we got from our master to replicas down the line. */ * 3. Propagate commands we got from our master to replicas down the line. */
<<<<<<< HEAD:src/networking.cpp
void commandProcessed(client *c, int flags) { void commandProcessed(client *c, int flags) {
=======
void commandProcessed(client *c) {
/* If client is blocked(including paused), just return avoid reset and replicate. /* If client is blocked(including paused), just return avoid reset and replicate.
* *
* 1. Don't reset the client structure for blocked clients, so that the reply * 1. Don't reset the client structure for blocked clients, so that the reply
@ -2384,7 +2376,6 @@ void commandProcessed(client *c) {
resetClient(c); resetClient(c);
>>>>>>> 6.2.6:src/networking.c
long long prev_offset = c->reploff; long long prev_offset = c->reploff;
if (c->flags & CLIENT_MASTER && !(c->flags & CLIENT_MULTI)) { if (c->flags & CLIENT_MASTER && !(c->flags & CLIENT_MULTI)) {
/* Update the applied replication offset of our master. */ /* Update the applied replication offset of our master. */
@ -3122,12 +3113,8 @@ NULL
if (getLongLongFromObjectOrReply(c,c->argv[2],&id,NULL) if (getLongLongFromObjectOrReply(c,c->argv[2],&id,NULL)
!= C_OK) return; != C_OK) return;
struct client *target = lookupClientByID(id); struct client *target = lookupClientByID(id);
<<<<<<< HEAD:src/networking.cpp
if (target && target->flags & CLIENT_BLOCKED) {
std::unique_lock<fastlock> ul(target->lock);
=======
if (target && target->flags & CLIENT_BLOCKED && moduleBlockedClientMayTimeout(target)) { if (target && target->flags & CLIENT_BLOCKED && moduleBlockedClientMayTimeout(target)) {
>>>>>>> 6.2.6:src/networking.c std::unique_lock<fastlock> ul(target->lock);
if (unblock_error) if (unblock_error)
addReplyError(target, addReplyError(target,
"-UNBLOCKED client unblocked via CLIENT UNBLOCK"); "-UNBLOCKED client unblocked via CLIENT UNBLOCK");
@ -3832,12 +3819,8 @@ void unpauseClients(void) {
listIter li; listIter li;
client *c; client *c;
<<<<<<< HEAD:src/networking.cpp
g_pserver->client_pause_type = CLIENT_PAUSE_OFF; g_pserver->client_pause_type = CLIENT_PAUSE_OFF;
======= g_pserver->client_pause_end_time = 0;
server.client_pause_type = CLIENT_PAUSE_OFF;
server.client_pause_end_time = 0;
>>>>>>> 6.2.6:src/networking.c
/* Unblock all of the clients so they are reprocessed. */ /* Unblock all of the clients so they are reprocessed. */
listRewind(g_pserver->paused_clients,&li); listRewind(g_pserver->paused_clients,&li);
@ -3901,7 +3884,6 @@ void processEventsWhileBlocked(int iel) {
vecclients.push_back(c); vecclients.push_back(c);
} }
} }
<<<<<<< HEAD:src/networking.cpp
/* Since we're about to release our lock we need to flush the repl backlog queue */ /* Since we're about to release our lock we need to flush the repl backlog queue */
bool fReplBacklog = g_pserver->repl_batch_offStart >= 0; bool fReplBacklog = g_pserver->repl_batch_offStart >= 0;
@ -3915,25 +3897,6 @@ void processEventsWhileBlocked(int iel) {
aeReleaseLock(); aeReleaseLock();
serverAssert(!GlobalLocksAcquired()); serverAssert(!GlobalLocksAcquired());
try try
=======
listEmpty(server.clients_pending_write);
/* Update processed count on server */
server.stat_io_writes_processed += processed;
return processed;
}
/* Return 1 if we want to handle the client read later using threaded I/O.
* This is called by the readable handler of the event loop.
* As a side effect of calling this function the client is put in the
* pending read clients and flagged as such. */
int postponeClientRead(client *c) {
if (server.io_threads_active &&
server.io_threads_do_reads &&
!ProcessingEventsWhileBlocked &&
!(c->flags & (CLIENT_MASTER|CLIENT_SLAVE|CLIENT_PENDING_READ|CLIENT_BLOCKED)))
>>>>>>> 6.2.6:src/networking.c
{ {
ProcessingEventsWhileBlocked = 1; ProcessingEventsWhileBlocked = 1;
while (iterations--) { while (iterations--) {
@ -3965,40 +3928,7 @@ int postponeClientRead(client *c) {
locker.arm(nullptr); locker.arm(nullptr);
locker.release(); locker.release();
<<<<<<< HEAD:src/networking.cpp
g_pserver->events_processed_while_blocked += eventsCount; g_pserver->events_processed_while_blocked += eventsCount;
=======
/* Also use the main thread to process a slice of clients. */
listRewind(io_threads_list[0],&li);
while((ln = listNext(&li))) {
client *c = listNodeValue(ln);
readQueryFromClient(c->conn);
}
listEmpty(io_threads_list[0]);
/* Wait for all the other threads to end their work. */
while(1) {
unsigned long pending = 0;
for (int j = 1; j < server.io_threads_num; j++)
pending += getIOPendingCount(j);
if (pending == 0) break;
}
/* Run the list of clients again to process the new buffers. */
while(listLength(server.clients_pending_read)) {
ln = listFirst(server.clients_pending_read);
client *c = listNodeValue(ln);
c->flags &= ~CLIENT_PENDING_READ;
listDelNode(server.clients_pending_read,ln);
serverAssert(!(c->flags & CLIENT_BLOCKED));
if (processPendingCommandsAndResetClient(c) == C_ERR) {
/* If the client is no longer valid, we avoid
* processing the client later. So we just go
* to the next. */
continue;
}
>>>>>>> 6.2.6:src/networking.c
whileBlockedCron(); whileBlockedCron();

View File

@ -975,13 +975,8 @@ size_t objectComputeSize(robj *o, size_t sample_size) {
serverPanic("Unknown hash encoding"); serverPanic("Unknown hash encoding");
} }
} else if (o->type == OBJ_STREAM) { } else if (o->type == OBJ_STREAM) {
<<<<<<< HEAD:src/object.cpp
stream *s = (stream*)ptrFromObj(o); stream *s = (stream*)ptrFromObj(o);
asize = sizeof(*o);
=======
stream *s = o->ptr;
asize = sizeof(*o)+sizeof(*s); asize = sizeof(*o)+sizeof(*s);
>>>>>>> 6.2.6:src/object.c
asize += streamRadixTreeMemoryUsage(s->rax); asize += streamRadixTreeMemoryUsage(s->rax);
/* Now we have to add the listpacks. The last listpack is often non /* Now we have to add the listpacks. The last listpack is often non
@ -1330,16 +1325,9 @@ robj_roptr objectCommandLookup(client *c, robj *key) {
return lookupKeyReadWithFlags(c->db,key,LOOKUP_NOTOUCH|LOOKUP_NONOTIFY); return lookupKeyReadWithFlags(c->db,key,LOOKUP_NOTOUCH|LOOKUP_NONOTIFY);
} }
<<<<<<< HEAD:src/object.cpp
robj_roptr objectCommandLookupOrReply(client *c, robj *key, robj *reply) { robj_roptr objectCommandLookupOrReply(client *c, robj *key, robj *reply) {
robj_roptr o = objectCommandLookup(c,key); robj_roptr o = objectCommandLookup(c,key);
if (!o) addReply(c, reply);
=======
robj *objectCommandLookupOrReply(client *c, robj *key, robj *reply) {
robj *o = objectCommandLookup(c,key);
if (!o) SentReplyOnKeyMiss(c, reply); if (!o) SentReplyOnKeyMiss(c, reply);
>>>>>>> 6.2.6:src/object.c
return o; return o;
} }

View File

@ -547,19 +547,13 @@ void *rdbGenericLoadStringObject(rio *rdb, int flags, size_t *lenptr) {
} }
return buf; return buf;
} else { } else {
<<<<<<< HEAD:src/rdb.cpp
robj *o = encode ? createStringObject(SDS_NOINIT,len) :
createRawStringObject(SDS_NOINIT,len);
if (len && rioRead(rdb,ptrFromObj(o),len) == 0) {
=======
robj *o = encode ? tryCreateStringObject(SDS_NOINIT,len) : robj *o = encode ? tryCreateStringObject(SDS_NOINIT,len) :
tryCreateRawStringObject(SDS_NOINIT,len); tryCreateRawStringObject(SDS_NOINIT,len);
if (!o) { if (!o) {
serverLog(server.loading? LL_WARNING: LL_VERBOSE, "rdbGenericLoadStringObject failed allocating %llu bytes", len); serverLog(g_pserver->loading? LL_WARNING: LL_VERBOSE, "rdbGenericLoadStringObject failed allocating %llu bytes", len);
return NULL; return NULL;
} }
if (len && rioRead(rdb,o->ptr,len) == 0) { if (len && rioRead(rdb,ptrFromObj(o),len) == 0) {
>>>>>>> 6.2.6:src/rdb.c
decrRefCount(o); decrRefCount(o);
return NULL; return NULL;
} }
@ -1611,29 +1605,19 @@ robj *rdbLoadCheckModuleValue(rio *rdb, char *modulename) {
} }
/* Load a Redis object of the specified type from the specified file. /* Load a Redis object of the specified type from the specified file.
<<<<<<< HEAD:src/rdb.cpp
* On success a newly allocated object is returned, otherwise NULL. */
robj *rdbLoadObject(int rdbtype, rio *rdb, sds key, uint64_t mvcc_tstamp) {
=======
* On success a newly allocated object is returned, otherwise NULL. * On success a newly allocated object is returned, otherwise NULL.
* When the function returns NULL and if 'error' is not NULL, the * When the function returns NULL and if 'error' is not NULL, the
* integer pointed by 'error' is set to the type of error that occurred */ * integer pointed by 'error' is set to the type of error that occurred */
robj *rdbLoadObject(int rdbtype, rio *rdb, sds key, int *error) { robj *rdbLoadObject(int rdbtype, rio *rdb, sds key, int *error, uint64_t mvcc_tstamp) {
>>>>>>> 6.2.6:src/rdb.c
robj *o = NULL, *ele, *dec; robj *o = NULL, *ele, *dec;
uint64_t len; uint64_t len;
unsigned int i; unsigned int i;
<<<<<<< HEAD:src/rdb.cpp
int deep_integrity_validation = cserver.sanitize_dump_payload == SANITIZE_DUMP_YES;
if (cserver.sanitize_dump_payload == SANITIZE_DUMP_CLIENTS) {
=======
/* Set default error of load object, it will be set to 0 on success. */ /* Set default error of load object, it will be set to 0 on success. */
if (error) *error = RDB_LOAD_ERR_OTHER; if (error) *error = RDB_LOAD_ERR_OTHER;
int deep_integrity_validation = server.sanitize_dump_payload == SANITIZE_DUMP_YES; int deep_integrity_validation = cserver.sanitize_dump_payload == SANITIZE_DUMP_YES;
if (server.sanitize_dump_payload == SANITIZE_DUMP_CLIENTS) { if (cserver.sanitize_dump_payload == SANITIZE_DUMP_CLIENTS) {
>>>>>>> 6.2.6:src/rdb.c
/* Skip sanitization when loading (an RDB), or getting a RESTORE command /* Skip sanitization when loading (an RDB), or getting a RESTORE command
* from either the master or a client using an ACL user with the skip-sanitize-payload flag. */ * from either the master or a client using an ACL user with the skip-sanitize-payload flag. */
int skip = g_pserver->loading || int skip = g_pserver->loading ||
@ -1674,13 +1658,9 @@ robj *rdbLoadObject(int rdbtype, rio *rdb, sds key, int *error) {
if (len == 0) goto emptykey; if (len == 0) goto emptykey;
/* Use a regular set when there are too many entries. */ /* Use a regular set when there are too many entries. */
<<<<<<< HEAD:src/rdb.cpp size_t max_entries = g_pserver->set_max_intset_entries;
if (len > g_pserver->set_max_intset_entries) {
=======
size_t max_entries = server.set_max_intset_entries;
if (max_entries >= 1<<30) max_entries = 1<<30; if (max_entries >= 1<<30) max_entries = 1<<30;
if (len > max_entries) { if (len > max_entries) {
>>>>>>> 6.2.6:src/rdb.c
o = createSetObject(); o = createSetObject();
/* It's faster to expand the dict to the right size asap in order /* It's faster to expand the dict to the right size asap in order
* to avoid rehashing */ * to avoid rehashing */
@ -1795,18 +1775,11 @@ robj *rdbLoadObject(int rdbtype, rio *rdb, sds key, int *error) {
} }
/* Convert *after* loading, since sorted sets are not stored ordered. */ /* Convert *after* loading, since sorted sets are not stored ordered. */
<<<<<<< HEAD:src/rdb.cpp
if (zsetLength(o) <= g_pserver->zset_max_ziplist_entries && if (zsetLength(o) <= g_pserver->zset_max_ziplist_entries &&
maxelelen <= g_pserver->zset_max_ziplist_value) maxelelen <= g_pserver->zset_max_ziplist_value &&
zsetConvert(o,OBJ_ENCODING_ZIPLIST);
=======
if (zsetLength(o) <= server.zset_max_ziplist_entries &&
maxelelen <= server.zset_max_ziplist_value &&
ziplistSafeToAdd(NULL, totelelen)) ziplistSafeToAdd(NULL, totelelen))
{
zsetConvert(o,OBJ_ENCODING_ZIPLIST); zsetConvert(o,OBJ_ENCODING_ZIPLIST);
}
>>>>>>> 6.2.6:src/rdb.c
} else if (rdbtype == RDB_TYPE_HASH) { } else if (rdbtype == RDB_TYPE_HASH) {
uint64_t len; uint64_t len;
int ret; int ret;
@ -1860,25 +1833,13 @@ robj *rdbLoadObject(int rdbtype, rio *rdb, sds key, int *error) {
} }
} }
<<<<<<< HEAD:src/rdb.cpp
/* Add pair to ziplist */
o->m_ptr = ziplistPush((unsigned char*)ptrFromObj(o), (unsigned char*)field,
sdslen(field), ZIPLIST_TAIL);
o->m_ptr = ziplistPush((unsigned char*)ptrFromObj(o), (unsigned char*)value,
sdslen(value), ZIPLIST_TAIL);
/* Convert to hash table if size threshold is exceeded */ /* Convert to hash table if size threshold is exceeded */
if (sdslen(field) > g_pserver->hash_max_ziplist_value || if (sdslen(field) > g_pserver->hash_max_ziplist_value ||
sdslen(value) > g_pserver->hash_max_ziplist_value) sdslen(value) > g_pserver->hash_max_ziplist_value ||
======= !ziplistSafeToAdd((unsigned char*)ptrFromObj(o), sdslen(field)+sdslen(value)))
/* Convert to hash table if size threshold is exceeded */
if (sdslen(field) > server.hash_max_ziplist_value ||
sdslen(value) > server.hash_max_ziplist_value ||
!ziplistSafeToAdd(o->ptr, sdslen(field)+sdslen(value)))
>>>>>>> 6.2.6:src/rdb.c
{ {
hashTypeConvert(o, OBJ_ENCODING_HT); hashTypeConvert(o, OBJ_ENCODING_HT);
ret = dictAdd((dict*)o->ptr, field, value); ret = dictAdd((dict*)ptrFromObj(o), field, value);
if (ret == DICT_ERR) { if (ret == DICT_ERR) {
rdbReportCorruptRDB("Duplicate hash fields detected"); rdbReportCorruptRDB("Duplicate hash fields detected");
if (dupSearchDict) dictRelease(dupSearchDict); if (dupSearchDict) dictRelease(dupSearchDict);
@ -1891,11 +1852,12 @@ robj *rdbLoadObject(int rdbtype, rio *rdb, sds key, int *error) {
} }
/* Add pair to ziplist */ /* Add pair to ziplist */
o->ptr = ziplistPush(o->ptr, (unsigned char*)field, o->m_ptr = ziplistPush((unsigned char*)ptrFromObj(o), (unsigned char*)field,
sdslen(field), ZIPLIST_TAIL); sdslen(field), ZIPLIST_TAIL);
o->ptr = ziplistPush(o->ptr, (unsigned char*)value, o->m_ptr = ziplistPush((unsigned char*)ptrFromObj(o), (unsigned char*)value,
sdslen(value), ZIPLIST_TAIL); sdslen(value), ZIPLIST_TAIL);
sdsfree(field); sdsfree(field);
sdsfree(value); sdsfree(value);
} }
@ -1965,23 +1927,19 @@ robj *rdbLoadObject(int rdbtype, rio *rdb, sds key, int *error) {
zfree(zl); zfree(zl);
return NULL; return NULL;
} }
<<<<<<< HEAD:src/rdb.cpp
quicklistAppendZiplist((quicklist*)ptrFromObj(o), zl);
=======
/* Silently skip empty ziplists, if we'll end up with empty quicklist we'll fail later. */ /* Silently skip empty ziplists, if we'll end up with empty quicklist we'll fail later. */
if (ziplistLen(zl) == 0) { if (ziplistLen(zl) == 0) {
zfree(zl); zfree(zl);
continue; continue;
} else { } else {
quicklistAppendZiplist(o->ptr, zl); quicklistAppendZiplist((quicklist*)ptrFromObj(o), zl);
} }
} }
if (quicklistCount(o->ptr) == 0) { if (quicklistCount((quicklist*)ptrFromObj(o)) == 0) {
decrRefCount(o); decrRefCount(o);
goto emptykey; goto emptykey;
>>>>>>> 6.2.6:src/rdb.c
} }
} else if (rdbtype == RDB_TYPE_HASH_ZIPMAP || } else if (rdbtype == RDB_TYPE_HASH_ZIPMAP ||
rdbtype == RDB_TYPE_LIST_ZIPLIST || rdbtype == RDB_TYPE_LIST_ZIPLIST ||
@ -2069,7 +2027,7 @@ robj *rdbLoadObject(int rdbtype, rio *rdb, sds key, int *error) {
if (ziplistLen(encoded) == 0) { if (ziplistLen(encoded) == 0) {
zfree(encoded); zfree(encoded);
o->ptr = NULL; o->m_ptr = NULL;
decrRefCount(o); decrRefCount(o);
goto emptykey; goto emptykey;
} }
@ -2103,18 +2061,14 @@ robj *rdbLoadObject(int rdbtype, rio *rdb, sds key, int *error) {
} }
o->type = OBJ_ZSET; o->type = OBJ_ZSET;
o->encoding = OBJ_ENCODING_ZIPLIST; o->encoding = OBJ_ENCODING_ZIPLIST;
<<<<<<< HEAD:src/rdb.cpp
if (zsetLength(o) > g_pserver->zset_max_ziplist_entries)
=======
if (zsetLength(o) == 0) { if (zsetLength(o) == 0) {
zfree(encoded); zfree(encoded);
o->ptr = NULL; o->m_ptr = NULL;
decrRefCount(o); decrRefCount(o);
goto emptykey; goto emptykey;
} }
if (zsetLength(o) > server.zset_max_ziplist_entries) if (zsetLength(o) > g_pserver->zset_max_ziplist_entries)
>>>>>>> 6.2.6:src/rdb.c
zsetConvert(o,OBJ_ENCODING_SKIPLIST); zsetConvert(o,OBJ_ENCODING_SKIPLIST);
break; break;
case RDB_TYPE_HASH_ZIPLIST: case RDB_TYPE_HASH_ZIPLIST:
@ -2128,18 +2082,14 @@ robj *rdbLoadObject(int rdbtype, rio *rdb, sds key, int *error) {
} }
o->type = OBJ_HASH; o->type = OBJ_HASH;
o->encoding = OBJ_ENCODING_ZIPLIST; o->encoding = OBJ_ENCODING_ZIPLIST;
<<<<<<< HEAD:src/rdb.cpp
if (hashTypeLength(o) > g_pserver->hash_max_ziplist_entries)
=======
if (hashTypeLength(o) == 0) { if (hashTypeLength(o) == 0) {
zfree(encoded); zfree(encoded);
o->ptr = NULL; o->m_ptr = NULL;
decrRefCount(o); decrRefCount(o);
goto emptykey; goto emptykey;
} }
if (hashTypeLength(o) > server.hash_max_ziplist_entries) if (hashTypeLength(o) > g_pserver->hash_max_ziplist_entries)
>>>>>>> 6.2.6:src/rdb.c
hashTypeConvert(o, OBJ_ENCODING_HT); hashTypeConvert(o, OBJ_ENCODING_HT);
break; break;
default: default:
@ -2377,7 +2327,7 @@ robj *rdbLoadObject(int rdbtype, rio *rdb, sds key, int *error) {
raxStart(&ri_cg_pel,cgroup->pel); raxStart(&ri_cg_pel,cgroup->pel);
raxSeek(&ri_cg_pel,"^",NULL,0); raxSeek(&ri_cg_pel,"^",NULL,0);
while(raxNext(&ri_cg_pel)) { while(raxNext(&ri_cg_pel)) {
streamNACK *nack = ri_cg_pel.data; streamNACK *nack = (streamNACK *)ri_cg_pel.data;
if (!nack->consumer) { if (!nack->consumer) {
raxStop(&ri_cg_pel); raxStop(&ri_cg_pel);
rdbReportCorruptRDB("Stream CG PEL entry without consumer"); rdbReportCorruptRDB("Stream CG PEL entry without consumer");
@ -2465,13 +2415,10 @@ robj *rdbLoadObject(int rdbtype, rio *rdb, sds key, int *error) {
rdbReportReadError("Unknown RDB encoding type %d",rdbtype); rdbReportReadError("Unknown RDB encoding type %d",rdbtype);
return NULL; return NULL;
} }
<<<<<<< HEAD:src/rdb.cpp
setMvccTstamp(o, mvcc_tstamp); setMvccTstamp(o, mvcc_tstamp);
serverAssert(!o->FExpires()); serverAssert(!o->FExpires());
=======
if (error) *error = 0; if (error) *error = 0;
>>>>>>> 6.2.6:src/rdb.c
return o; return o;
emptykey: emptykey:
@ -2595,7 +2542,6 @@ int rdbLoadRio(rio *rdb, int rdbflags, rdbSaveInfo *rsi) {
int type, rdbver; int type, rdbver;
redisDb *db = g_pserver->db+0; redisDb *db = g_pserver->db+0;
char buf[1024]; char buf[1024];
<<<<<<< HEAD:src/rdb.cpp
/* Key-specific attributes, set by opcodes before the key type. */ /* Key-specific attributes, set by opcodes before the key type. */
long long lru_idle = -1, lfu_freq = -1, expiretime = -1, now; long long lru_idle = -1, lfu_freq = -1, expiretime = -1, now;
long long lru_clock = 0; long long lru_clock = 0;
@ -2603,10 +2549,8 @@ int rdbLoadRio(rio *rdb, int rdbflags, rdbSaveInfo *rsi) {
robj *subexpireKey = nullptr; robj *subexpireKey = nullptr;
sds key = nullptr; sds key = nullptr;
bool fLastKeyExpired = false; bool fLastKeyExpired = false;
=======
int error; int error;
long long empty_keys_skipped = 0, expired_keys_skipped = 0, keys_loaded = 0; long long empty_keys_skipped = 0, expired_keys_skipped = 0, keys_loaded = 0;
>>>>>>> 6.2.6:src/rdb.c
rdb->update_cksum = rdbLoadProgressCallback; rdb->update_cksum = rdbLoadProgressCallback;
rdb->max_processing_chunk = g_pserver->loading_process_events_interval_bytes; rdb->max_processing_chunk = g_pserver->loading_process_events_interval_bytes;
@ -2841,38 +2785,7 @@ int rdbLoadRio(rio *rdb, int rdbflags, rdbSaveInfo *rsi) {
if ((key = (sds)rdbGenericLoadStringObject(rdb,RDB_LOAD_SDS,NULL)) == NULL) if ((key = (sds)rdbGenericLoadStringObject(rdb,RDB_LOAD_SDS,NULL)) == NULL)
goto eoferr; goto eoferr;
/* Read value */ /* Read value */
<<<<<<< HEAD:src/rdb.cpp val = rdbLoadObject(type,rdb,key,&error,mvcc_tstamp);
if ((val = rdbLoadObject(type,rdb,key,mvcc_tstamp)) == NULL) {
sdsfree(key);
key = nullptr;
goto eoferr;
}
bool fStaleMvccKey = (rsi) ? mvccFromObj(val) < rsi->mvccMinThreshold : false;
=======
val = rdbLoadObject(type,rdb,key,&error);
>>>>>>> 6.2.6:src/rdb.c
/* Check if the key already expired. This function is used when loading
* an RDB file from disk, either at startup, or when an RDB was
* received from the master. In the latter case, the master is
* responsible for key expiry. If we would expire keys here, the
* snapshot taken by the master may not be reflected on the replica.
* Similarly if the RDB is the preamble of an AOF file, we want to
* load all the keys as they are, since the log of operations later
* assume to work in an exact keyspace state. */
<<<<<<< HEAD:src/rdb.cpp
redisObjectStack keyobj;
initStaticStringObject(keyobj,key);
bool fExpiredKey = iAmMaster() && !(rdbflags&RDBFLAGS_AOF_PREAMBLE) && expiretime != -1 && expiretime < now;
if (fStaleMvccKey || fExpiredKey) {
if (fStaleMvccKey && !fExpiredKey && rsi != nullptr && rsi->mi != nullptr && rsi->mi->staleKeyMap != nullptr && lookupKeyRead(db, &keyobj) == nullptr) {
// We have a key that we've already deleted and is not back in our database.
// We'll need to inform the sending master of the delete if it is also a replica of us
robj_sharedptr objKeyDup(createStringObject(key, sdslen(key)));
rsi->mi->staleKeyMap->operator[](db - g_pserver->db).push_back(objKeyDup);
}
fLastKeyExpired = true;
=======
if (val == NULL) { if (val == NULL) {
/* Since we used to have bug that could lead to empty keys /* Since we used to have bug that could lead to empty keys
* (See #8453), we rather not fail when empty key is encountered * (See #8453), we rather not fail when empty key is encountered
@ -2882,53 +2795,53 @@ int rdbLoadRio(rio *rdb, int rdbflags, rdbSaveInfo *rsi) {
if(empty_keys_skipped++ < 10) if(empty_keys_skipped++ < 10)
serverLog(LL_WARNING, "rdbLoadObject skipping empty key: %s", key); serverLog(LL_WARNING, "rdbLoadObject skipping empty key: %s", key);
sdsfree(key); sdsfree(key);
key = nullptr;
} else { } else {
sdsfree(key); sdsfree(key);
goto eoferr; goto eoferr;
} }
} else if (iAmMaster() && } else {
!(rdbflags&RDBFLAGS_AOF_PREAMBLE) && bool fStaleMvccKey = (rsi) ? mvccFromObj(val) < rsi->mvccMinThreshold : false;
expiretime != -1 && expiretime < now)
{ /* Check if the key already expired. This function is used when loading
>>>>>>> 6.2.6:src/rdb.c * an RDB file from disk, either at startup, or when an RDB was
* received from the master. In the latter case, the master is
* responsible for key expiry. If we would expire keys here, the
* snapshot taken by the master may not be reflected on the replica.
* Similarly if the RDB is the preamble of an AOF file, we want to
* load all the keys as they are, since the log of operations later
* assume to work in an exact keyspace state. */
redisObjectStack keyobj;
initStaticStringObject(keyobj,key);
bool fExpiredKey = iAmMaster() && !(rdbflags&RDBFLAGS_AOF_PREAMBLE) && expiretime != -1 && expiretime < now;
if (fStaleMvccKey || fExpiredKey) {
if (fStaleMvccKey && !fExpiredKey && rsi != nullptr && rsi->mi != nullptr && rsi->mi->staleKeyMap != nullptr && lookupKeyRead(db, &keyobj) == nullptr) {
// We have a key that we've already deleted and is not back in our database.
// We'll need to inform the sending master of the delete if it is also a replica of us
robj_sharedptr objKeyDup(createStringObject(key, sdslen(key)));
rsi->mi->staleKeyMap->operator[](db - g_pserver->db).push_back(objKeyDup);
}
fLastKeyExpired = true;
sdsfree(key); sdsfree(key);
key = nullptr; key = nullptr;
decrRefCount(val); decrRefCount(val);
<<<<<<< HEAD:src/rdb.cpp
val = nullptr; val = nullptr;
=======
expired_keys_skipped++; expired_keys_skipped++;
>>>>>>> 6.2.6:src/rdb.c
} else { } else {
redisObjectStack keyobj; redisObjectStack keyobj;
initStaticStringObject(keyobj,key); initStaticStringObject(keyobj,key);
/* Add the new object in the hash table */ /* Add the new object in the hash table */
<<<<<<< HEAD:src/rdb.cpp
int fInserted = dbMerge(db, key, val, (rsi && rsi->fForceSetKey) || (rdbflags & RDBFLAGS_ALLOW_DUP)); // Note: dbMerge will incrRef int fInserted = dbMerge(db, key, val, (rsi && rsi->fForceSetKey) || (rdbflags & RDBFLAGS_ALLOW_DUP)); // Note: dbMerge will incrRef
fLastKeyExpired = false; fLastKeyExpired = false;
keys_loaded++;
if (fInserted) if (fInserted)
{ {
/* Set the expire time if needed */ /* Set the expire time if needed */
if (expiretime != -1) if (expiretime != -1)
{ {
setExpire(NULL,db,&keyobj,nullptr,expiretime); setExpire(NULL,db,&keyobj,nullptr,expiretime);
=======
int added = dbAddRDBLoad(db,key,val);
keys_loaded++;
if (!added) {
if (rdbflags & RDBFLAGS_ALLOW_DUP) {
/* This flag is useful for DEBUG RELOAD special modes.
* When it's set we allow new keys to replace the current
* keys with the same name. */
dbSyncDelete(db,&keyobj);
dbAddRDBLoad(db,key,val);
} else {
serverLog(LL_WARNING,
"RDB has duplicated key '%s' in DB %d",key,db->id);
serverPanic("Duplicated key found in RDB file");
>>>>>>> 6.2.6:src/rdb.c
} }
/* Set usage information (for eviction). */ /* Set usage information (for eviction). */
@ -2945,6 +2858,7 @@ int rdbLoadRio(rio *rdb, int rdbflags, rdbSaveInfo *rsi) {
val = nullptr; val = nullptr;
} }
} }
}
if (g_pserver->key_load_delay) if (g_pserver->key_load_delay)
debugDelay(g_pserver->key_load_delay); debugDelay(g_pserver->key_load_delay);
@ -3099,7 +3013,6 @@ static void backgroundSaveDoneHandlerSocket(int exitcode, int bysignal) {
serverLog(LL_WARNING, serverLog(LL_WARNING,
"Background transfer terminated by signal %d", bysignal); "Background transfer terminated by signal %d", bysignal);
} }
<<<<<<< HEAD:src/rdb.cpp
if (g_pserver->rdb_child_exit_pipe!=-1) if (g_pserver->rdb_child_exit_pipe!=-1)
close(g_pserver->rdb_child_exit_pipe); close(g_pserver->rdb_child_exit_pipe);
auto pipeT = g_pserver->rdb_pipe_read; auto pipeT = g_pserver->rdb_pipe_read;
@ -3116,21 +3029,6 @@ static void backgroundSaveDoneHandlerSocket(int exitcode, int bysignal) {
zfree(g_pserver->rdb_pipe_buff); zfree(g_pserver->rdb_pipe_buff);
g_pserver->rdb_pipe_buff = NULL; g_pserver->rdb_pipe_buff = NULL;
g_pserver->rdb_pipe_bufflen = 0; g_pserver->rdb_pipe_bufflen = 0;
=======
if (server.rdb_child_exit_pipe!=-1)
close(server.rdb_child_exit_pipe);
aeDeleteFileEvent(server.el, server.rdb_pipe_read, AE_READABLE);
close(server.rdb_pipe_read);
server.rdb_child_exit_pipe = -1;
server.rdb_pipe_read = -1;
zfree(server.rdb_pipe_conns);
server.rdb_pipe_conns = NULL;
server.rdb_pipe_numconns = 0;
server.rdb_pipe_numconns_writing = 0;
zfree(server.rdb_pipe_buff);
server.rdb_pipe_buff = NULL;
server.rdb_pipe_bufflen = 0;
>>>>>>> 6.2.6:src/rdb.c
} }
/* When a background RDB saving/transfer terminates, call the right handler. */ /* When a background RDB saving/transfer terminates, call the right handler. */

View File

@ -158,11 +158,7 @@ int rdbSaveS3(char *path, rdbSaveInfo *rsi);
int rdbLoadS3(char *path, rdbSaveInfo *rsi, int rdbflags); int rdbLoadS3(char *path, rdbSaveInfo *rsi, int rdbflags);
ssize_t rdbSaveObject(rio *rdb, robj_roptr o, robj *key); ssize_t rdbSaveObject(rio *rdb, robj_roptr o, robj *key);
size_t rdbSavedObjectLen(robj *o, robj *key); size_t rdbSavedObjectLen(robj *o, robj *key);
<<<<<<< HEAD robj *rdbLoadObject(int type, rio *rdb, sds key, int *error, uint64_t mvcc_tstamp);
robj *rdbLoadObject(int type, rio *rdb, sds key, uint64_t mvcc_tstamp);
=======
robj *rdbLoadObject(int type, rio *rdb, sds key, int *error);
>>>>>>> 6.2.6
void backgroundSaveDoneHandler(int exitcode, int bysignal); void backgroundSaveDoneHandler(int exitcode, int bysignal);
int rdbSaveKeyValuePair(rio *rdb, robj *key, robj *val, long long expiretime); int rdbSaveKeyValuePair(rio *rdb, robj *key, robj *val, long long expiretime);
ssize_t rdbSaveSingleModuleAux(rio *rdb, int when, moduleType *mt); ssize_t rdbSaveSingleModuleAux(rio *rdb, int when, moduleType *mt);

View File

@ -308,11 +308,7 @@ int redis_check_rdb(const char *rdbfilename, FILE *fp) {
rdbstate.keys++; rdbstate.keys++;
/* Read value */ /* Read value */
rdbstate.doing = RDB_CHECK_DOING_READ_OBJECT_VALUE; rdbstate.doing = RDB_CHECK_DOING_READ_OBJECT_VALUE;
<<<<<<< HEAD:src/redis-check-rdb.cpp if ((val = rdbLoadObject(type,&rdb,szFromObj(key),NULL,OBJ_MVCC_INVALID)) == NULL) goto eoferr;
if ((val = rdbLoadObject(type,&rdb,szFromObj(key),OBJ_MVCC_INVALID)) == NULL) goto eoferr;
=======
if ((val = rdbLoadObject(type,&rdb,key->ptr,NULL)) == NULL) goto eoferr;
>>>>>>> 6.2.6:src/redis-check-rdb.c
/* Check if the key already expired. */ /* Check if the key already expired. */
if (expiretime != -1 && expiretime < now) if (expiretime != -1 && expiretime < now)
rdbstate.already_expired++; rdbstate.already_expired++;

View File

@ -72,102 +72,7 @@
redisContext *context; redisContext *context;
struct config config; struct config config;
<<<<<<< HEAD
int g_fTestMode = 0; int g_fTestMode = 0;
=======
static uint64_t dictSdsHash(const void *key);
static int dictSdsKeyCompare(void *privdata, const void *key1,
const void *key2);
static void dictSdsDestructor(void *privdata, void *val);
static void dictListDestructor(void *privdata, void *val);
/* Cluster Manager Command Info */
typedef struct clusterManagerCommand {
char *name;
int argc;
char **argv;
int flags;
int replicas;
char *from;
char *to;
char **weight;
int weight_argc;
char *master_id;
int slots;
int timeout;
int pipeline;
float threshold;
char *backup_dir;
char *from_user;
char *from_pass;
int from_askpass;
} clusterManagerCommand;
static void createClusterManagerCommand(char *cmdname, int argc, char **argv);
static redisContext *context;
static struct config {
char *hostip;
int hostport;
char *hostsocket;
int tls;
cliSSLconfig sslconfig;
long repeat;
long interval;
int dbnum; /* db num currently selected */
int input_dbnum; /* db num user input */
int interactive;
int shutdown;
int monitor_mode;
int pubsub_mode;
int latency_mode;
int latency_dist_mode;
int latency_history;
int lru_test_mode;
long long lru_test_sample_size;
int cluster_mode;
int cluster_reissue_command;
int cluster_send_asking;
int slave_mode;
int pipe_mode;
int pipe_timeout;
int getrdb_mode;
int stat_mode;
int scan_mode;
int intrinsic_latency_mode;
int intrinsic_latency_duration;
sds pattern;
char *rdb_filename;
int bigkeys;
int memkeys;
unsigned memkeys_samples;
int hotkeys;
int stdinarg; /* get last arg from stdin. (-x option) */
char *auth;
int askpass;
char *user;
int quoted_input; /* Force input args to be treated as quoted strings */
int output; /* output mode, see OUTPUT_* defines */
int push_output; /* Should we display spontaneous PUSH replies */
sds mb_delim;
sds cmd_delim;
char prompt[128];
char *eval;
int eval_ldb;
int eval_ldb_sync; /* Ask for synchronous mode of the Lua debugger. */
int eval_ldb_end; /* Lua debugging session ended. */
int enable_ldb_on_eval; /* Handle manual SCRIPT DEBUG + EVAL commands. */
int last_cmd_type;
int verbose;
int set_errcode;
clusterManagerCommand cluster_manager_command;
int no_auth_warning;
int resp3;
int in_multi;
int pre_multi_dbnum;
} config;
>>>>>>> 6.2.6
/* User preferences. */ /* User preferences. */
static struct pref { static struct pref {
@ -1853,12 +1758,8 @@ static void usage(void) {
" --lru-test <keys> Simulate a cache workload with an 80-20 distribution.\n" " --lru-test <keys> Simulate a cache workload with an 80-20 distribution.\n"
" --replica Simulate a replica showing commands received from the master.\n" " --replica Simulate a replica showing commands received from the master.\n"
" --rdb <filename> Transfer an RDB dump from remote server to local file.\n" " --rdb <filename> Transfer an RDB dump from remote server to local file.\n"
<<<<<<< HEAD
" --pipe Transfer raw KeyDB protocol from stdin to server.\n"
=======
" Use filename of \"-\" to write to stdout.\n" " Use filename of \"-\" to write to stdout.\n"
" --pipe Transfer raw Redis protocol from stdin to server.\n" " --pipe Transfer raw KeyDB protocol from stdin to server.\n"
>>>>>>> 6.2.6
" --pipe-timeout <n> In --pipe mode, abort with error if after sending all data.\n" " --pipe-timeout <n> In --pipe mode, abort with error if after sending all data.\n"
" no reply is received within <n> seconds.\n" " no reply is received within <n> seconds.\n"
" Default timeout: %d. Use 0 to wait forever.\n", " Default timeout: %d. Use 0 to wait forever.\n",

View File

@ -146,7 +146,8 @@ extern struct config {
char *key; char *key;
long repeat; long repeat;
long interval; long interval;
int dbnum; int dbnum; /* db num currently selected */
int input_dbnum; /* db num user input */
int interactive; int interactive;
int shutdown; int shutdown;
int monitor_mode; int monitor_mode;
@ -158,6 +159,7 @@ extern struct config {
long long lru_test_sample_size; long long lru_test_sample_size;
int cluster_mode; int cluster_mode;
int cluster_reissue_command; int cluster_reissue_command;
int cluster_send_asking;
int slave_mode; int slave_mode;
int pipe_mode; int pipe_mode;
int pipe_timeout; int pipe_timeout;

View File

@ -609,7 +609,7 @@ void replicationFeedSlavesFromMasterStream(char *buf, size_t buflen) {
} }
void replicationFeedMonitors(client *c, list *monitors, int dictid, robj **argv, int argc) { void replicationFeedMonitors(client *c, list *monitors, int dictid, robj **argv, int argc) {
if (!(listLength(server.monitors) && !server.loading)) return; if (!(listLength(g_pserver->monitors) && !g_pserver->loading)) return;
listNode *ln; listNode *ln;
listIter li; listIter li;
int j; int j;

View File

@ -1739,7 +1739,7 @@ void evalGenericCommand(client *c, int evalsha) {
void evalCommand(client *c) { void evalCommand(client *c) {
/* Explicitly feed monitor here so that lua commands appear after their /* Explicitly feed monitor here so that lua commands appear after their
* script command. */ * script command. */
replicationFeedMonitors(c,server.monitors,c->db->id,c->argv,c->argc); replicationFeedMonitors(c,g_pserver->monitors,c->db->id,c->argv,c->argc);
if (!(c->flags & CLIENT_LUA_DEBUG)) if (!(c->flags & CLIENT_LUA_DEBUG))
evalGenericCommand(c,0); evalGenericCommand(c,0);
else else
@ -1747,14 +1747,10 @@ void evalCommand(client *c) {
} }
void evalShaCommand(client *c) { void evalShaCommand(client *c) {
<<<<<<< HEAD:src/scripting.cpp
if (sdslen((sds)ptrFromObj(c->argv[1])) != 40) {
=======
/* Explicitly feed monitor here so that lua commands appear after their /* Explicitly feed monitor here so that lua commands appear after their
* script command. */ * script command. */
replicationFeedMonitors(c,server.monitors,c->db->id,c->argv,c->argc); replicationFeedMonitors(c,g_pserver->monitors,c->db->id,c->argv,c->argc);
if (sdslen(c->argv[1]->ptr) != 40) { if (sdslen((sds)ptrFromObj(c->argv[1])) != 40) {
>>>>>>> 6.2.6:src/scripting.c
/* We know that a match is not possible if the provided SHA is /* We know that a match is not possible if the provided SHA is
* not the right length. So we return an error ASAP, this way * not the right length. So we return an error ASAP, this way
* evalGenericCommand() can be implemented without string length * evalGenericCommand() can be implemented without string length
@ -2133,7 +2129,7 @@ int ldbDelBreakpoint(int line) {
* On success the command is parsed and returned as an array of SDS strings, * On success the command is parsed and returned as an array of SDS strings,
* otherwise NULL is returned and there is to read more buffer. */ * otherwise NULL is returned and there is to read more buffer. */
sds *ldbReplParseCommand(int *argcp, char** err) { sds *ldbReplParseCommand(int *argcp, char** err) {
static char* protocol_error = "protocol error"; static sds protocol_error = sdsnew("protocol error");
sds *argv = NULL; sds *argv = NULL;
int argc = 0; int argc = 0;
char *plen = NULL; char *plen = NULL;
@ -2150,13 +2146,8 @@ sds *ldbReplParseCommand(int *argcp, char** err) {
/* Seek and parse *<count>\r\n. */ /* Seek and parse *<count>\r\n. */
p = strchr(p,'*'); if (!p) goto protoerr; p = strchr(p,'*'); if (!p) goto protoerr;
<<<<<<< HEAD:src/scripting.cpp
plen = p+1; /* Multi bulk len pointer. */ plen = p+1; /* Multi bulk len pointer. */
p = strstr(p,"\r\n"); if (!p) goto protoerr;
=======
char *plen = p+1; /* Multi bulk len pointer. */
p = strstr(p,"\r\n"); if (!p) goto keep_reading; p = strstr(p,"\r\n"); if (!p) goto keep_reading;
>>>>>>> 6.2.6:src/scripting.c
*p = '\0'; p += 2; *p = '\0'; p += 2;
*argcp = atoi(plen); *argcp = atoi(plen);
if (*argcp <= 0 || *argcp > 1024) goto protoerr; if (*argcp <= 0 || *argcp > 1024) goto protoerr;
@ -2625,7 +2616,9 @@ void ldbRedis(lua_State *lua, sds *argv, int argc) {
         * given by the user (without the first argument) and we also push the 'redis' global table and          * given by the user (without the first argument) and we also push the 'redis' global table and
         * 'redis.call' function so:          * 'redis.call' function so:
         * (1 (redis table)) + (1 (redis.call function)) + (argc - 1 (all arguments without the first)) = argc + 1*/          * (1 (redis table)) + (1 (redis.call function)) + (argc - 1 (all arguments without the first)) = argc + 1*/
ldbLogRedisReply("max lua stack reached"); sds reply = sdsnew("max lua stack reached");
ldbLogRedisReply(reply);
sdsfree(reply);
return; return;
} }

View File

@ -290,15 +290,8 @@ sds sdsMakeRoomFor(sds s, size_t addlen) {
if (type == SDS_TYPE_5) type = SDS_TYPE_8; if (type == SDS_TYPE_5) type = SDS_TYPE_8;
hdrlen = sdsHdrSize(type); hdrlen = sdsHdrSize(type);
<<<<<<< HEAD
assert(hdrlen + newlen + 1 > len); /* Catch size_t overflow */
if (oldtype==type && (len+1024) >= avail) {
// note: if we have a lot of free space don't use this as we don't want s_realloc copying
// uninitialized data
=======
assert(hdrlen + newlen + 1 > reqlen); /* Catch size_t overflow */ assert(hdrlen + newlen + 1 > reqlen); /* Catch size_t overflow */
if (oldtype==type) { if (oldtype==type) {
>>>>>>> 6.2.6
newsh = s_realloc_usable(sh, hdrlen+newlen+1, &usable); newsh = s_realloc_usable(sh, hdrlen+newlen+1, &usable);
if (newsh == NULL) return NULL; if (newsh == NULL) return NULL;
s = (char*)newsh+hdrlen; s = (char*)newsh+hdrlen;

View File

@ -3187,21 +3187,13 @@ void sentinelConfigSetCommand(client *c) {
sentinel.announce_port = numval; sentinel.announce_port = numval;
} else if (!strcasecmp(szFromObj(o), "sentinel-user")) { } else if (!strcasecmp(szFromObj(o), "sentinel-user")) {
sdsfree(sentinel.sentinel_auth_user); sdsfree(sentinel.sentinel_auth_user);
<<<<<<< HEAD:src/sentinel.cpp sentinel.sentinel_auth_user = sdslen(szFromObj(val)) == 0 ?
sentinel.sentinel_auth_user = sdsnew(szFromObj(val)); NULL : sdsdup(szFromObj(val));
=======
sentinel.sentinel_auth_user = sdslen(val->ptr) == 0 ?
NULL : sdsdup(val->ptr);
>>>>>>> 6.2.6:src/sentinel.c
drop_conns = 1; drop_conns = 1;
} else if (!strcasecmp(szFromObj(o), "sentinel-pass")) { } else if (!strcasecmp(szFromObj(o), "sentinel-pass")) {
sdsfree(sentinel.sentinel_auth_pass); sdsfree(sentinel.sentinel_auth_pass);
<<<<<<< HEAD:src/sentinel.cpp sentinel.sentinel_auth_pass = sdslen(szFromObj(val)) == 0 ?
sentinel.sentinel_auth_pass = sdsnew(szFromObj(val)); NULL : sdsdup(szFromObj(val));
=======
sentinel.sentinel_auth_pass = sdslen(val->ptr) == 0 ?
NULL : sdsdup(val->ptr);
>>>>>>> 6.2.6:src/sentinel.c
drop_conns = 1; drop_conns = 1;
} else { } else {
addReplyErrorFormat(c, "Invalid argument '%s' to SENTINEL CONFIG SET", addReplyErrorFormat(c, "Invalid argument '%s' to SENTINEL CONFIG SET",

View File

@ -1908,7 +1908,6 @@ void clientsCron(int iel) {
/* Rotate the list, take the current head, process. /* Rotate the list, take the current head, process.
* This way if the client must be removed from the list it's the * This way if the client must be removed from the list it's the
* first element and we don't incur into O(N) computation. */ * first element and we don't incur into O(N) computation. */
<<<<<<< HEAD:src/server.cpp
listRotateTailToHead(g_pserver->clients); listRotateTailToHead(g_pserver->clients);
head = (listNode*)listFirst(g_pserver->clients); head = (listNode*)listFirst(g_pserver->clients);
c = (client*)listNodeValue(head); c = (client*)listNodeValue(head);
@ -1922,22 +1921,10 @@ void clientsCron(int iel) {
if (clientsCronResizeQueryBuffer(c)) goto LContinue; if (clientsCronResizeQueryBuffer(c)) goto LContinue;
if (clientsCronTrackExpansiveClients(c, curr_peak_mem_usage_slot)) goto LContinue; if (clientsCronTrackExpansiveClients(c, curr_peak_mem_usage_slot)) goto LContinue;
if (clientsCronTrackClientsMemUsage(c)) goto LContinue; if (clientsCronTrackClientsMemUsage(c)) goto LContinue;
if (closeClientOnOutputBufferLimitReached(c, 0)) continue; // Client also free'd
LContinue: LContinue:
fastlock_unlock(&c->lock); fastlock_unlock(&c->lock);
} }
=======
listRotateTailToHead(server.clients);
head = listFirst(server.clients);
c = listNodeValue(head);
/* The following functions do different service checks on the client.
* The protocol is that they return non-zero if the client was
* terminated. */
if (clientsCronHandleTimeout(c,now)) continue;
if (clientsCronResizeQueryBuffer(c)) continue;
if (clientsCronTrackExpansiveClients(c, curr_peak_mem_usage_slot)) continue;
if (clientsCronTrackClientsMemUsage(c)) continue;
if (closeClientOnOutputBufferLimitReached(c, 0)) continue;
>>>>>>> 6.2.6:src/server.c
} }
/* Free any pending clients */ /* Free any pending clients */
@ -2779,7 +2766,6 @@ void createSharedObjects(void) {
shared.eval = makeObjectShared("EVAL",4); shared.eval = makeObjectShared("EVAL",4);
/* Shared command argument */ /* Shared command argument */
<<<<<<< HEAD:src/server.cpp
shared.left = makeObjectShared("left",4); shared.left = makeObjectShared("left",4);
shared.right = makeObjectShared("right",5); shared.right = makeObjectShared("right",5);
shared.pxat = makeObjectShared("PXAT", 4); shared.pxat = makeObjectShared("PXAT", 4);
@ -2799,33 +2785,13 @@ void createSharedObjects(void) {
shared.getack = makeObjectShared("GETACK",6); shared.getack = makeObjectShared("GETACK",6);
shared.special_asterick = makeObjectShared("*",1); shared.special_asterick = makeObjectShared("*",1);
shared.special_equals = makeObjectShared("=",1); shared.special_equals = makeObjectShared("=",1);
shared.redacted = makeObjectShared("(redacted)",10);
/* KeyDB Specific */ /* KeyDB Specific */
shared.hdel = makeObjectShared(createStringObject("HDEL", 4)); shared.hdel = makeObjectShared(createStringObject("HDEL", 4));
shared.zrem = makeObjectShared(createStringObject("ZREM", 4)); shared.zrem = makeObjectShared(createStringObject("ZREM", 4));
shared.mvccrestore = makeObjectShared(createStringObject("KEYDB.MVCCRESTORE", 17)); shared.mvccrestore = makeObjectShared(createStringObject("KEYDB.MVCCRESTORE", 17));
shared.pexpirememberat = makeObjectShared(createStringObject("PEXPIREMEMBERAT",15)); shared.pexpirememberat = makeObjectShared(createStringObject("PEXPIREMEMBERAT",15));
=======
shared.left = createStringObject("left",4);
shared.right = createStringObject("right",5);
shared.pxat = createStringObject("PXAT", 4);
shared.px = createStringObject("PX",2);
shared.time = createStringObject("TIME",4);
shared.retrycount = createStringObject("RETRYCOUNT",10);
shared.force = createStringObject("FORCE",5);
shared.justid = createStringObject("JUSTID",6);
shared.lastid = createStringObject("LASTID",6);
shared.default_username = createStringObject("default",7);
shared.ping = createStringObject("ping",4);
shared.setid = createStringObject("SETID",5);
shared.keepttl = createStringObject("KEEPTTL",7);
shared.load = createStringObject("LOAD",4);
shared.createconsumer = createStringObject("CREATECONSUMER",14);
shared.getack = createStringObject("GETACK",6);
shared.special_asterick = createStringObject("*",1);
shared.special_equals = createStringObject("=",1);
shared.redacted = makeObjectShared(createStringObject("(redacted)",10));
>>>>>>> 6.2.6:src/server.c
for (j = 0; j < OBJ_SHARED_INTEGERS; j++) { for (j = 0; j < OBJ_SHARED_INTEGERS; j++) {
shared.integers[j] = shared.integers[j] =
@ -3002,7 +2968,6 @@ void initServerConfig(void) {
/* By default we want scripts to be always replicated by effects /* By default we want scripts to be always replicated by effects
* (single commands executed by the script), and not by sending the * (single commands executed by the script), and not by sending the
<<<<<<< HEAD:src/server.cpp
* script to the replica / AOF. This is the new way starting from * script to the replica / AOF. This is the new way starting from
* Redis 5. However it is possible to revert it via keydb.conf. */ * Redis 5. However it is possible to revert it via keydb.conf. */
g_pserver->lua_always_replicate_commands = 1; g_pserver->lua_always_replicate_commands = 1;
@ -3011,16 +2976,10 @@ void initServerConfig(void) {
cserver.cthreads = CONFIG_DEFAULT_THREADS; cserver.cthreads = CONFIG_DEFAULT_THREADS;
cserver.fThreadAffinity = CONFIG_DEFAULT_THREAD_AFFINITY; cserver.fThreadAffinity = CONFIG_DEFAULT_THREAD_AFFINITY;
cserver.threadAffinityOffset = 0; cserver.threadAffinityOffset = 0;
=======
* script to the slave / AOF. This is the new way starting from
* Redis 5. However it is possible to revert it via redis.conf. */
server.lua_always_replicate_commands = 1;
/* Client Pause related */ /* Client Pause related */
server.client_pause_type = CLIENT_PAUSE_OFF; g_pserver->client_pause_type = CLIENT_PAUSE_OFF;
server.client_pause_end_time = 0; g_pserver->client_pause_end_time = 0;
>>>>>>> 6.2.6:src/server.c
initConfigValues(); initConfigValues();
} }
@ -4029,18 +3988,6 @@ void call(client *c, int flags) {
serverAssert(GlobalLocksAcquired()); serverAssert(GlobalLocksAcquired());
static long long prev_err_count; static long long prev_err_count;
<<<<<<< HEAD:src/server.cpp
serverTL->fixed_time_expire++;
/* Send the command to clients in MONITOR mode if applicable.
* Administrative commands are considered too dangerous to be shown. */
if (listLength(g_pserver->monitors) &&
!g_pserver->loading.load(std::memory_order_relaxed) &&
!(c->cmd->flags & (CMD_SKIP_MONITOR|CMD_ADMIN)))
{
replicationFeedMonitors(c,g_pserver->monitors,c->db->id,c->argv,c->argc);
}
/* We need to transfer async writes before a client's repl state gets changed. Otherwise /* We need to transfer async writes before a client's repl state gets changed. Otherwise
we won't be able to propogate them correctly. */ we won't be able to propogate them correctly. */
if (c->cmd->flags & CMD_CATEGORY_REPLICATION) { if (c->cmd->flags & CMD_CATEGORY_REPLICATION) {
@ -4048,8 +3995,6 @@ void call(client *c, int flags) {
ProcessPendingAsyncWrites(); ProcessPendingAsyncWrites();
} }
=======
>>>>>>> 6.2.6:src/server.c
/* Initialization: clear the flags that must be set by the command on /* Initialization: clear the flags that must be set by the command on
* demand, and initialize the array for additional commands propagation. */ * demand, and initialize the array for additional commands propagation. */
c->flags &= ~(CLIENT_FORCE_AOF|CLIENT_FORCE_REPL|CLIENT_PREVENT_PROP); c->flags &= ~(CLIENT_FORCE_AOF|CLIENT_FORCE_REPL|CLIENT_PREVENT_PROP);
@ -4057,22 +4002,15 @@ void call(client *c, int flags) {
redisOpArrayInit(&g_pserver->also_propagate); redisOpArrayInit(&g_pserver->also_propagate);
/* Call the command. */ /* Call the command. */
<<<<<<< HEAD:src/server.cpp
dirty = g_pserver->dirty; dirty = g_pserver->dirty;
prev_err_count = g_pserver->stat_total_error_replies; prev_err_count = g_pserver->stat_total_error_replies;
updateCachedTime(0);
incrementMvccTstamp();
=======
dirty = server.dirty;
prev_err_count = server.stat_total_error_replies;
/* Update cache time, in case we have nested calls we want to /* Update cache time, in case we have nested calls we want to
* update only on the first call*/ * update only on the first call*/
if (server.fixed_time_expire++ == 0) { if (g_pserver->fixed_time_expire++ == 0) {
updateCachedTime(0); updateCachedTime(0);
} }
incrementMvccTstamp();
>>>>>>> 6.2.6:src/server.c
elapsedStart(&call_timer); elapsedStart(&call_timer);
try { try {
c->cmd->proc(c); c->cmd->proc(c);
@ -4142,7 +4080,7 @@ void call(client *c, int flags) {
if (!(c->cmd->flags & (CMD_SKIP_MONITOR|CMD_ADMIN))) { if (!(c->cmd->flags & (CMD_SKIP_MONITOR|CMD_ADMIN))) {
robj **argv = c->original_argv ? c->original_argv : c->argv; robj **argv = c->original_argv ? c->original_argv : c->argv;
int argc = c->original_argv ? c->original_argc : c->argc; int argc = c->original_argv ? c->original_argc : c->argc;
replicationFeedMonitors(c,server.monitors,c->db->id,argv,argc); replicationFeedMonitors(c,g_pserver->monitors,c->db->id,argv,argc);
} }
/* Clear the original argv. /* Clear the original argv.
@ -5500,7 +5438,6 @@ sds genRedisInfoString(const char *section) {
info = sdscatprintf(info, info = sdscatprintf(info,
"# Replication\r\n" "# Replication\r\n"
"role:%s\r\n", "role:%s\r\n",
<<<<<<< HEAD:src/server.cpp
listLength(g_pserver->masters) == 0 ? "master" listLength(g_pserver->masters) == 0 ? "master"
: g_pserver->fActiveReplica ? "active-replica" : "slave"); : g_pserver->fActiveReplica ? "active-replica" : "slave");
if (listLength(g_pserver->masters)) { if (listLength(g_pserver->masters)) {
@ -5514,46 +5451,17 @@ sds genRedisInfoString(const char *section) {
while ((ln = listNext(&li))) while ((ln = listNext(&li)))
{ {
long long slave_repl_offset = 1; long long slave_repl_offset = 1;
long long slave_read_repl_offset = 1;
redisMaster *mi = (redisMaster*)listNodeValue(ln); redisMaster *mi = (redisMaster*)listNodeValue(ln);
if (mi->master) if (mi->master){
slave_repl_offset = mi->master->reploff; slave_repl_offset = mi->master->reploff;
else if (mi->cached_master) slave_read_repl_offset = mi->master->read_reploff;
} else if (mi->cached_master){
slave_repl_offset = mi->cached_master->reploff; slave_repl_offset = mi->cached_master->reploff;
======= slave_read_repl_offset = mi->cached_master->read_reploff;
server.masterhost == NULL ? "master" : "slave");
if (server.masterhost) {
long long slave_repl_offset = 1;
long long slave_read_repl_offset = 1;
if (server.master) {
slave_repl_offset = server.master->reploff;
slave_read_repl_offset = server.master->read_reploff;
} else if (server.cached_master) {
slave_repl_offset = server.cached_master->reploff;
slave_read_repl_offset = server.cached_master->read_reploff;
} }
info = sdscatprintf(info,
"master_host:%s\r\n"
"master_port:%d\r\n"
"master_link_status:%s\r\n"
"master_last_io_seconds_ago:%d\r\n"
"master_sync_in_progress:%d\r\n"
"slave_read_repl_offset:%lld\r\n"
"slave_repl_offset:%lld\r\n"
,server.masterhost,
server.masterport,
(server.repl_state == REPL_STATE_CONNECTED) ?
"up" : "down",
server.master ?
((int)(server.unixtime-server.master->lastinteraction)) : -1,
server.repl_state == REPL_STATE_TRANSFER,
slave_read_repl_offset,
slave_repl_offset
);
>>>>>>> 6.2.6:src/server.c
char master_prefix[128] = ""; char master_prefix[128] = "";
if (cmasters != 0) { if (cmasters != 0) {
snprintf(master_prefix, sizeof(master_prefix), "_%d", cmasters); snprintf(master_prefix, sizeof(master_prefix), "_%d", cmasters);
@ -5565,6 +5473,7 @@ sds genRedisInfoString(const char *section) {
"master%s_link_status:%s\r\n" "master%s_link_status:%s\r\n"
"master%s_last_io_seconds_ago:%d\r\n" "master%s_last_io_seconds_ago:%d\r\n"
"master%s_sync_in_progress:%d\r\n" "master%s_sync_in_progress:%d\r\n"
"slave_read_repl_offset:%lld\r\n"
"slave_repl_offset:%lld\r\n" "slave_repl_offset:%lld\r\n"
,master_prefix, mi->masterhost, ,master_prefix, mi->masterhost,
master_prefix, mi->masterport, master_prefix, mi->masterport,
@ -5573,6 +5482,7 @@ sds genRedisInfoString(const char *section) {
master_prefix, mi->master ? master_prefix, mi->master ?
((int)(g_pserver->unixtime-mi->master->lastinteraction)) : -1, ((int)(g_pserver->unixtime-mi->master->lastinteraction)) : -1,
master_prefix, mi->repl_state == REPL_STATE_TRANSFER, master_prefix, mi->repl_state == REPL_STATE_TRANSFER,
slave_read_repl_offset,
slave_repl_offset slave_repl_offset
); );

View File

@ -471,11 +471,7 @@ extern int configOOMScoreAdjValuesDefaults[CONFIG_OOM_COUNT];
and AOF client */ and AOF client */
#define CLIENT_REPL_RDBONLY (1ULL<<42) /* This client is a replica that only wants #define CLIENT_REPL_RDBONLY (1ULL<<42) /* This client is a replica that only wants
RDB without replication buffer. */ RDB without replication buffer. */
<<<<<<< HEAD
#define CLIENT_PREVENT_LOGGING (1ULL<<43) /* Prevent logging of command to slowlog */
#define CLIENT_FORCE_REPLY (1ULL<<44) /* Should addReply be forced to write the text? */ #define CLIENT_FORCE_REPLY (1ULL<<44) /* Should addReply be forced to write the text? */
=======
>>>>>>> 6.2.6
/* Client block type (btype field in client structure) /* Client block type (btype field in client structure)
* if CLIENT_BLOCKED flag is set. */ * if CLIENT_BLOCKED flag is set. */
@ -1288,14 +1284,9 @@ struct sharedObjectsStruct {
*emptyscan, *multi, *exec, *left, *right, *hset, *srem, *xgroup, *xclaim, *emptyscan, *multi, *exec, *left, *right, *hset, *srem, *xgroup, *xclaim,
*script, *replconf, *eval, *persist, *set, *pexpireat, *pexpire, *script, *replconf, *eval, *persist, *set, *pexpireat, *pexpire,
*time, *pxat, *px, *retrycount, *force, *justid, *time, *pxat, *px, *retrycount, *force, *justid,
<<<<<<< HEAD
*lastid, *ping, *replping, *setid, *keepttl, *load, *createconsumer, *lastid, *ping, *replping, *setid, *keepttl, *load, *createconsumer,
*getack, *special_asterick, *special_equals, *default_username, *getack, *special_asterick, *special_equals, *default_username,
*hdel, *zrem, *mvccrestore, *pexpirememberat, *hdel, *zrem, *mvccrestore, *pexpirememberat, *redacted,
=======
*lastid, *ping, *setid, *keepttl, *load, *createconsumer,
*getack, *special_asterick, *special_equals, *default_username, *redacted,
>>>>>>> 6.2.6
*select[PROTO_SHARED_SELECT_CMDS], *select[PROTO_SHARED_SELECT_CMDS],
*integers[OBJ_SHARED_INTEGERS], *integers[OBJ_SHARED_INTEGERS],
*mbulkhdr[OBJ_SHARED_BULKHDR_LEN], /* "*<value>\r\n" */ *mbulkhdr[OBJ_SHARED_BULKHDR_LEN], /* "*<value>\r\n" */
@ -2189,15 +2180,9 @@ extern "C" void getRandomHexChars(char *p, size_t len);
extern "C" void getRandomBytes(unsigned char *p, size_t len); extern "C" void getRandomBytes(unsigned char *p, size_t len);
uint64_t crc64(uint64_t crc, const unsigned char *s, uint64_t l); uint64_t crc64(uint64_t crc, const unsigned char *s, uint64_t l);
void exitFromChild(int retcode); void exitFromChild(int retcode);
<<<<<<< HEAD long long redisPopcount(const void *s, long count);
size_t redisPopcount(const void *s, long count);
int redisSetProcTitle(const char *title); int redisSetProcTitle(const char *title);
int validateProcTitleTemplate(const char *_template); int validateProcTitleTemplate(const char *_template);
=======
long long redisPopcount(void *s, long count);
int redisSetProcTitle(char *title);
int validateProcTitleTemplate(const char *template);
>>>>>>> 6.2.6
int redisCommunicateSystemd(const char *sd_notify_msg); int redisCommunicateSystemd(const char *sd_notify_msg);
void redisSetCpuAffinity(const char *cpulist); void redisSetCpuAffinity(const char *cpulist);
@ -2271,13 +2256,8 @@ void rewriteClientCommandArgument(client *c, int i, robj *newval);
void replaceClientCommandVector(client *c, int argc, robj **argv); void replaceClientCommandVector(client *c, int argc, robj **argv);
void redactClientCommandArgument(client *c, int argc); void redactClientCommandArgument(client *c, int argc);
unsigned long getClientOutputBufferMemoryUsage(client *c); unsigned long getClientOutputBufferMemoryUsage(client *c);
<<<<<<< HEAD
int freeClientsInAsyncFreeQueue(int iel); int freeClientsInAsyncFreeQueue(int iel);
void asyncCloseClientOnOutputBufferLimitReached(client *c);
=======
int freeClientsInAsyncFreeQueue(void);
int closeClientOnOutputBufferLimitReached(client *c, int async); int closeClientOnOutputBufferLimitReached(client *c, int async);
>>>>>>> 6.2.6
int getClientType(client *c); int getClientType(client *c);
int getClientTypeByName(const char *name); int getClientTypeByName(const char *name);
const char *getClientTypeName(int cclass); const char *getClientTypeName(int cclass);
@ -2592,13 +2572,8 @@ unsigned char *zzlFirstInRange(unsigned char *zl, zrangespec *range);
unsigned char *zzlLastInRange(unsigned char *zl, zrangespec *range); unsigned char *zzlLastInRange(unsigned char *zl, zrangespec *range);
unsigned long zsetLength(robj_roptr zobj); unsigned long zsetLength(robj_roptr zobj);
void zsetConvert(robj *zobj, int encoding); void zsetConvert(robj *zobj, int encoding);
<<<<<<< HEAD
void zsetConvertToZiplistIfNeeded(robj *zobj, size_t maxelelen);
int zsetScore(robj_roptr zobj, sds member, double *score);
=======
void zsetConvertToZiplistIfNeeded(robj *zobj, size_t maxelelen, size_t totelelen); void zsetConvertToZiplistIfNeeded(robj *zobj, size_t maxelelen, size_t totelelen);
int zsetScore(robj *zobj, sds member, double *score); int zsetScore(robj_roptr zobj, sds member, double *score);
>>>>>>> 6.2.6
unsigned long zslGetRank(zskiplist *zsl, double score, sds o); unsigned long zslGetRank(zskiplist *zsl, double score, sds o);
int zsetAdd(robj *zobj, double score, sds ele, int in_flags, int *out_flags, double *newscore); int zsetAdd(robj *zobj, double score, sds ele, int in_flags, int *out_flags, double *newscore);
long zsetRank(robj_roptr zobj, sds ele, int reverse); long zsetRank(robj_roptr zobj, sds ele, int reverse);
@ -2745,16 +2720,12 @@ void initConfigValues();
/* db.c -- Keyspace access API */ /* db.c -- Keyspace access API */
int removeExpire(redisDb *db, robj *key); int removeExpire(redisDb *db, robj *key);
<<<<<<< HEAD
int removeExpireCore(redisDb *db, robj *key, dictEntry *de); int removeExpireCore(redisDb *db, robj *key, dictEntry *de);
int removeSubkeyExpire(redisDb *db, robj *key, robj *subkey); int removeSubkeyExpire(redisDb *db, robj *key, robj *subkey);
void propagateExpire(redisDb *db, robj *key, int lazy); void propagateExpire(redisDb *db, robj *key, int lazy);
void propagateSubkeyExpire(redisDb *db, int type, robj *key, robj *subkey); void propagateSubkeyExpire(redisDb *db, int type, robj *key, robj *subkey);
=======
void deleteExpiredKeyAndPropagate(redisDb *db, robj *keyobj); void deleteExpiredKeyAndPropagate(redisDb *db, robj *keyobj);
void propagateExpire(redisDb *db, robj *key, int lazy);
int keyIsExpired(redisDb *db, robj *key); int keyIsExpired(redisDb *db, robj *key);
>>>>>>> 6.2.6
int expireIfNeeded(redisDb *db, robj *key); int expireIfNeeded(redisDb *db, robj *key);
expireEntry *getExpire(redisDb *db, robj_roptr key); expireEntry *getExpire(redisDb *db, robj_roptr key);
void setExpire(client *c, redisDb *db, robj *key, robj *subkey, long long when); void setExpire(client *c, redisDb *db, robj *key, robj *subkey, long long when);
@ -2766,14 +2737,9 @@ robj_roptr lookupKeyReadOrReply(client *c, robj *key, robj *reply);
robj *lookupKeyWriteOrReply(client *c, robj *key, robj *reply); robj *lookupKeyWriteOrReply(client *c, robj *key, robj *reply);
robj_roptr lookupKeyReadWithFlags(redisDb *db, robj *key, int flags); robj_roptr lookupKeyReadWithFlags(redisDb *db, robj *key, int flags);
robj *lookupKeyWriteWithFlags(redisDb *db, robj *key, int flags); robj *lookupKeyWriteWithFlags(redisDb *db, robj *key, int flags);
<<<<<<< HEAD
robj_roptr objectCommandLookup(client *c, robj *key); robj_roptr objectCommandLookup(client *c, robj *key);
robj_roptr objectCommandLookupOrReply(client *c, robj *key, robj *reply); robj_roptr objectCommandLookupOrReply(client *c, robj *key, robj *reply);
=======
robj *objectCommandLookup(client *c, robj *key);
robj *objectCommandLookupOrReply(client *c, robj *key, robj *reply);
void SentReplyOnKeyMiss(client *c, robj *reply); void SentReplyOnKeyMiss(client *c, robj *reply);
>>>>>>> 6.2.6
int objectSetLRUOrLFU(robj *val, long long lfu_freq, long long lru_idle, int objectSetLRUOrLFU(robj *val, long long lfu_freq, long long lru_idle,
long long lru_clock, int lru_multiplier); long long lru_clock, int lru_multiplier);
#define LOOKUP_NONE 0 #define LOOKUP_NONE 0

View File

@ -44,22 +44,16 @@ void hashTypeTryConversion(robj *o, robj **argv, int start, int end) {
if (o->encoding != OBJ_ENCODING_ZIPLIST) return; if (o->encoding != OBJ_ENCODING_ZIPLIST) return;
for (i = start; i <= end; i++) { for (i = start; i <= end; i++) {
<<<<<<< HEAD:src/t_hash.cpp
if (sdsEncodedObject(argv[i]) &&
sdslen(szFromObj(argv[i])) > g_pserver->hash_max_ziplist_value)
{
=======
if (!sdsEncodedObject(argv[i])) if (!sdsEncodedObject(argv[i]))
continue; continue;
size_t len = sdslen(argv[i]->ptr); size_t len = sdslen(szFromObj(argv[i]));
if (len > server.hash_max_ziplist_value) { if (len > g_pserver->hash_max_ziplist_value) {
>>>>>>> 6.2.6:src/t_hash.c
hashTypeConvert(o, OBJ_ENCODING_HT); hashTypeConvert(o, OBJ_ENCODING_HT);
return; return;
} }
sum += len; sum += len;
} }
if (!ziplistSafeToAdd(o->ptr, sum)) if (!ziplistSafeToAdd((unsigned char *)ptrFromObj(o), sum))
hashTypeConvert(o, OBJ_ENCODING_HT); hashTypeConvert(o, OBJ_ENCODING_HT);
} }
@ -1026,13 +1020,8 @@ void hrandfieldWithCountCommand(client *c, long l, int withvalues) {
int uniq = 1; int uniq = 1;
robj_roptr hash; robj_roptr hash;
<<<<<<< HEAD:src/t_hash.cpp
if ((hash = lookupKeyReadOrReply(c,c->argv[1],shared.null[c->resp]))
== nullptr || checkType(c,hash,OBJ_HASH)) return;
=======
if ((hash = lookupKeyReadOrReply(c,c->argv[1],shared.emptyarray)) if ((hash = lookupKeyReadOrReply(c,c->argv[1],shared.emptyarray))
== NULL || checkType(c,hash,OBJ_HASH)) return; == nullptr || checkType(c,hash,OBJ_HASH)) return;
>>>>>>> 6.2.6:src/t_hash.c
size = hashTypeLength(hash); size = hashTypeLength(hash);
if(l >= 0) { if(l >= 0) {

View File

@ -227,7 +227,7 @@ void pushGenericCommand(client *c, int where, int xx) {
int j; int j;
for (j = 2; j < c->argc; j++) { for (j = 2; j < c->argc; j++) {
if (sdslen(c->argv[j]->ptr) > LIST_MAX_ITEM_SIZE) { if (sdslen(szFromObj(c->argv[j])) > LIST_MAX_ITEM_SIZE) {
addReplyError(c, "Element too large"); addReplyError(c, "Element too large");
return; return;
} }
@ -296,7 +296,7 @@ void linsertCommand(client *c) {
return; return;
} }
if (sdslen(c->argv[4]->ptr) > LIST_MAX_ITEM_SIZE) { if (sdslen(szFromObj(c->argv[4])) > LIST_MAX_ITEM_SIZE) {
addReplyError(c, "Element too large"); addReplyError(c, "Element too large");
return; return;
} }
@ -368,7 +368,7 @@ void lsetCommand(client *c) {
long index; long index;
robj *value = c->argv[3]; robj *value = c->argv[3];
if (sdslen(value->ptr) > LIST_MAX_ITEM_SIZE) { if (sdslen(szFromObj(value)) > LIST_MAX_ITEM_SIZE) {
addReplyError(c, "Element too large"); addReplyError(c, "Element too large");
return; return;
} }
@ -595,7 +595,7 @@ void lposCommand(client *c) {
int direction = LIST_TAIL; int direction = LIST_TAIL;
long rank = 1, count = -1, maxlen = 0; /* Count -1: option not given. */ long rank = 1, count = -1, maxlen = 0; /* Count -1: option not given. */
if (sdslen(ele->ptr) > LIST_MAX_ITEM_SIZE) { if (sdslen(szFromObj(ele)) > LIST_MAX_ITEM_SIZE) {
addReplyError(c, "Element too large"); addReplyError(c, "Element too large");
return; return;
} }
@ -695,7 +695,7 @@ void lremCommand(client *c) {
long toremove; long toremove;
long removed = 0; long removed = 0;
if (sdslen(obj->ptr) > LIST_MAX_ITEM_SIZE) { if (sdslen(szFromObj(obj)) > LIST_MAX_ITEM_SIZE) {
addReplyError(c, "Element too large"); addReplyError(c, "Element too large");
return; return;
} }

View File

@ -66,14 +66,10 @@ int setTypeAdd(robj *subject, const char *value) {
if (success) { if (success) {
/* Convert to regular set when the intset contains /* Convert to regular set when the intset contains
* too many entries. */ * too many entries. */
<<<<<<< HEAD:src/t_set.cpp size_t max_entries = g_pserver->set_max_intset_entries;
if (intsetLen((intset*)subject->m_ptr) > g_pserver->set_max_intset_entries)
=======
size_t max_entries = server.set_max_intset_entries;
/* limit to 1G entries due to intset internals. */ /* limit to 1G entries due to intset internals. */
if (max_entries >= 1<<30) max_entries = 1<<30; if (max_entries >= 1<<30) max_entries = 1<<30;
if (intsetLen(subject->ptr) > max_entries) if (intsetLen((intset*)subject->m_ptr) > max_entries)
>>>>>>> 6.2.6:src/t_set.c
setTypeConvert(subject,OBJ_ENCODING_HT); setTypeConvert(subject,OBJ_ENCODING_HT);
return 1; return 1;
} }
@ -404,21 +400,12 @@ void smoveCommand(client *c) {
} }
signalModifiedKey(c,c->db,c->argv[1]); signalModifiedKey(c,c->db,c->argv[1]);
<<<<<<< HEAD:src/t_set.cpp
signalModifiedKey(c,c->db,c->argv[2]);
g_pserver->dirty++; g_pserver->dirty++;
/* An extra key has changed when ele was successfully added to dstset */ /* An extra key has changed when ele was successfully added to dstset */
if (setTypeAdd(dstset,szFromObj(ele))) { if (setTypeAdd(dstset,szFromObj(ele))) {
g_pserver->dirty++; g_pserver->dirty++;
=======
server.dirty++;
/* An extra key has changed when ele was successfully added to dstset */
if (setTypeAdd(dstset,ele->ptr)) {
server.dirty++;
signalModifiedKey(c,c->db,c->argv[2]); signalModifiedKey(c,c->db,c->argv[2]);
>>>>>>> 6.2.6:src/t_set.c
notifyKeyspaceEvent(NOTIFY_SET,"sadd",c->argv[2],c->db->id); notifyKeyspaceEvent(NOTIFY_SET,"sadd",c->argv[2],c->db->id);
} }
addReply(c,shared.cone); addReply(c,shared.cone);
@ -886,24 +873,10 @@ void sinterGenericCommand(client *c, robj **setkeys,
lookupKeyWrite(c->db,setkeys[j]) : lookupKeyWrite(c->db,setkeys[j]) :
lookupKeyRead(c->db,setkeys[j]).unsafe_robjcast(); lookupKeyRead(c->db,setkeys[j]).unsafe_robjcast();
if (!setobj) { if (!setobj) {
<<<<<<< HEAD:src/t_set.cpp
zfree(sets);
if (dstkey) {
if (dbDelete(c->db,dstkey)) {
signalModifiedKey(c,c->db,dstkey);
g_pserver->dirty++;
}
addReply(c,shared.czero);
} else {
addReply(c,shared.emptyset[c->resp]);
}
return;
=======
/* A NULL is considered an empty set */ /* A NULL is considered an empty set */
empty += 1; empty += 1;
sets[j] = NULL; sets[j] = NULL;
continue; continue;
>>>>>>> 6.2.6:src/t_set.c
} }
if (checkType(c,setobj,OBJ_SET)) { if (checkType(c,setobj,OBJ_SET)) {
zfree(sets); zfree(sets);
@ -920,7 +893,7 @@ void sinterGenericCommand(client *c, robj **setkeys,
if (dbDelete(c->db,dstkey)) { if (dbDelete(c->db,dstkey)) {
signalModifiedKey(c,c->db,dstkey); signalModifiedKey(c,c->db,dstkey);
notifyKeyspaceEvent(NOTIFY_GENERIC,"del",dstkey,c->db->id); notifyKeyspaceEvent(NOTIFY_GENERIC,"del",dstkey,c->db->id);
server.dirty++; g_pserver->dirty++;
} }
addReply(c,shared.czero); addReply(c,shared.czero);
} else { } else {

View File

@ -468,7 +468,7 @@ int streamAppendItem(stream *s, robj **argv, int64_t numfields, streamID *added_
* can't be bigger than 32bit length. */ * can't be bigger than 32bit length. */
size_t totelelen = 0; size_t totelelen = 0;
for (int64_t i = 0; i < numfields*2; i++) { for (int64_t i = 0; i < numfields*2; i++) {
sds ele = argv[i]->ptr; sds ele = szFromObj(argv[i]);
totelelen += sdslen(ele); totelelen += sdslen(ele);
} }
if (totelelen > STREAM_LISTPACK_MAX_SIZE) { if (totelelen > STREAM_LISTPACK_MAX_SIZE) {
@ -533,16 +533,10 @@ int streamAppendItem(stream *s, robj **argv, int64_t numfields, streamID *added_
* if we need to switch to the next one. 'lp' will be set to NULL if * if we need to switch to the next one. 'lp' will be set to NULL if
* the current node is full. */ * the current node is full. */
if (lp != NULL) { if (lp != NULL) {
<<<<<<< HEAD:src/t_stream.cpp size_t node_max_bytes = g_pserver->stream_node_max_bytes;
if (g_pserver->stream_node_max_bytes &&
lp_bytes >= g_pserver->stream_node_max_bytes)
{
=======
size_t node_max_bytes = server.stream_node_max_bytes;
if (node_max_bytes == 0 || node_max_bytes > STREAM_LISTPACK_MAX_SIZE) if (node_max_bytes == 0 || node_max_bytes > STREAM_LISTPACK_MAX_SIZE)
node_max_bytes = STREAM_LISTPACK_MAX_SIZE; node_max_bytes = STREAM_LISTPACK_MAX_SIZE;
if (lp_bytes + totelelen >= node_max_bytes) { if (lp_bytes + totelelen >= node_max_bytes) {
>>>>>>> 6.2.6:src/t_stream.c
lp = NULL; lp = NULL;
} else if (g_pserver->stream_node_max_entries) { } else if (g_pserver->stream_node_max_entries) {
unsigned char *lp_ele = lpFirst(lp); unsigned char *lp_ele = lpFirst(lp);

View File

@ -800,17 +800,14 @@ void stralgoLCS(client *c) {
goto cleanup; goto cleanup;
} }
<<<<<<< HEAD:src/t_string.cpp
{ // Scope variables below for the goto { // Scope variables below for the goto
=======
/* Detect string truncation or later overflows. */ /* Detect string truncation or later overflows. */
if (sdslen(a) >= UINT32_MAX-1 || sdslen(b) >= UINT32_MAX-1) { if (sdslen(a) >= UINT32_MAX-1 || sdslen(b) >= UINT32_MAX-1) {
addReplyError(c, "String too long for LCS"); addReplyError(c, "String too long for LCS");
goto cleanup; goto cleanup;
} }
>>>>>>> 6.2.6:src/t_string.c
/* Compute the LCS using the vanilla dynamic programming technique of /* Compute the LCS using the vanilla dynamic programming technique of
* building a table of LCS(x,y) substrings. */ * building a table of LCS(x,y) substrings. */
uint32_t alen = sdslen(a); uint32_t alen = sdslen(a);
@ -819,10 +816,6 @@ void stralgoLCS(client *c) {
/* Setup an uint32_t array to store at LCS[i,j] the length of the /* Setup an uint32_t array to store at LCS[i,j] the length of the
* LCS A0..i-1, B0..j-1. Note that we have a linear array here, so * LCS A0..i-1, B0..j-1. Note that we have a linear array here, so
* we index it as LCS[j+(blen+1)*j] */ * we index it as LCS[j+(blen+1)*j] */
<<<<<<< HEAD:src/t_string.cpp
uint32_t *lcs = (uint32_t*)zmalloc((size_t)(alen+1)*(blen+1)*sizeof(uint32_t));
=======
>>>>>>> 6.2.6:src/t_string.c
#define LCS(A,B) lcs[(B)+((A)*(blen+1))] #define LCS(A,B) lcs[(B)+((A)*(blen+1))]
/* Try to allocate the LCS table, and abort on overflow or insufficient memory. */ /* Try to allocate the LCS table, and abort on overflow or insufficient memory. */
@ -830,7 +823,7 @@ void stralgoLCS(client *c) {
unsigned long long lcsalloc = lcssize * sizeof(uint32_t); unsigned long long lcsalloc = lcssize * sizeof(uint32_t);
uint32_t *lcs = NULL; uint32_t *lcs = NULL;
if (lcsalloc < SIZE_MAX && lcsalloc / lcssize == sizeof(uint32_t)) if (lcsalloc < SIZE_MAX && lcsalloc / lcssize == sizeof(uint32_t))
lcs = ztrymalloc(lcsalloc); lcs = (uint32_t *)ztrymalloc(lcsalloc);
if (!lcs) { if (!lcs) {
addReplyError(c, "Insufficient memory"); addReplyError(c, "Insufficient memory");
goto cleanup; goto cleanup;

View File

@ -1248,18 +1248,10 @@ void zsetConvertToZiplistIfNeeded(robj *zobj, size_t maxelelen, size_t totelelen
if (zobj->encoding == OBJ_ENCODING_ZIPLIST) return; if (zobj->encoding == OBJ_ENCODING_ZIPLIST) return;
zset *set = (zset*)zobj->m_ptr; zset *set = (zset*)zobj->m_ptr;
<<<<<<< HEAD:src/t_zset.cpp
if (set->zsl->length <= g_pserver->zset_max_ziplist_entries && if (set->zsl->length <= g_pserver->zset_max_ziplist_entries &&
maxelelen <= g_pserver->zset_max_ziplist_value) maxelelen <= g_pserver->zset_max_ziplist_value &&
zsetConvert(zobj,OBJ_ENCODING_ZIPLIST);
=======
if (zset->zsl->length <= server.zset_max_ziplist_entries &&
maxelelen <= server.zset_max_ziplist_value &&
ziplistSafeToAdd(NULL, totelelen)) ziplistSafeToAdd(NULL, totelelen))
{
zsetConvert(zobj,OBJ_ENCODING_ZIPLIST); zsetConvert(zobj,OBJ_ENCODING_ZIPLIST);
}
>>>>>>> 6.2.6:src/t_zset.c
} }
/* Return (by reference) the score of the specified member of the sorted set /* Return (by reference) the score of the specified member of the sorted set
@ -1381,19 +1373,13 @@ int zsetAdd(robj *zobj, double score, sds ele, int in_flags, int *out_flags, dou
} else if (!xx) { } else if (!xx) {
/* check if the element is too large or the list /* check if the element is too large or the list
* becomes too long *before* executing zzlInsert. */ * becomes too long *before* executing zzlInsert. */
<<<<<<< HEAD:src/t_zset.cpp if (zzlLength((unsigned char*)ptrFromObj(zobj))+1 > g_pserver->zset_max_ziplist_entries ||
zobj->m_ptr = zzlInsert((unsigned char*)zobj->m_ptr,ele,score); sdslen(ele) > g_pserver->zset_max_ziplist_value ||
if (zzlLength((unsigned char*)zobj->m_ptr) > g_pserver->zset_max_ziplist_entries || !ziplistSafeToAdd((unsigned char *)ptrFromObj(zobj), sdslen(ele)))
sdslen(ele) > g_pserver->zset_max_ziplist_value)
=======
if (zzlLength(zobj->ptr)+1 > server.zset_max_ziplist_entries ||
sdslen(ele) > server.zset_max_ziplist_value ||
!ziplistSafeToAdd(zobj->ptr, sdslen(ele)))
{ {
>>>>>>> 6.2.6:src/t_zset.c
zsetConvert(zobj,OBJ_ENCODING_SKIPLIST); zsetConvert(zobj,OBJ_ENCODING_SKIPLIST);
} else { } else {
zobj->ptr = zzlInsert(zobj->ptr,ele,score); zobj->m_ptr = zzlInsert((unsigned char *)ptrFromObj(zobj),ele,score);
if (newscore) *newscore = score; if (newscore) *newscore = score;
*out_flags |= ZADD_OUT_ADDED; *out_flags |= ZADD_OUT_ADDED;
return 1; return 1;
@ -1402,17 +1388,12 @@ int zsetAdd(robj *zobj, double score, sds ele, int in_flags, int *out_flags, dou
*out_flags |= ZADD_OUT_NOP; *out_flags |= ZADD_OUT_NOP;
return 1; return 1;
} }
<<<<<<< HEAD:src/t_zset.cpp
} else if (zobj->encoding == OBJ_ENCODING_SKIPLIST) {
zset *zs = (zset*)zobj->m_ptr;
=======
} }
/* Note that the above block handling ziplist would have either returned or /* Note that the above block handling ziplist would have either returned or
* converted the key to skiplist. */ * converted the key to skiplist. */
if (zobj->encoding == OBJ_ENCODING_SKIPLIST) { if (zobj->encoding == OBJ_ENCODING_SKIPLIST) {
zset *zs = zobj->ptr; zset *zs = (zset*)zobj->m_ptr;
>>>>>>> 6.2.6:src/t_zset.c
zskiplistNode *znode; zskiplistNode *znode;
dictEntry *de; dictEntry *de;
@ -3694,18 +3675,13 @@ void zrangeGenericCommand(zrange_result_handler *handler, int argc_start, int st
zobj = handler->dstkey ? zobj = handler->dstkey ?
lookupKeyWrite(c->db,key) : lookupKeyWrite(c->db,key) :
lookupKeyRead(c->db,key); lookupKeyRead(c->db,key);
<<<<<<< HEAD:src/t_zset.cpp
if (zobj == nullptr) { if (zobj == nullptr) {
addReply(c,shared.emptyarray);
=======
if (zobj == NULL) {
if (store) { if (store) {
handler->beginResultEmission(handler); handler->beginResultEmission(handler);
handler->finalizeResultEmission(handler, 0); handler->finalizeResultEmission(handler, 0);
} else { } else {
addReply(c, shared.emptyarray); addReply(c, shared.emptyarray);
} }
>>>>>>> 6.2.6:src/t_zset.c
goto cleanup; goto cleanup;
} }
@ -3913,13 +3889,8 @@ void genericZpopCommand(client *c, robj **keyv, int keyc, int where, int emitkey
serverAssertWithInfo(c,zobj,zsetDel(zobj,ele)); serverAssertWithInfo(c,zobj,zsetDel(zobj,ele));
g_pserver->dirty++; g_pserver->dirty++;
<<<<<<< HEAD:src/t_zset.cpp
if (arraylen == 0) { /* Do this only for the first iteration. */
const char *events[2] = {"zpopmin","zpopmax"};
=======
if (result_count == 0) { /* Do this only for the first iteration. */ if (result_count == 0) { /* Do this only for the first iteration. */
char *events[2] = {"zpopmin","zpopmax"}; const char *events[2] = {"zpopmin","zpopmax"};
>>>>>>> 6.2.6:src/t_zset.c
notifyKeyspaceEvent(NOTIFY_ZSET,events[where],key,c->db->id); notifyKeyspaceEvent(NOTIFY_ZSET,events[where],key,c->db->id);
signalModifiedKey(c,c->db,key); signalModifiedKey(c,c->db,key);
} }
@ -4044,13 +4015,8 @@ void zrandmemberWithCountCommand(client *c, long l, int withscores) {
int uniq = 1; int uniq = 1;
robj_roptr zsetobj; robj_roptr zsetobj;
<<<<<<< HEAD:src/t_zset.cpp
if ((zsetobj = lookupKeyReadOrReply(c, c->argv[1], shared.null[c->resp]))
== nullptr || checkType(c, zsetobj, OBJ_ZSET)) return;
=======
if ((zsetobj = lookupKeyReadOrReply(c, c->argv[1], shared.emptyarray)) if ((zsetobj = lookupKeyReadOrReply(c, c->argv[1], shared.emptyarray))
== NULL || checkType(c, zsetobj, OBJ_ZSET)) return; == nullptr || checkType(c, zsetobj, OBJ_ZSET)) return;
>>>>>>> 6.2.6:src/t_zset.c
size = zsetLength(zsetobj); size = zsetLength(zsetobj);
if(l >= 0) { if(l >= 0) {

View File

@ -1,9 +1,4 @@
<<<<<<< HEAD
#define KEYDB_REAL_VERSION "255.255.255" #define KEYDB_REAL_VERSION "255.255.255"
#define KEYDB_VERSION_NUM 0x00ffffff #define KEYDB_VERSION_NUM 0x00ffffff
extern const char *KEYDB_SET_VERSION; // Unlike real version, this can be overriden by the config extern const char *KEYDB_SET_VERSION; // Unlike real version, this can be overriden by the config
=======
#define REDIS_VERSION "6.2.6"
#define REDIS_VERSION_NUM 0x00060206
>>>>>>> 6.2.6

View File

@ -720,14 +720,9 @@ unsigned char *ziplistNew(void) {
} }
/* Resize the ziplist. */ /* Resize the ziplist. */
<<<<<<< HEAD
unsigned char *ziplistResize(unsigned char *zl, unsigned int len) {
zl = zrealloc(zl,len, MALLOC_SHARED);
=======
unsigned char *ziplistResize(unsigned char *zl, size_t len) { unsigned char *ziplistResize(unsigned char *zl, size_t len) {
assert(len < UINT32_MAX); assert(len < UINT32_MAX);
zl = zrealloc(zl,len); zl = zrealloc(zl,len, MALLOC_SHARED);
>>>>>>> 6.2.6
ZIPLIST_BYTES(zl) = intrev32ifbe(len); ZIPLIST_BYTES(zl) = intrev32ifbe(len);
zl[len-1] = ZIP_END; zl[len-1] = ZIP_END;
return zl; return zl;