Compare commits

...
5 changed files with 40 additions and 3 deletions

No files matched your search

+11
View File
@@ -69,3 +69,14 @@ jobs:
sudo apt-get -y remove libzstd || true
sudo apt-get -y install uuid-dev libcurl4-openssl-dev libbz2-dev zlib1g-dev libsnappy-dev liblz4-dev libzstd-dev libgflags-dev
make KEYDB_CFLAGS='-Werror' KEYDB_CXXFLAGS='-Werror' MALLOC=libc -j2
build-alpine:
runs-on: alpine-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: make -j2
run: |
apk add coreutils gcc linux-headers make musl-dev openssl-dev git util-linux-dev curl-dev g++ libunwind-dev bash perl git bzip2-dev zstd-dev lz4-dev snappy-dev
make -j2
+1 -1
View File
@@ -349,7 +349,7 @@ endif
# Alpine OS doesn't have support for the execinfo backtrace library we use for debug, so we provide an alternate implementation using libwunwind.
OS := $(shell cat /etc/os-release | grep ID= | head -n 1 | cut -d'=' -f2)
ifeq ($(OS),alpine)
FINAL_CXXFLAGS+=-DUNW_LOCAL_ONLY
FINAL_CXXFLAGS+=-DUNW_LOCAL_ONLY -DALPINE
FINAL_LIBS += -lunwind
endif
+11 -1
View File
@@ -1737,6 +1737,9 @@ int dbSwapDatabases(int id1, int id2) {
id2 < 0 || id2 >= cserver.dbnum) return C_ERR;
if (id1 == id2) return C_OK;
std::swap(g_pserver->db[id1], g_pserver->db[id2]);
//swap db's id too, otherwise db does not match its id
std::swap(g_pserver->db[id1]->id, g_pserver->db[id2]->id);
/* Note that we don't swap blocking_keys,
* ready_keys and watched_keys, since we want clients to
@@ -1766,7 +1769,7 @@ int dbSwapDatabases(int id1, int id2) {
/* SWAPDB db1 db2 */
void swapdbCommand(client *c) {
int id1, id2;
int id1, id2, oriId;
/* Not allowed in cluster mode: we have just DB 0 there. */
if (g_pserver->cluster_enabled) {
@@ -1783,6 +1786,9 @@ void swapdbCommand(client *c) {
"invalid second DB index") != C_OK)
return;
//get client's original db's id
oriId=c->db->id;
/* Swap... */
if (dbSwapDatabases(id1,id2) == C_ERR) {
addReplyError(c,"DB index is out of range");
@@ -1791,6 +1797,10 @@ void swapdbCommand(client *c) {
RedisModuleSwapDbInfo si = {REDISMODULE_SWAPDBINFO_VERSION,(int32_t)id1,(int32_t)id2};
moduleFireServerEvent(REDISMODULE_EVENT_SWAPDB,0,&si);
g_pserver->dirty++;
//set client's db to original db
c->db=g_pserver->db[oriId];
addReply(c,shared.ok);
}
}
+1 -1
View File
@@ -380,7 +380,7 @@ size_t freeMemoryGetNotCountedMemory(void) {
/* also don't count the replication backlog memory
* that's where the replication clients get their memory from */
overhead += g_pserver->repl_backlog_size;
overhead += g_pserver->repl_backlog_size - g_pserver->repl_backlog_config_size;
if (g_pserver->aof_state != AOF_OFF) {
overhead += sdsalloc(g_pserver->aof_buf)+aofRewriteBufferSize();
+16
View File
@@ -3894,14 +3894,30 @@ void incrementMvccTstamp();
#if __GNUC__ >= 7 && !defined(NO_DEPRECATE_FREE)
[[deprecated]]
#ifdef ALPINE
void *calloc(size_t count, size_t size);
#else
void *calloc(size_t count, size_t size) noexcept;
#endif
[[deprecated]]
#ifdef ALPINE
void free(void *ptr);
#else
void free(void *ptr) noexcept;
#endif
[[deprecated]]
#ifdef ALPINE
void *malloc(size_t size);
#else
void *malloc(size_t size) noexcept;
#endif
[[deprecated]]
#ifdef ALPINE
void *realloc(void *ptr, size_t size);
#else
void *realloc(void *ptr, size_t size) noexcept;
#endif
#endif
/* Debugging stuff */
void bugReportStart(void);