Skip to content
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .config/typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ optin = "optin"
smove = "smove"
Parth = "Parth" # seems like the spellchecker does not like it is similar to "Path"
nd = "nd"
Ba = "Ba"
Addd = "Addd"

[default]
extend-ignore-re = [
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/SourceFiles.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ set(VALKEY_SERVER_SRCS
${CMAKE_SOURCE_DIR}/src/t_list.c
${CMAKE_SOURCE_DIR}/src/t_set.c
${CMAKE_SOURCE_DIR}/src/t_zset.c
${CMAKE_SOURCE_DIR}/src/skiplist.c
${CMAKE_SOURCE_DIR}/src/fbtree.c
${CMAKE_SOURCE_DIR}/src/ordered_index.c
${CMAKE_SOURCE_DIR}/src/t_hash.c
${CMAKE_SOURCE_DIR}/src/config.c
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ ENGINE_SERVER_OBJ = \
t_stream.o \
t_string.o \
t_zset.o \
skiplist.o \
fbtree.o \
threads_mngr.o \
timeout.o \
tls.o \
Expand Down
2 changes: 1 addition & 1 deletion src/aof.c
Original file line number Diff line number Diff line change
Expand Up @@ -2021,7 +2021,7 @@ int rewriteSortedSetObject(rio *r, robj *key, robj *o) {
if (++count == AOF_REWRITE_ITEMS_PER_CMD) count = 0;
items--;
}
} else if (o->encoding == OBJ_ENCODING_SKIPLIST) {
} else if (o->encoding == OBJ_ENCODING_BTREE) {
zset *zs = objectGetVal(o);
hashtableIterator iter;
hashtableInitIterator(&iter, zs->ht, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/db.c
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@ void scanGenericCommandWithOptions(client *c, robj *o, unsigned long long cursor
} else if (o->type == OBJ_HASH && o->encoding == OBJ_ENCODING_HASHTABLE) {
ht = objectGetVal(o);
free_callback = NULL;
} else if (o->type == OBJ_ZSET && o->encoding == OBJ_ENCODING_SKIPLIST) {
} else if (o->type == OBJ_ZSET && o->encoding == OBJ_ENCODING_BTREE) {
zset *zs = objectGetVal(o);
ht = zs->ht;
/* scanning ZSET allocates temporary strings even though it's a dict */
Expand Down
6 changes: 3 additions & 3 deletions src/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ void xorObjectDigest(serverDb *db, robj *keyobj, unsigned char *digest, robj *o)
xorDigest(digest, eledigest, 20);
zzlNext(zl, &eptr, &sptr);
}
} else if (o->encoding == OBJ_ENCODING_SKIPLIST) {
} else if (o->encoding == OBJ_ENCODING_BTREE) {
zset *zs = objectGetVal(o);
hashtableIterator iter;
hashtableInitIterator(&iter, zs->ht, 0);
Expand Down Expand Up @@ -976,7 +976,7 @@ void debugCommand(client *c) {
/* Get the hashtable reference from the object, if possible. */
hashtable *ht = NULL;
switch (o->encoding) {
case OBJ_ENCODING_SKIPLIST: {
case OBJ_ENCODING_BTREE: {
zset *zs = objectGetVal(o);
ht = zs->ht;
} break;
Expand Down Expand Up @@ -1186,7 +1186,7 @@ void serverLogObjectDebugInfo(const robj *o) {
serverLog(LL_WARNING, "Hash size: %d", (int)hashTypeLength(o));
} else if (o->type == OBJ_ZSET) {
serverLog(LL_WARNING, "Sorted set size: %d", (int)zsetLength(o));
if (o->encoding == OBJ_ENCODING_SKIPLIST) {
if (o->encoding == OBJ_ENCODING_BTREE) {
/* Not declared in ordered_index.h — debug-only introspection. */
extern int orderedIndexGetHeight(const OrderedIndex *oi);
serverLog(LL_WARNING, "Index height: %d", orderedIndexGetHeight(((const zset *)o->ptr)->oi));
Expand Down
12 changes: 6 additions & 6 deletions src/defrag.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ static long scanLaterList(robj *ob, unsigned long *cursor, monotime endtime) {
}

static void scanLaterZset(robj *ob, unsigned long *cursor) {
serverAssert(ob->type == OBJ_ZSET && ob->encoding == OBJ_ENCODING_SKIPLIST);
serverAssert(ob->type == OBJ_ZSET && ob->encoding == OBJ_ENCODING_BTREE);
zset *zs = (zset *)objectGetVal(ob);
*cursor = orderedIndexScanDefrag(zs->oi, *cursor, defragZsetNodeCallback, zs->ht, activeDefragAlloc);
}
Expand Down Expand Up @@ -424,8 +424,8 @@ static void defragQuicklist(robj *ob) {
activeDefragQuickListNodes(ql);
}

static void defragZsetSkiplist(robj *ob) {
serverAssert(ob->type == OBJ_ZSET && ob->encoding == OBJ_ENCODING_SKIPLIST);
static void defragZset(robj *ob) {
serverAssert(ob->type == OBJ_ZSET && ob->encoding == OBJ_ENCODING_BTREE);
zset *zs = (zset *)objectGetVal(ob);

zset *newzs;
Expand Down Expand Up @@ -698,8 +698,8 @@ static void defragKey(defragKeysCtx *ctx, robj **elemref) {
} else if (ob->type == OBJ_ZSET) {
if (ob->encoding == OBJ_ENCODING_LISTPACK) {
if ((newzl = activeDefragAlloc(objectGetVal(ob)))) objectSetVal(ob, newzl);
} else if (ob->encoding == OBJ_ENCODING_SKIPLIST) {
defragZsetSkiplist(ob);
} else if (ob->encoding == OBJ_ENCODING_BTREE) {
defragZset(ob);
} else {
serverPanic("Unknown sorted set encoding");
}
Expand Down Expand Up @@ -767,7 +767,7 @@ static int defragLaterItem(robj *ob, unsigned long *cursor, monotime endtime, in
return scanLaterList(ob, cursor, endtime);
} else if (ob->type == OBJ_SET && ob->encoding == OBJ_ENCODING_HASHTABLE) {
scanLaterSet(ob, cursor);
} else if (ob->type == OBJ_ZSET && ob->encoding == OBJ_ENCODING_SKIPLIST) {
} else if (ob->type == OBJ_ZSET && ob->encoding == OBJ_ENCODING_BTREE) {
scanLaterZset(ob, cursor);
} else if (ob->type == OBJ_HASH && ob->encoding == OBJ_ENCODING_HASHTABLE) {
scanLaterHash(ob, cursor);
Expand Down
Loading
Loading