From 6283ca8a2c7c97e945ec230bac8c6d77f0d66736 Mon Sep 17 00:00:00 2001 From: John Sully Date: Fri, 27 Mar 2020 12:46:25 -0400 Subject: [PATCH 1/3] Raspberry Pi fixes (compile and replication) Former-commit-id: c3d3c82f3a1751f063a3e77b4bde47f1802a517e --- src/Makefile | 6 +++++- src/replication.cpp | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Makefile b/src/Makefile index 9ab3a8a72..91677a6dd 100644 --- a/src/Makefile +++ b/src/Makefile @@ -82,6 +82,10 @@ ifneq (,$(findstring armv,$(uname_M))) endif endif +ifneq (,$(findstring armv,$(uname_M))) + FINAL_LIBS+=-latomic +endif + # Backwards compatibility for selecting an allocator ifeq ($(USE_TCMALLOC),yes) MALLOC=tcmalloc @@ -105,7 +109,7 @@ endif FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS) FINAL_CXXFLAGS=$(CXX_STD) $(WARN) $(OPT) $(DEBUG) $(CXXFLAGS) $(REDIS_CFLAGS) FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG) -FINAL_LIBS=-lm -lcurl +FINAL_LIBS+=-lm -lcurl DEBUG=-g -ggdb ifeq ($(uname_S),SunOS) diff --git a/src/replication.cpp b/src/replication.cpp index 6f38ee0bc..dcd6a915b 100644 --- a/src/replication.cpp +++ b/src/replication.cpp @@ -357,8 +357,8 @@ void replicationFeedSlaves(list *slaves, int dictid, robj **argv, int argc) { char szMvcc[128]; incrementMvccTstamp(); uint64_t mvccTstamp = getMvccTstamp(); - int cchMvccNum = snprintf(szMvcc, sizeof(szMvcc), "%lu", mvccTstamp); - int cchMvcc = snprintf(szMvcc, sizeof(szMvcc), "$%d\r\n%lu\r\n", cchMvccNum, mvccTstamp); + int cchMvccNum = snprintf(szMvcc, sizeof(szMvcc), "%" PRIu64, mvccTstamp); + int cchMvcc = snprintf(szMvcc, sizeof(szMvcc), "$%d\r\n%" PRIu64 "\r\n", cchMvccNum, mvccTstamp); cchMvcc = std::min(cchMvcc, sizeof(szMvcc)); // tricky snprintf /* Write the command to the replication backlog if any. */ From b28c7298ced078d56623769b71adcf4edacc2903 Mon Sep 17 00:00:00 2001 From: John Sully Date: Sat, 28 Mar 2020 23:36:57 -0400 Subject: [PATCH 2/3] Don't send build log to stderr Former-commit-id: b20bf10fda319389c6e7d06cc7cc6c6b6b4f1c6c --- src/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Makefile b/src/Makefile index 91677a6dd..ab67a948f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -210,9 +210,9 @@ MAKECOLOR="\033[32;1m" ENDCOLOR="\033[0m" ifndef V -QUIET_CC = @printf ' %b %b\n' $(CCCOLOR)CC$(ENDCOLOR) $(SRCCOLOR)$@$(ENDCOLOR) 1>&2; -QUIET_LINK = @printf ' %b %b\n' $(LINKCOLOR)LINK$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR) 1>&2; -QUIET_INSTALL = @printf ' %b %b\n' $(LINKCOLOR)INSTALL$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR) 1>&2; +QUIET_CC = @printf ' %b %b\n' $(CCCOLOR)CC$(ENDCOLOR) $(SRCCOLOR)$@$(ENDCOLOR); +QUIET_LINK = @printf ' %b %b\n' $(LINKCOLOR)LINK$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR); +QUIET_INSTALL = @printf ' %b %b\n' $(LINKCOLOR)INSTALL$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR); endif REDIS_SERVER_NAME=keydb-server From 754138a94c3dc70d09a504089ae7526c39c44b3b Mon Sep 17 00:00:00 2001 From: John Sully Date: Mon, 30 Mar 2020 00:51:40 -0400 Subject: [PATCH 3/3] Allow active replicas to connect to each other when replica-serve-stale-data is set Former-commit-id: f2ca2aa1f70956a0309d6a2441417a80383fd717 --- src/server.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server.cpp b/src/server.cpp index 30d7eb9de..88f0b539b 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -3682,7 +3682,8 @@ int processCommand(client *c, int callFlags) { * link with master. */ if (FBrokenLinkToMaster() && g_pserver->repl_serve_stale_data == 0 && - !(c->cmd->flags & CMD_STALE)) + !(c->cmd->flags & CMD_STALE) + && !(g_pserver->fActiveReplica && c->cmd->proc == syncCommand)) { flagTransaction(c); addReply(c, shared.masterdownerr);