8000 forkless save by JimB123 · Pull Request #10 · JimB123/valkey · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ ENGINE_NAME=valkey
SERVER_NAME=$(ENGINE_NAME)-server$(PROG_SUFFIX)
ENGINE_SENTINEL_NAME=$(ENGINE_NAME)-sentinel$(PROG_SUFFIX)
ENGINE_TRACE_OBJ=trace/trace.o trace/trace_commands.o trace/trace_db.o trace/trace_cluster.o trace/trace_server.o trace/trace_rdb.o trace/trace_aof.o
ENGINE_SERVER_OBJ=threads_mngr.o adlist.o vector.o quicklist.o ae.o anet.o dict.o hashtable.o kvstore.o server.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o memory_prefetch.o io_threads.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o cluster_legacy.o cluster_slot_stats.o crc16.o cluster_migrateslots.o endianconv.o commandlog.o eval.o bio.o rio.o rand.o memtest.o syscheck.o crcspeed.o crccombine.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o valkey-check-rdb.o valkey-check-aof.o geo.o lazyfree.o module.o lrulfu.o evict.o expire.o geohash.o geohash_helper.o childinfo.o allocator_defrag.o defrag.o siphash.o rax.o t_stream.o listpack.o localtime.o lolwut.o lolwut5.o lolwut6.o lolwut9.o acl.o tracking.o socket.o tls.o sha256.o timeout.o setcpuaffinity.o monotonic.o mt19937-64.o resp_parser.o call_reply.o script.o functions.o commands.o strl.o connection.o unix.o logreqres.o rdma.o scripting_engine.o entry.o vset.o fifo.o mutexqueue.o
ENGINE_SERVER_OBJ=threads_mngr.o adlist.o vector.o quicklist.o ae.o anet.o dict.o hashtable.o kvstore.o server.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o memory_prefetch.o io_threads.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o cluster_legacy.o cluster_slot_stats.o crc16.o cluster_migrateslots.o endianconv.o commandlog.o eval.o bio.o rio.o rand.o memtest.o syscheck.o crcspeed.o crccombine.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o valkey-check-rdb.o valkey-check-aof.o geo.o lazyfree.o module.o lrulfu.o evict.o expire.o geohash.o geohash_helper.o childinfo.o allocator_defrag.o defrag.o siphash.o rax.o t_stream.o listpack.o localtime.o lolwut.o lolwut5.o lolwut6.o lolwut9.o acl.o tracking.o socket.o tls.o sha256.o timeout.o setcpuaffinity.o monotonic.o mt19937-64.o resp_parser.o call_reply.o script.o functions.o commands.o strl.o connection.o unix.o logreqres.o rdma.o scripting_engine.o entry.o vset.o fifo.o mutexqueue.o bgiteration.o bgiteration_temp.o
ENGINE_SERVER_OBJ+=$(ENGINE_TRACE_OBJ)
ENGINE_CLI_NAME=$(ENGINE_NAME)-cli$(PROG_SUFFIX)
ENGINE_CLI_OBJ=anet.o adlist.o dict.o valkey-cli.o zmalloc.o release.o ae.o serverassert.o crcspeed.o crccombine.o crc64.o siphash.o crc16.o monotonic.o cli_common.o mt19937-64.o strl.o cli_commands.o sds.o util.o sha256.o
Expand Down
2,743 changes: 2,743 additions & 0 deletions src/bgiteration.c

Large diffs are not rendered by default.

358 changes: 358 additions & 0 deletions src/bgiteration.h

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions src/bgiteration_temp.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

#include "server.h"

void amzUnblockClientsOnKey(void *info, robj *key) {
UNUSED(info);
UNUSED(key);
}

int amzBlockClientOnKeys(void *info, client *c, robj *keys[], int nKeys) {
UNUSED(info);
UNUSED(c);
UNUSED(keys);
UNUSED(nKeys);
return C_OK;
}
3 changes: 3 additions & 0 deletions src/db.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "module.h"
#include "vector.h"
#include "expire.h"
#include "bgiteration.h"

/*-----------------------------------------------------------------------------
* C-level DB API
Expand Down Expand Up @@ -475,6 +476,8 @@ int dbGenericDeleteWithDictIndex(serverDb *db, robj *key, int async, int flags,
hashtablePosition pos;
void **ref = kvstoreHashtableTwoPhasePopFindRef(db->keys, dict_index, objectGetVal(key), &pos);
if (ref != NULL) {
bgIteration_keyDelete(db->id, (sds)objectGetVal(key));

robj *val = *ref;
/* VM_StringDMA may call dbUnshareStringValue which may free val, so we
* need to incr to retain val */
Expand Down
10 changes: 5 additions & 5 deletions src/gtest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CXX ?= g++
AR ?= ar
SERVER_AR ?= $(AR)
-include ../.make-settings
OPT=-O3 -DNDEBUG
OPT=-Og -g
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')

# Add -m32 for 32bit builds
Expand Down Expand Up @@ -123,7 +123,7 @@ endif
cd ../../deps && $(MAKE) gtest

# Ensure Valkey server library is built
$(VALKEY_SERVER_LIB):
$(VALKEY_SERVER_LIB): $(patsubst %.o,%.c,$(ENGINE_SERVER_OBJ))
cd .. && $(MAKE) libvalkey.a

# Ensure parent prerequisites are built
Expand Down Expand Up @@ -184,13 +184,13 @@ valkey-unit-gtests: $(ALL_OBJECTS) generated_wrappers.o $(VALKEY_SERVER_WRAP_LIB
-lm -pthread -ldl
else
valkey-unit-gtests: $(ALL_OBJECTS) generated_wrappers.o $(VALKEY_SERVER_LIB) $(FINAL_LIBS)
$(CXX) -g \
-Wl,--allow-multiple-definition \
$(CXX) -g -fno-lto \
$(OVERRIDES) \
-Wall -Wno-deprecated-declarations \
-o $@ $^ $(LD_LIBS) \
-o $@ $(ALL_OBJECTS) $(VALKEY_SERVER_LIB) $(FINAL_LIBS) $(LD_LIBS) \
-lrt -lm -pthread -ldl -lgcov
endif
# -Wl,--allow-multiple-definition

.PHONY: all
all: valkey-unit-gtests
Expand Down
Loading
Loading
0