Rename symbols, part three

This commit is contained in:
Drew DeVault 2024-03-21 16:47:44 +01:00
parent 2caf78c649
commit 6e1f6f5288
23 changed files with 135 additions and 135 deletions

View File

@ -2445,12 +2445,12 @@ int rewriteAppendOnlyFileBackground(void) {
server.stat_aof_rewrites++; server.stat_aof_rewrites++;
if ((childpid = redisFork(CHILD_TYPE_AOF)) == 0) { if ((childpid = redictFork(CHILD_TYPE_AOF)) == 0) {
char tmpfile[256]; char tmpfile[256];
/* Child */ /* Child */
redisSetProcTitle("redict-aof-rewrite"); redictSetProcTitle("redict-aof-rewrite");
redisSetCpuAffinity(server.aof_rewrite_cpulist); redictSetCpuAffinity(server.aof_rewrite_cpulist);
snprintf(tmpfile,256,"temp-rewriteaof-bg-%d.aof", (int) getpid()); snprintf(tmpfile,256,"temp-rewriteaof-bg-%d.aof", (int) getpid());
if (rewriteAppendOnlyFile(tmpfile) == C_OK) { if (rewriteAppendOnlyFile(tmpfile) == C_OK) {
serverLog(LL_NOTICE, serverLog(LL_NOTICE,

View File

@ -11,8 +11,8 @@
#ifndef __ATOMIC_VAR_H #ifndef __ATOMIC_VAR_H
#define __ATOMIC_VAR_H #define __ATOMIC_VAR_H
/* Define redisAtomic for atomic variable. */ /* Define redictAtomic for atomic variable. */
#define redisAtomic #define redictAtomic
/* To test Redis with Helgrind (a Valgrind tool) it is useful to define /* To test Redis with Helgrind (a Valgrind tool) it is useful to define
* the following macro, so that __sync macros are used: those can be detected * the following macro, so that __sync macros are used: those can be detected
@ -40,8 +40,8 @@
#if !defined(__ATOMIC_VAR_FORCE_SYNC_MACROS) && defined(__STDC_VERSION__) && \ #if !defined(__ATOMIC_VAR_FORCE_SYNC_MACROS) && defined(__STDC_VERSION__) && \
(__STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_ATOMICS__) (__STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_ATOMICS__)
/* Use '_Atomic' keyword if the compiler supports. */ /* Use '_Atomic' keyword if the compiler supports. */
#undef redisAtomic #undef redictAtomic
#define redisAtomic _Atomic #define redictAtomic _Atomic
/* Implementation using _Atomic in C11. */ /* Implementation using _Atomic in C11. */
#include <stdatomic.h> #include <stdatomic.h>

View File

@ -157,7 +157,7 @@ void *bioProcessBackgroundJobs(void *arg) {
redis_set_thread_title(bio_worker_title[worker]); redis_set_thread_title(bio_worker_title[worker]);
redisSetCpuAffinity(server.bio_cpulist); redictSetCpuAffinity(server.bio_cpulist);
makeThreadKillable(); makeThreadKillable();

View File

@ -14,7 +14,7 @@
/* 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) */
long long redisPopcount(void *s, long count) { long long redictPopcount(void *s, long count) {
long long bits = 0; long long bits = 0;
unsigned char *p = s; unsigned char *p = s;
uint32_t *p4; uint32_t *p4;
@ -847,7 +847,7 @@ void bitcountCommand(client *c) {
addReply(c,shared.czero); addReply(c,shared.czero);
} else { } else {
long bytes = (long)(end-start+1); long bytes = (long)(end-start+1);
long long count = redisPopcount(p+start,bytes); long long count = redictPopcount(p+start,bytes);
if (first_byte_neg_mask != 0 || last_byte_neg_mask != 0) { if (first_byte_neg_mask != 0 || last_byte_neg_mask != 0) {
unsigned char firstlast[2] = {0, 0}; unsigned char firstlast[2] = {0, 0};
/* We may count bits of first byte and last byte which are out of /* We may count bits of first byte and last byte which are out of
@ -855,7 +855,7 @@ void bitcountCommand(client *c) {
* bits in the range to zero. So these bit will not be excluded. */ * bits in the range to zero. So these bit will not be excluded. */
if (first_byte_neg_mask != 0) firstlast[0] = p[start] & first_byte_neg_mask; if (first_byte_neg_mask != 0) firstlast[0] = p[start] & first_byte_neg_mask;
if (last_byte_neg_mask != 0) firstlast[1] = p[end] & last_byte_neg_mask; if (last_byte_neg_mask != 0) firstlast[1] = p[end] & last_byte_neg_mask;
count -= redisPopcount(firstlast,2); count -= redictPopcount(firstlast,2);
} }
addReplyLongLong(c,count); addReplyLongLong(c,count);
} }

View File

@ -27,8 +27,8 @@
#define UNUSED(V) ((void) V) #define UNUSED(V) ((void) V)
char *redisGitSHA1(void); char *redictGitSHA1(void);
char *redisGitDirty(void); char *redictGitDirty(void);
/* Wrapper around redisSecureConnection to avoid hiredis_ssl dependencies if /* Wrapper around redisSecureConnection to avoid hiredis_ssl dependencies if
* not building with TLS support. * not building with TLS support.
@ -405,9 +405,9 @@ sds cliVersion(void) {
sds version = sdscatprintf(sdsempty(), "%s", REDICT_VERSION); sds version = sdscatprintf(sdsempty(), "%s", REDICT_VERSION);
/* Add git commit and working tree status when available. */ /* Add git commit and working tree status when available. */
if (strtoll(redisGitSHA1(),NULL,16)) { if (strtoll(redictGitSHA1(),NULL,16)) {
version = sdscatprintf(version, " (git:%s", redisGitSHA1()); version = sdscatprintf(version, " (git:%s", redictGitSHA1());
if (strtoll(redisGitDirty(),NULL,10)) if (strtoll(redictGitDirty(),NULL,10))
version = sdscatprintf(version, "-dirty"); version = sdscatprintf(version, "-dirty");
version = sdscat(version, ")"); version = sdscat(version, ")");
} }

View File

@ -2422,7 +2422,7 @@ static int updateLocaleCollate(const char **err) {
} }
static int updateProcTitleTemplate(const char **err) { static int updateProcTitleTemplate(const char **err) {
if (redisSetProcTitle(NULL) == C_ERR) { if (redictSetProcTitle(NULL) == C_ERR) {
*err = "failed to set process title"; *err = "failed to set process title";
return 0; return 0;
} }

View File

@ -1969,7 +1969,7 @@ void logServerInfo(void) {
robj *argv[1]; robj *argv[1];
argv[0] = createStringObject("all", strlen("all")); argv[0] = createStringObject("all", strlen("all"));
dict *section_dict = genInfoSectionDict(argv, 1, NULL, &all, &everything); dict *section_dict = genInfoSectionDict(argv, 1, NULL, &all, &everything);
infostring = genRedisInfoString(section_dict, all, everything); infostring = genRedictInfoString(section_dict, all, everything);
if (server.cluster_enabled){ if (server.cluster_enabled){
infostring = genClusterDebugString(infostring); infostring = genClusterDebugString(infostring);
} }

View File

@ -863,7 +863,7 @@ void ldbSendLogs(void) {
int ldbStartSession(client *c) { int ldbStartSession(client *c) {
ldb.forked = (c->flags & CLIENT_LUA_DEBUG_SYNC) == 0; ldb.forked = (c->flags & CLIENT_LUA_DEBUG_SYNC) == 0;
if (ldb.forked) { if (ldb.forked) {
pid_t cp = redisFork(CHILD_TYPE_LDB); pid_t cp = redictFork(CHILD_TYPE_LDB);
if (cp == -1) { if (cp == -1) {
addReplyErrorFormat(c,"Fork() failed: can't run EVAL in debugging mode: %s", strerror(errno)); addReplyErrorFormat(c,"Fork() failed: can't run EVAL in debugging mode: %s", strerror(errno));
return 0; return 0;
@ -1366,7 +1366,7 @@ char *ldbRedisProtocolToHuman_Double(sds *o, char *reply) {
/* Log a Redict reply as debugger output, in a human readable format. /* Log a Redict reply as debugger output, in a human readable format.
* If the resulting string is longer than 'len' plus a few more chars * If the resulting string is longer than 'len' plus a few more chars
* used as prefix, it gets truncated. */ * used as prefix, it gets truncated. */
void ldbLogRedisReply(char *reply) { void ldbLogRedictReply(char *reply) {
sds log = sdsnew("<reply> "); sds log = sdsnew("<reply> ");
ldbRedisProtocolToHuman(&log,reply); ldbRedisProtocolToHuman(&log,reply);
ldbLogWithMaxLen(log); ldbLogWithMaxLen(log);
@ -1520,7 +1520,7 @@ 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"); ldbLogRedictReply("max lua stack reached");
return; return;
} }

View File

@ -10,8 +10,8 @@
#include "functions.h" #include "functions.h"
#include "cluster.h" #include "cluster.h"
static redisAtomic size_t lazyfree_objects = 0; static redictAtomic size_t lazyfree_objects = 0;
static redisAtomic size_t lazyfreed_objects = 0; static redictAtomic size_t lazyfreed_objects = 0;
/* Release objects from the lazyfree thread. It's just decrRefCount() /* Release objects from the lazyfree thread. It's just decrRefCount()
* updating the count of objects to release. */ * updating the count of objects to release. */

View File

@ -10424,7 +10424,7 @@ RedisModuleServerInfoData *RM_GetServerInfo(RedisModuleCtx *ctx, const char *sec
robj *argv[1]; robj *argv[1];
argv[0] = section ? createStringObject(section, strlen(section)) : NULL; argv[0] = section ? createStringObject(section, strlen(section)) : NULL;
dict *section_dict = genInfoSectionDict(argv, section ? 1 : 0, NULL, &all, &everything); dict *section_dict = genInfoSectionDict(argv, section ? 1 : 0, NULL, &all, &everything);
sds info = genRedisInfoString(section_dict, all, everything); sds info = genRedictInfoString(section_dict, all, everything);
int totlines, i; int totlines, i;
sds *lines = sdssplitlen(info, sdslen(info), "\r\n", 2, &totlines); sds *lines = sdssplitlen(info, sdslen(info), "\r\n", 2, &totlines);
for(i=0; i<totlines; i++) { for(i=0; i<totlines; i++) {
@ -11226,9 +11226,9 @@ int RM_ScanKey(RedisModuleKey *key, RedisModuleScanCursor *cursor, RedisModuleSc
int RM_Fork(RedisModuleForkDoneHandler cb, void *user_data) { int RM_Fork(RedisModuleForkDoneHandler cb, void *user_data) {
pid_t childpid; pid_t childpid;
if ((childpid = redisFork(CHILD_TYPE_MODULE)) == 0) { if ((childpid = redictFork(CHILD_TYPE_MODULE)) == 0) {
/* Child */ /* Child */
redisSetProcTitle("redict-module-fork"); redictSetProcTitle("redict-module-fork");
} else if (childpid == -1) { } else if (childpid == -1) {
serverLog(LL_WARNING,"Can't fork for module: %s", strerror(errno)); serverLog(LL_WARNING,"Can't fork for module: %s", strerror(errno));
} else { } else {

View File

@ -4173,7 +4173,7 @@ void processEventsWhileBlocked(void) {
#endif #endif
typedef struct __attribute__((aligned(CACHE_LINE_SIZE))) threads_pending { typedef struct __attribute__((aligned(CACHE_LINE_SIZE))) threads_pending {
redisAtomic unsigned long value; redictAtomic unsigned long value;
} threads_pending; } threads_pending;
pthread_t io_threads[IO_THREADS_MAX_NUM]; pthread_t io_threads[IO_THREADS_MAX_NUM];
@ -4204,7 +4204,7 @@ void *IOThreadMain(void *myid) {
snprintf(thdname, sizeof(thdname), "io_thd_%ld", id); snprintf(thdname, sizeof(thdname), "io_thd_%ld", id);
redis_set_thread_title(thdname); redis_set_thread_title(thdname);
redisSetCpuAffinity(server.server_cpulist); redictSetCpuAffinity(server.server_cpulist);
makeThreadKillable(); makeThreadKillable();
while(1) { while(1) {

View File

@ -71,7 +71,7 @@ void rdbReportError(int corruption_error, int linenum, char *reason, ...) {
rdbCheckError("Cannot check RDB that is a FIFO: %s", argv[1]); rdbCheckError("Cannot check RDB that is a FIFO: %s", argv[1]);
return; return;
} }
redis_check_rdb_main(2,argv,NULL); redict_check_rdb_main(2,argv,NULL);
} else if (corruption_error) { } else if (corruption_error) {
/* In diskless loading, in case of corrupt file, log and exit. */ /* In diskless loading, in case of corrupt file, log and exit. */
serverLog(LL_WARNING, "%s. Failure loading rdb format", msg); serverLog(LL_WARNING, "%s. Failure loading rdb format", msg);
@ -1555,12 +1555,12 @@ int rdbSaveBackground(int req, char *filename, rdbSaveInfo *rsi, int rdbflags) {
server.dirty_before_bgsave = server.dirty; server.dirty_before_bgsave = server.dirty;
server.lastbgsave_try = time(NULL); server.lastbgsave_try = time(NULL);
if ((childpid = redisFork(CHILD_TYPE_RDB)) == 0) { if ((childpid = redictFork(CHILD_TYPE_RDB)) == 0) {
int retval; int retval;
/* Child */ /* Child */
redisSetProcTitle("redict-rdb-bgsave"); redictSetProcTitle("redict-rdb-bgsave");
redisSetCpuAffinity(server.bgsave_cpulist); redictSetCpuAffinity(server.bgsave_cpulist);
retval = rdbSave(req, filename,rsi,rdbflags); retval = rdbSave(req, filename,rsi,rdbflags);
if (retval == C_OK) { if (retval == C_OK) {
sendChildCowInfo(CHILD_INFO_TYPE_RDB_COW_SIZE, "RDB"); sendChildCowInfo(CHILD_INFO_TYPE_RDB_COW_SIZE, "RDB");
@ -3561,7 +3561,7 @@ int rdbSaveToSlavesSockets(int req, rdbSaveInfo *rsi) {
} }
/* Create the child process. */ /* Create the child process. */
if ((childpid = redisFork(CHILD_TYPE_RDB)) == 0) { if ((childpid = redictFork(CHILD_TYPE_RDB)) == 0) {
/* Child */ /* Child */
int retval, dummy; int retval, dummy;
rio rdb; rio rdb;
@ -3572,8 +3572,8 @@ int rdbSaveToSlavesSockets(int req, rdbSaveInfo *rsi) {
* get a write error and exit. */ * get a write error and exit. */
close(server.rdb_pipe_read); close(server.rdb_pipe_read);
redisSetProcTitle("redict-rdb-to-slaves"); redictSetProcTitle("redict-rdb-to-slaves");
redisSetCpuAffinity(server.bgsave_cpulist); redictSetCpuAffinity(server.bgsave_cpulist);
retval = rdbSaveRioWithEOFMark(req,&rdb,NULL,rsi); retval = rdbSaveRioWithEOFMark(req,&rdb,NULL,rsi);
if (retval == C_OK && rioFlush(&rdb) == 0) if (retval == C_OK && rioFlush(&rdb) == 0)

View File

@ -62,11 +62,11 @@ static struct config {
int tls; int tls;
struct cliSSLconfig sslconfig; struct cliSSLconfig sslconfig;
int numclients; int numclients;
redisAtomic int liveclients; redictAtomic int liveclients;
int requests; int requests;
redisAtomic int requests_issued; redictAtomic int requests_issued;
redisAtomic int requests_finished; redictAtomic int requests_finished;
redisAtomic int previous_requests_finished; redictAtomic int previous_requests_finished;
int last_printed_bytes; int last_printed_bytes;
long long previous_tick; long long previous_tick;
int keysize; int keysize;
@ -95,9 +95,9 @@ static struct config {
struct redisConfig *redis_config; struct redisConfig *redis_config;
struct hdr_histogram* latency_histogram; struct hdr_histogram* latency_histogram;
struct hdr_histogram* current_sec_latency_histogram; struct hdr_histogram* current_sec_latency_histogram;
redisAtomic int is_fetching_slots; redictAtomic int is_fetching_slots;
redisAtomic int is_updating_slots; redictAtomic int is_updating_slots;
redisAtomic int slots_last_update; redictAtomic int slots_last_update;
int enable_tracking; int enable_tracking;
pthread_mutex_t liveclients_mutex; pthread_mutex_t liveclients_mutex;
pthread_mutex_t is_updating_slots_mutex; pthread_mutex_t is_updating_slots_mutex;

View File

@ -224,7 +224,7 @@ int checkSingleAof(char *aof_filename, char *aof_filepath, int last_file, int fi
if (preamble) { if (preamble) {
char *argv[2] = {NULL, aof_filepath}; char *argv[2] = {NULL, aof_filepath};
if (redis_check_rdb_main(2, argv, fp) == C_ERR) { if (redict_check_rdb_main(2, argv, fp) == C_ERR) {
printf("RDB preamble of AOF file is not sane, aborting.\n"); printf("RDB preamble of AOF file is not sane, aborting.\n");
exit(1); exit(1);
} else { } else {
@ -493,7 +493,7 @@ void checkOldStyleAof(char *filepath, int fix, int preamble) {
printAofStyle(ret, filepath, (char *)"AOF"); printAofStyle(ret, filepath, (char *)"AOF");
} }
int redis_check_aof_main(int argc, char **argv) { int redict_check_aof_main(int argc, char **argv) {
char *filepath; char *filepath;
char temp_filepath[PATH_MAX + 1]; char temp_filepath[PATH_MAX + 1];
char *dirpath; char *dirpath;

View File

@ -170,7 +170,7 @@ void rdbCheckSetupSignals(void) {
* 1 is returned. * 1 is returned.
* The file is specified as a filename in 'rdbfilename' if 'fp' is NULL, * The file is specified as a filename in 'rdbfilename' if 'fp' is NULL,
* otherwise the already open file 'fp' is checked. */ * otherwise the already open file 'fp' is checked. */
int redis_check_rdb(char *rdbfilename, FILE *fp) { int redict_check_rdb(char *rdbfilename, FILE *fp) {
uint64_t dbid; uint64_t dbid;
int selected_dbid = -1; int selected_dbid = -1;
int type, rdbver; int type, rdbver;
@ -386,7 +386,7 @@ err:
* status code according to success (RDB is sane) or error (RDB is corrupted). * status code according to success (RDB is sane) or error (RDB is corrupted).
* Otherwise if called with a non NULL fp, the function returns C_OK or * Otherwise if called with a non NULL fp, the function returns C_OK or
* C_ERR depending on the success or failure. */ * C_ERR depending on the success or failure. */
int redis_check_rdb_main(int argc, char **argv, FILE *fp) { int redict_check_rdb_main(int argc, char **argv, FILE *fp) {
struct timeval tv; struct timeval tv;
if (argc != 2 && fp == NULL) { if (argc != 2 && fp == NULL) {
@ -412,7 +412,7 @@ int redis_check_rdb_main(int argc, char **argv, FILE *fp) {
rdbCheckMode = 1; rdbCheckMode = 1;
rdbCheckInfo("Checking RDB file %s", argv[1]); rdbCheckInfo("Checking RDB file %s", argv[1]);
rdbCheckSetupSignals(); rdbCheckSetupSignals();
int retval = redis_check_rdb(argv[1],fp); int retval = redict_check_rdb(argv[1],fp);
if (retval == 0) { if (retval == 0) {
rdbCheckInfo("\\o/ RDB looks OK! \\o/"); rdbCheckInfo("\\o/ RDB looks OK! \\o/");
rdbShowGenericInfo(); rdbShowGenericInfo();

View File

@ -15,19 +15,19 @@
#include "release.h" #include "release.h"
#include "crc64.h" #include "crc64.h"
char *redisGitSHA1(void) { char *redictGitSHA1(void) {
return REDICT_GIT_SHA1; return REDICT_GIT_SHA1;
} }
char *redisGitDirty(void) { char *redictGitDirty(void) {
return REDICT_GIT_DIRTY; return REDICT_GIT_DIRTY;
} }
const char *redisBuildIdRaw(void) { const char *redictBuildIdRaw(void) {
return REDICT_BUILD_ID_RAW; return REDICT_BUILD_ID_RAW;
} }
uint64_t redisBuildId(void) { uint64_t redictBuildId(void) {
char *buildid = REDICT_BUILD_ID_RAW; char *buildid = REDICT_BUILD_ID_RAW;
return crc64(0,(unsigned char*)buildid,strlen(buildid)); return crc64(0,(unsigned char*)buildid,strlen(buildid));
@ -36,11 +36,11 @@ uint64_t redisBuildId(void) {
/* Return a cached value of the build string in order to avoid recomputing /* Return a cached value of the build string in order to avoid recomputing
* and converting it in hex every time: this string is shown in the INFO * and converting it in hex every time: this string is shown in the INFO
* output that should be fast. */ * output that should be fast. */
char *redisBuildIdString(void) { char *redictBuildIdString(void) {
static char buf[32]; static char buf[32];
static int cached = 0; static int cached = 0;
if (!cached) { if (!cached) {
snprintf(buf,sizeof(buf),"%llx",(unsigned long long) redisBuildId()); snprintf(buf,sizeof(buf),"%llx",(unsigned long long) redictBuildId());
cached = 1; cached = 1;
} }
return buf; return buf;

View File

@ -2264,7 +2264,7 @@ void readSyncBulkPayload(connection *conn) {
serverLog(LL_NOTICE, "MASTER <-> REPLICA sync: Finished with success"); serverLog(LL_NOTICE, "MASTER <-> REPLICA sync: Finished with success");
if (server.supervised_mode == SUPERVISED_SYSTEMD) { if (server.supervised_mode == SUPERVISED_SYSTEMD) {
redisCommunicateSystemd("STATUS=MASTER <-> REPLICA sync: Finished with success. Ready to accept connections in read-write mode.\n"); redictCommunicateSystemd("STATUS=MASTER <-> REPLICA sync: Finished with success. Ready to accept connections in read-write mode.\n");
} }
/* Send the initial ACK immediately to put this replica in online state. */ /* Send the initial ACK immediately to put this replica in online state. */
@ -2835,7 +2835,7 @@ void syncWithMaster(connection *conn) {
if (psync_result == PSYNC_CONTINUE) { if (psync_result == PSYNC_CONTINUE) {
serverLog(LL_NOTICE, "MASTER <-> REPLICA sync: Master accepted a Partial Resynchronization."); serverLog(LL_NOTICE, "MASTER <-> REPLICA sync: Master accepted a Partial Resynchronization.");
if (server.supervised_mode == SUPERVISED_SYSTEMD) { if (server.supervised_mode == SUPERVISED_SYSTEMD) {
redisCommunicateSystemd("STATUS=MASTER <-> REPLICA sync: Partial Resynchronization accepted. Ready to accept connections in read-write mode.\n"); redictCommunicateSystemd("STATUS=MASTER <-> REPLICA sync: Partial Resynchronization accepted. Ready to accept connections in read-write mode.\n");
} }
return; return;
} }

View File

@ -955,7 +955,7 @@ static int luaRedisGenericCommand(lua_State *lua, int raise_error) {
/* If the debugger is active, log the reply from Redis. */ /* If the debugger is active, log the reply from Redis. */
if (ldbIsEnabled()) if (ldbIsEnabled())
ldbLogRedisReply(reply); ldbLogRedictReply(reply);
if (reply != c->buf) sdsfree(reply); if (reply != c->buf) sdsfree(reply);
c->reply_bytes = 0; c->reply_bytes = 0;

View File

@ -4254,7 +4254,7 @@ void sentinelInfoCommand(client *c) {
sections_dict = cached_all_info_sections; sections_dict = cached_all_info_sections;
} }
sds info = genRedisInfoString(sections_dict, 0, 0); sds info = genRedictInfoString(sections_dict, 0, 0);
if (sec_all || (dictFind(sections_dict, "sentinel") != NULL)) { if (sec_all || (dictFind(sections_dict, "sentinel") != NULL)) {
dictIterator *di; dictIterator *di;
dictEntry *de; dictEntry *de;

View File

@ -3116,7 +3116,7 @@ int redisOpArrayAppend(redictOpArray *oa, int dbid, robj **argv, int argc, int t
return oa->numops; return oa->numops;
} }
void redisOpArrayFree(redictOpArray *oa) { void redictOpArrayFree(redictOpArray *oa) {
while(oa->numops) { while(oa->numops) {
int j; int j;
redictOp *op; redictOp *op;
@ -3397,7 +3397,7 @@ static void propagatePendingCommands(void) {
propagateNow(-1,&shared.exec,1,PROPAGATE_AOF|PROPAGATE_REPL); propagateNow(-1,&shared.exec,1,PROPAGATE_AOF|PROPAGATE_REPL);
} }
redisOpArrayFree(&server.also_propagate); redictOpArrayFree(&server.also_propagate);
} }
/* Performs operations that should be performed after an execution unit ends. /* Performs operations that should be performed after an execution unit ends.
@ -4296,7 +4296,7 @@ int prepareForShutdown(int flags) {
serverLog(LL_NOTICE,"User requested shutdown..."); serverLog(LL_NOTICE,"User requested shutdown...");
if (server.supervised_mode == SUPERVISED_SYSTEMD) if (server.supervised_mode == SUPERVISED_SYSTEMD)
redisCommunicateSystemd("STOPPING=1\n"); redictCommunicateSystemd("STOPPING=1\n");
/* If we have any replicas, let them catch up the replication offset before /* If we have any replicas, let them catch up the replication offset before
* we shut down, to avoid data loss. */ * we shut down, to avoid data loss. */
@ -4432,7 +4432,7 @@ int finishShutdown(void) {
} else { } else {
serverLog(LL_WARNING, "Writing initial AOF, can't exit."); serverLog(LL_WARNING, "Writing initial AOF, can't exit.");
if (server.supervised_mode == SUPERVISED_SYSTEMD) if (server.supervised_mode == SUPERVISED_SYSTEMD)
redisCommunicateSystemd("STATUS=Writing initial AOF, can't exit.\n"); redictCommunicateSystemd("STATUS=Writing initial AOF, can't exit.\n");
goto error; goto error;
} }
} }
@ -4454,7 +4454,7 @@ int finishShutdown(void) {
if ((server.saveparamslen > 0 && !nosave) || save) { if ((server.saveparamslen > 0 && !nosave) || save) {
serverLog(LL_NOTICE,"Saving the final RDB snapshot before exiting."); serverLog(LL_NOTICE,"Saving the final RDB snapshot before exiting.");
if (server.supervised_mode == SUPERVISED_SYSTEMD) if (server.supervised_mode == SUPERVISED_SYSTEMD)
redisCommunicateSystemd("STATUS=Saving the final RDB snapshot\n"); redictCommunicateSystemd("STATUS=Saving the final RDB snapshot\n");
/* Snapshotting. Perform a SYNC SAVE and exit */ /* Snapshotting. Perform a SYNC SAVE and exit */
rdbSaveInfo rsi, *rsiptr; rdbSaveInfo rsi, *rsiptr;
rsiptr = rdbPopulateSaveInfo(&rsi); rsiptr = rdbPopulateSaveInfo(&rsi);
@ -4470,7 +4470,7 @@ int finishShutdown(void) {
} else { } else {
serverLog(LL_WARNING,"Error trying to save the DB, can't exit."); serverLog(LL_WARNING,"Error trying to save the DB, can't exit.");
if (server.supervised_mode == SUPERVISED_SYSTEMD) if (server.supervised_mode == SUPERVISED_SYSTEMD)
redisCommunicateSystemd("STATUS=Error trying to save the DB, can't exit.\n"); redictCommunicateSystemd("STATUS=Error trying to save the DB, can't exit.\n");
goto error; goto error;
} }
} }
@ -5409,7 +5409,7 @@ sds genRedisInfoStringCommandStats(sds info, dict *commands) {
} }
/* Writes the ACL metrics to the info */ /* Writes the ACL metrics to the info */
sds genRedisInfoStringACLStats(sds info) { sds genRedictInfoStringACLStats(sds info) {
info = sdscatprintf(info, info = sdscatprintf(info,
"acl_access_denied_auth:%lld\r\n" "acl_access_denied_auth:%lld\r\n"
"acl_access_denied_cmd:%lld\r\n" "acl_access_denied_cmd:%lld\r\n"
@ -5527,7 +5527,7 @@ void totalNumberOfStatefulKeys(unsigned long *blocking_keys, unsigned long *bloc
/* Create the string returned by the INFO command. This is decoupled /* Create the string returned by the INFO command. This is decoupled
* by the INFO command itself as we need to report the same information * by the INFO command itself as we need to report the same information
* on memory corruption problems. */ * on memory corruption problems. */
sds genRedisInfoString(dict *section_dict, int all_sections, int everything) { sds genRedictInfoString(dict *section_dict, int all_sections, int everything) {
sds info = sdsempty(); sds info = sdsempty();
time_t uptime = server.unixtime-server.stat_starttime; time_t uptime = server.unixtime-server.stat_starttime;
int j; int j;
@ -5563,9 +5563,9 @@ sds genRedisInfoString(dict *section_dict, int all_sections, int everything) {
info = sdscatfmt(info, "# Server\r\n" FMTARGS( info = sdscatfmt(info, "# Server\r\n" FMTARGS(
"redict_version:%s\r\n", REDICT_VERSION, "redict_version:%s\r\n", REDICT_VERSION,
"redict_git_sha1:%s\r\n", redisGitSHA1(), "redict_git_sha1:%s\r\n", redictGitSHA1(),
"redict_git_dirty:%i\r\n", strtol(redisGitDirty(),NULL,10) > 0, "redict_git_dirty:%i\r\n", strtol(redictGitDirty(),NULL,10) > 0,
"redict_build_id:%s\r\n", redisBuildIdString(), "redict_build_id:%s\r\n", redictBuildIdString(),
"redict_mode:%s\r\n", mode, "redict_mode:%s\r\n", mode,
"os:%s", name.sysname, "os:%s", name.sysname,
" %s", name.release, " %s", name.release,
@ -5889,7 +5889,7 @@ sds genRedisInfoString(dict *section_dict, int all_sections, int everything) {
"eventloop_duration_cmd_sum:%llu\r\n", server.duration_stats[EL_DURATION_TYPE_CMD].sum, "eventloop_duration_cmd_sum:%llu\r\n", server.duration_stats[EL_DURATION_TYPE_CMD].sum,
"instantaneous_eventloop_cycles_per_sec:%llu\r\n", getInstantaneousMetric(STATS_METRIC_EL_CYCLE), "instantaneous_eventloop_cycles_per_sec:%llu\r\n", getInstantaneousMetric(STATS_METRIC_EL_CYCLE),
"instantaneous_eventloop_duration_usec:%llu\r\n", getInstantaneousMetric(STATS_METRIC_EL_DURATION))); "instantaneous_eventloop_duration_usec:%llu\r\n", getInstantaneousMetric(STATS_METRIC_EL_DURATION)));
info = genRedisInfoStringACLStats(info); info = genRedictInfoStringACLStats(info);
} }
/* Replication */ /* Replication */
@ -6132,7 +6132,7 @@ void infoCommand(client *c) {
int all_sections = 0; int all_sections = 0;
int everything = 0; int everything = 0;
dict *sections_dict = genInfoSectionDict(c->argv+1, c->argc-1, NULL, &all_sections, &everything); dict *sections_dict = genInfoSectionDict(c->argv+1, c->argc-1, NULL, &all_sections, &everything);
sds info = genRedisInfoString(sections_dict, all_sections, everything); sds info = genRedictInfoString(sections_dict, all_sections, everything);
addReplyVerbatim(c,info,sdslen(info),"txt"); addReplyVerbatim(c,info,sdslen(info),"txt");
sdsfree(info); sdsfree(info);
releaseInfoSectionDict(sections_dict); releaseInfoSectionDict(sections_dict);
@ -6244,11 +6244,11 @@ sds getVersion(void) {
sds version = sdscatprintf(sdsempty(), sds version = sdscatprintf(sdsempty(),
"v=%s sha=%s:%d malloc=%s bits=%d build=%llx", "v=%s sha=%s:%d malloc=%s bits=%d build=%llx",
REDICT_VERSION, REDICT_VERSION,
redisGitSHA1(), redictGitSHA1(),
atoi(redisGitDirty()) > 0, atoi(redictGitDirty()) > 0,
ZMALLOC_LIB, ZMALLOC_LIB,
sizeof(long) == 4 ? 32 : 64, sizeof(long) == 4 ? 32 : 64,
(unsigned long long) redisBuildId()); (unsigned long long) redictBuildId());
return version; return version;
} }
@ -6298,8 +6298,8 @@ void redisAsciiArt(void) {
} else { } else {
snprintf(buf,1024*16,ascii_logo, snprintf(buf,1024*16,ascii_logo,
REDICT_VERSION, REDICT_VERSION,
redisGitSHA1(), redictGitSHA1(),
strtol(redisGitDirty(),NULL,10) > 0, strtol(redictGitDirty(),NULL,10) > 0,
(sizeof(long) == 8) ? "64" : "32", (sizeof(long) == 8) ? "64" : "32",
mode, server.port ? server.port : server.tls_port, mode, server.port ? server.port : server.tls_port,
(long) getpid() (long) getpid()
@ -6327,7 +6327,7 @@ int changeListener(connListener *listener) {
/* Just close the server if port disabled */ /* Just close the server if port disabled */
if (listener->port == 0) { if (listener->port == 0) {
if (server.set_proc_title) redisSetProcTitle(NULL); if (server.set_proc_title) redictSetProcTitle(NULL);
return C_OK; return C_OK;
} }
@ -6341,7 +6341,7 @@ int changeListener(connListener *listener) {
serverPanic("Unrecoverable error creating %s accept handler.", listener->ct->get_type(NULL)); serverPanic("Unrecoverable error creating %s accept handler.", listener->ct->get_type(NULL));
} }
if (server.set_proc_title) redisSetProcTitle(NULL); if (server.set_proc_title) redictSetProcTitle(NULL);
return C_OK; return C_OK;
} }
@ -6427,7 +6427,7 @@ void closeChildUnusedResourceAfterFork(void) {
} }
/* purpose is one of CHILD_TYPE_ types */ /* purpose is one of CHILD_TYPE_ types */
int redisFork(int purpose) { int redictFork(int purpose) {
if (isMutuallyExclusiveChildType(purpose)) { if (isMutuallyExclusiveChildType(purpose)) {
if (hasActiveChildProcess()) { if (hasActiveChildProcess()) {
errno = EEXIST; errno = EEXIST;
@ -6727,7 +6727,7 @@ int validateProcTitleTemplate(const char *template) {
return ok; return ok;
} }
int redisSetProcTitle(char *title) { int redictSetProcTitle(char *title) {
#ifdef USE_SETPROCTITLE #ifdef USE_SETPROCTITLE
if (!title) title = server.exec_argv[0]; if (!title) title = server.exec_argv[0];
sds proc_title = expandProcTitleTemplate(server.proc_title_template, title); sds proc_title = expandProcTitleTemplate(server.proc_title_template, title);
@ -6742,7 +6742,7 @@ int redisSetProcTitle(char *title) {
return C_OK; return C_OK;
} }
void redisSetCpuAffinity(const char *cpulist) { void redictSetCpuAffinity(const char *cpulist) {
#ifdef USE_SETCPUAFFINITY #ifdef USE_SETCPUAFFINITY
setcpuaffinity(cpulist); setcpuaffinity(cpulist);
#else #else
@ -6752,7 +6752,7 @@ void redisSetCpuAffinity(const char *cpulist) {
/* Send a notify message to systemd. Returns sd_notify return code which is /* Send a notify message to systemd. Returns sd_notify return code which is
* a positive number on success. */ * a positive number on success. */
int redisCommunicateSystemd(const char *sd_notify_msg) { int redictCommunicateSystemd(const char *sd_notify_msg) {
#ifdef HAVE_LIBSYSTEMD #ifdef HAVE_LIBSYSTEMD
int ret = sd_notify(0, sd_notify_msg); int ret = sd_notify(0, sd_notify_msg);
@ -6974,9 +6974,9 @@ int main(int argc, char **argv) {
* the program main. However the program is part of the Redict executable * the program main. However the program is part of the Redict executable
* so that we can easily execute an RDB check on loading errors. */ * so that we can easily execute an RDB check on loading errors. */
if (strstr(exec_name,"redict-check-rdb") != NULL) if (strstr(exec_name,"redict-check-rdb") != NULL)
redis_check_rdb_main(argc,argv,NULL); redict_check_rdb_main(argc,argv,NULL);
else if (strstr(exec_name,"redict-check-aof") != NULL) else if (strstr(exec_name,"redict-check-aof") != NULL)
redis_check_aof_main(argc,argv); redict_check_aof_main(argc,argv);
if (argc >= 2) { if (argc >= 2) {
j = 1; /* First option to parse in argv[] */ j = 1; /* First option to parse in argv[] */
@ -7135,8 +7135,8 @@ int main(int argc, char **argv) {
"Redict version=%s, bits=%d, commit=%s, modified=%d, pid=%d, just started", "Redict version=%s, bits=%d, commit=%s, modified=%d, pid=%d, just started",
REDICT_VERSION, REDICT_VERSION,
(sizeof(long) == 8) ? 64 : 32, (sizeof(long) == 8) ? 64 : 32,
redisGitSHA1(), redictGitSHA1(),
strtol(redisGitDirty(),NULL,10) > 0, strtol(redictGitDirty(),NULL,10) > 0,
(int)getpid()); (int)getpid());
if (argc == 1) { if (argc == 1) {
@ -7147,7 +7147,7 @@ int main(int argc, char **argv) {
initServer(); initServer();
if (background || server.pidfile) createPidFile(); if (background || server.pidfile) createPidFile();
if (server.set_proc_title) redisSetProcTitle(NULL); if (server.set_proc_title) redictSetProcTitle(NULL);
redisAsciiArt(); redisAsciiArt();
checkTcpBacklogSettings(); checkTcpBacklogSettings();
if (server.cluster_enabled) { if (server.cluster_enabled) {
@ -7185,17 +7185,17 @@ int main(int argc, char **argv) {
if (server.supervised_mode == SUPERVISED_SYSTEMD) { if (server.supervised_mode == SUPERVISED_SYSTEMD) {
if (!server.masterhost) { if (!server.masterhost) {
redisCommunicateSystemd("STATUS=Ready to accept connections\n"); redictCommunicateSystemd("STATUS=Ready to accept connections\n");
} else { } else {
redisCommunicateSystemd("STATUS=Ready to accept connections in read-only mode. Waiting for MASTER <-> REPLICA sync\n"); redictCommunicateSystemd("STATUS=Ready to accept connections in read-only mode. Waiting for MASTER <-> REPLICA sync\n");
} }
redisCommunicateSystemd("READY=1\n"); redictCommunicateSystemd("READY=1\n");
} }
} else { } else {
sentinelIsRunning(); sentinelIsRunning();
if (server.supervised_mode == SUPERVISED_SYSTEMD) { if (server.supervised_mode == SUPERVISED_SYSTEMD) {
redisCommunicateSystemd("STATUS=Ready to accept connections\n"); redictCommunicateSystemd("STATUS=Ready to accept connections\n");
redisCommunicateSystemd("READY=1\n"); redictCommunicateSystemd("READY=1\n");
} }
} }
@ -7204,7 +7204,7 @@ int main(int argc, char **argv) {
serverLog(LL_WARNING,"WARNING: You specified a maxmemory value that is less than 1MB (current value is %llu bytes). Are you sure this is what you really want?", server.maxmemory); serverLog(LL_WARNING,"WARNING: You specified a maxmemory value that is less than 1MB (current value is %llu bytes). Are you sure this is what you really want?", server.maxmemory);
} }
redisSetCpuAffinity(server.server_cpulist); redictSetCpuAffinity(server.server_cpulist);
setOOMScoreAdj(-1); setOOMScoreAdj(-1);
aeMain(server.el); aeMain(server.el);

View File

@ -1572,7 +1572,7 @@ struct redictServer {
int module_pipe[2]; /* Pipe used to awake the event loop by module threads. */ int module_pipe[2]; /* Pipe used to awake the event loop by module threads. */
pid_t child_pid; /* PID of current child */ pid_t child_pid; /* PID of current child */
int child_type; /* Type of current child */ int child_type; /* Type of current child */
redisAtomic int module_gil_acquring; /* Indicates whether the GIL is being acquiring by the main thread. */ redictAtomic int module_gil_acquring; /* Indicates whether the GIL is being acquiring by the main thread. */
/* Networking */ /* Networking */
int port; /* TCP listening port */ int port; /* TCP listening port */
int tls_port; /* TLS listening port */ int tls_port; /* TLS listening port */
@ -1611,7 +1611,7 @@ struct redictServer {
pause_event client_pause_per_purpose[NUM_PAUSE_PURPOSES]; pause_event client_pause_per_purpose[NUM_PAUSE_PURPOSES];
char neterr[ANET_ERR_LEN]; /* Error buffer for anet.c */ char neterr[ANET_ERR_LEN]; /* Error buffer for anet.c */
dict *migrate_cached_sockets;/* MIGRATE cached sockets */ dict *migrate_cached_sockets;/* MIGRATE cached sockets */
redisAtomic uint64_t next_client_id; /* Next client unique ID. Incremental. */ redictAtomic uint64_t next_client_id; /* Next client unique ID. Incremental. */
int protected_mode; /* Don't accept external connections. */ int protected_mode; /* Don't accept external connections. */
int io_threads_num; /* Number of IO threads to use. */ int io_threads_num; /* Number of IO threads to use. */
int io_threads_do_reads; /* Read and parse from IO threads? */ int io_threads_do_reads; /* Read and parse from IO threads? */
@ -1667,10 +1667,10 @@ struct redictServer {
long long slowlog_log_slower_than; /* SLOWLOG time limit (to get logged) */ long long slowlog_log_slower_than; /* SLOWLOG time limit (to get logged) */
unsigned long slowlog_max_len; /* SLOWLOG max number of items logged */ unsigned long slowlog_max_len; /* SLOWLOG max number of items logged */
struct malloc_stats cron_malloc_stats; /* sampled in serverCron(). */ struct malloc_stats cron_malloc_stats; /* sampled in serverCron(). */
redisAtomic long long stat_net_input_bytes; /* Bytes read from network. */ redictAtomic long long stat_net_input_bytes; /* Bytes read from network. */
redisAtomic long long stat_net_output_bytes; /* Bytes written to network. */ redictAtomic long long stat_net_output_bytes; /* Bytes written to network. */
redisAtomic long long stat_net_repl_input_bytes; /* Bytes read during replication, added to stat_net_input_bytes in 'info'. */ redictAtomic long long stat_net_repl_input_bytes; /* Bytes read during replication, added to stat_net_input_bytes in 'info'. */
redisAtomic long long stat_net_repl_output_bytes; /* Bytes written during replication, added to stat_net_output_bytes in 'info'. */ redictAtomic long long stat_net_repl_output_bytes; /* Bytes written during replication, added to stat_net_output_bytes in 'info'. */
size_t stat_current_cow_peak; /* Peak size of copy on write bytes. */ size_t stat_current_cow_peak; /* Peak size of copy on write bytes. */
size_t stat_current_cow_bytes; /* Copy on write bytes while child is active. */ size_t stat_current_cow_bytes; /* Copy on write bytes while child is active. */
monotime stat_current_cow_updated; /* Last update time of stat_current_cow_bytes */ monotime stat_current_cow_updated; /* Last update time of stat_current_cow_bytes */
@ -1687,9 +1687,9 @@ struct redictServer {
long long stat_dump_payload_sanitizations; /* Number deep dump payloads integrity validations. */ long long stat_dump_payload_sanitizations; /* Number deep dump payloads integrity validations. */
long long stat_io_reads_processed; /* Number of read events processed by IO / Main threads */ long long stat_io_reads_processed; /* Number of read events processed by IO / Main threads */
long long stat_io_writes_processed; /* Number of write events processed by IO / Main threads */ long long stat_io_writes_processed; /* Number of write events processed by IO / Main threads */
redisAtomic long long stat_total_reads_processed; /* Total number of read events processed */ redictAtomic long long stat_total_reads_processed; /* Total number of read events processed */
redisAtomic long long stat_total_writes_processed; /* Total number of write events processed */ redictAtomic long long stat_total_writes_processed; /* Total number of write events processed */
redisAtomic long long stat_client_qbuf_limit_disconnections; /* Total number of clients reached query buf length limit */ redictAtomic long long stat_client_qbuf_limit_disconnections; /* Total number of clients reached query buf length limit */
long long stat_client_outbuf_limit_disconnections; /* Total number of clients reached output buf length limit */ long long stat_client_outbuf_limit_disconnections; /* Total number of clients reached output buf length limit */
/* The following two are used to track instantaneous metrics, like /* The following two are used to track instantaneous metrics, like
* number of operations per second, network traffic. */ * number of operations per second, network traffic. */
@ -1778,8 +1778,8 @@ struct redictServer {
int aof_last_write_errno; /* Valid if aof write/fsync status is ERR */ int aof_last_write_errno; /* Valid if aof write/fsync status is ERR */
int aof_load_truncated; /* Don't stop on unexpected AOF EOF. */ int aof_load_truncated; /* Don't stop on unexpected AOF EOF. */
int aof_use_rdb_preamble; /* Specify base AOF to use RDB encoding on AOF rewrites. */ int aof_use_rdb_preamble; /* Specify base AOF to use RDB encoding on AOF rewrites. */
redisAtomic int aof_bio_fsync_status; /* Status of AOF fsync in bio job. */ redictAtomic int aof_bio_fsync_status; /* Status of AOF fsync in bio job. */
redisAtomic int aof_bio_fsync_errno; /* Errno of AOF fsync in bio job. */ redictAtomic int aof_bio_fsync_errno; /* Errno of AOF fsync in bio job. */
aofManifest *aof_manifest; /* Used to track AOFs. */ aofManifest *aof_manifest; /* Used to track AOFs. */
int aof_disable_auto_gc; /* If disable automatically deleting HISTORY type AOFs? int aof_disable_auto_gc; /* If disable automatically deleting HISTORY type AOFs?
default no. (for testings). */ default no. (for testings). */
@ -1844,7 +1844,7 @@ struct redictServer {
char replid2[CONFIG_RUN_ID_SIZE+1]; /* replid inherited from master*/ char replid2[CONFIG_RUN_ID_SIZE+1]; /* replid inherited from master*/
long long master_repl_offset; /* My current replication offset */ long long master_repl_offset; /* My current replication offset */
long long second_replid_offset; /* Accept offsets up to this for replid2. */ long long second_replid_offset; /* Accept offsets up to this for replid2. */
redisAtomic long long fsynced_reploff_pending;/* Largest replication offset to redictAtomic long long fsynced_reploff_pending;/* Largest replication offset to
* potentially have been fsynced, applied to * potentially have been fsynced, applied to
fsynced_reploff only when AOF state is AOF_ON fsynced_reploff only when AOF state is AOF_ON
(not during the initial rewrite) */ (not during the initial rewrite) */
@ -1952,7 +1952,7 @@ struct redictServer {
int list_max_listpack_size; int list_max_listpack_size;
int list_compress_depth; int list_compress_depth;
/* time cache */ /* time cache */
redisAtomic time_t unixtime; /* Unix time sampled every cron cycle. */ redictAtomic time_t unixtime; /* Unix time sampled every cron cycle. */
time_t timezone; /* Cached timezone. As set by tzset(). */ time_t timezone; /* Cached timezone. As set by tzset(). */
int daylight_active; /* Currently in daylight saving time. */ int daylight_active; /* Currently in daylight saving time. */
mstime_t mstime; /* 'unixtime' in milliseconds. */ mstime_t mstime; /* 'unixtime' in milliseconds. */
@ -1989,9 +1989,9 @@ struct redictServer {
int cluster_announce_port; /* base port to announce on cluster bus. */ int cluster_announce_port; /* base port to announce on cluster bus. */
int cluster_announce_tls_port; /* TLS port to announce on cluster bus. */ int cluster_announce_tls_port; /* TLS port to announce on cluster bus. */
int cluster_announce_bus_port; /* bus port to announce on cluster bus. */ int cluster_announce_bus_port; /* bus port to announce on cluster bus. */
int cluster_module_flags; /* Set of flags that Redis modules are able int cluster_module_flags; /* Set of flags that Redict modules are able
to set in order to suppress certain to set in order to suppress certain
native Redis Cluster features. Check the native Redict Cluster features. Check the
REDISMODULE_CLUSTER_FLAG_*. */ REDISMODULE_CLUSTER_FLAG_*. */
int cluster_allow_reads_when_down; /* Are reads allowed when the cluster int cluster_allow_reads_when_down; /* Are reads allowed when the cluster
is down? */ is down? */
@ -2030,7 +2030,7 @@ struct redictServer {
int tls_auth_clients; int tls_auth_clients;
redictTLSContextConfig tls_ctx_config; redictTLSContextConfig tls_ctx_config;
/* cpu affinity */ /* cpu affinity */
char *server_cpulist; /* cpu affinity list of redis server main/io thread. */ char *server_cpulist; /* cpu affinity list of redict server main/io thread. */
char *bio_cpulist; /* cpu affinity list of bio thread. */ char *bio_cpulist; /* cpu affinity list of bio thread. */
char *aof_rewrite_cpulist; /* cpu affinity list of aof rewrite process. */ char *aof_rewrite_cpulist; /* cpu affinity list of aof rewrite process. */
char *bgsave_cpulist; /* cpu affinity list of bgsave process. */ char *bgsave_cpulist; /* cpu affinity list of bgsave process. */
@ -2218,7 +2218,7 @@ typedef enum {
typedef void redictCommandProc(client *c); typedef void redictCommandProc(client *c);
typedef int redictGetKeysProc(struct redictCommand *cmd, robj **argv, int argc, getKeysResult *result); typedef int redictGetKeysProc(struct redictCommand *cmd, robj **argv, int argc, getKeysResult *result);
/* Redis command structure. /* Redict command structure.
* *
* Note that the command table is in commands.c and it is auto-generated. * Note that the command table is in commands.c and it is auto-generated.
* *
@ -2278,7 +2278,7 @@ typedef int redictGetKeysProc(struct redictCommand *cmd, robj **argv, int argc,
* CMD_SENTINEL: This command is present in sentinel mode. * CMD_SENTINEL: This command is present in sentinel mode.
* *
* CMD_ONLY_SENTINEL: This command is present only when in sentinel mode. * CMD_ONLY_SENTINEL: This command is present only when in sentinel mode.
* And should be removed from redis. * And should be removed from redict.
* *
* CMD_NO_MANDATORY_KEYS: This key arguments for this command are optional. * CMD_NO_MANDATORY_KEYS: This key arguments for this command are optional.
* *
@ -2333,7 +2333,7 @@ struct redictCommand {
keySpec *key_specs; keySpec *key_specs;
int key_specs_num; int key_specs_num;
/* Use a function to determine keys arguments in a command line. /* Use a function to determine keys arguments in a command line.
* Used for Redis Cluster redirect (may be NULL) */ * Used for Redict Cluster redirect (may be NULL) */
redictGetKeysProc *getkeys_proc; redictGetKeysProc *getkeys_proc;
int num_args; /* Length of args array. */ int num_args; /* Length of args array. */
/* Array of subcommands (may be NULL) */ /* Array of subcommands (may be NULL) */
@ -2359,7 +2359,7 @@ struct redictCommand {
* we can still support the reply format of * we can still support the reply format of
* COMMAND INFO and COMMAND GETKEYS */ * COMMAND INFO and COMMAND GETKEYS */
dict *subcommands_dict; /* A dictionary that holds the subcommands, the key is the subcommand sds name dict *subcommands_dict; /* A dictionary that holds the subcommands, the key is the subcommand sds name
* (not the fullname), and the value is the redisCommand structure pointer. */ * (not the fullname), and the value is the redictCommand structure pointer. */
struct redictCommand *parent; struct redictCommand *parent;
struct RedictModuleCommand *module_cmd; /* A pointer to the module command data (NULL if native command) */ struct RedictModuleCommand *module_cmd; /* A pointer to the module command data (NULL if native command) */
}; };
@ -2529,11 +2529,11 @@ void getRandomHexChars(char *p, size_t len);
void getRandomBytes(unsigned char *p, size_t len); 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);
long long redisPopcount(void *s, long count); long long redictPopcount(void *s, long count);
int redisSetProcTitle(char *title); int redictSetProcTitle(char *title);
int validateProcTitleTemplate(const char *template); int validateProcTitleTemplate(const char *template);
int redisCommunicateSystemd(const char *sd_notify_msg); int redictCommunicateSystemd(const char *sd_notify_msg);
void redisSetCpuAffinity(const char *cpulist); void redictSetCpuAffinity(const char *cpulist);
/* afterErrorReply flags */ /* afterErrorReply flags */
#define ERR_REPLY_FLAG_NO_STATS_UPDATE (1ULL<<0) /* Indicating that we should not update #define ERR_REPLY_FLAG_NO_STATS_UPDATE (1ULL<<0) /* Indicating that we should not update
@ -2730,7 +2730,7 @@ void discardTransaction(client *c);
void flagTransaction(client *c); void flagTransaction(client *c);
void execCommandAbort(client *c, sds error); void execCommandAbort(client *c, sds error);
/* Redis object implementation */ /* Redict object implementation */
void decrRefCount(robj *o); void decrRefCount(robj *o);
void decrRefCountVoid(void *o); void decrRefCountVoid(void *o);
void incrRefCount(robj *o); void incrRefCount(robj *o);
@ -2884,7 +2884,7 @@ void sendChildInfo(childInfoType info_type, size_t keys, char *pname);
void receiveChildInfo(void); void receiveChildInfo(void);
/* Fork helpers */ /* Fork helpers */
int redisFork(int purpose); int redictFork(int purpose);
int hasActiveChildProcess(void); int hasActiveChildProcess(void);
void resetChildState(void); void resetChildState(void);
int isMutuallyExclusiveChildType(int type); int isMutuallyExclusiveChildType(int type);
@ -2947,7 +2947,7 @@ void ACLFreeUserAndKillClients(user *u);
void addACLLogEntry(client *c, int reason, int context, int argpos, sds username, sds object); void addACLLogEntry(client *c, int reason, int context, int argpos, sds username, sds object);
sds getAclErrorMessage(int acl_res, user *user, struct redictCommand *cmd, sds errored_val, int verbose); sds getAclErrorMessage(int acl_res, user *user, struct redictCommand *cmd, sds errored_val, int verbose);
void ACLUpdateDefaultUserPassword(sds password); void ACLUpdateDefaultUserPassword(sds password);
sds genRedisInfoStringACLStats(sds info); sds genRedictInfoStringACLStats(sds info);
void ACLRecomputeCommandBitsFromCommandRulesAllUsers(void); void ACLRecomputeCommandBitsFromCommandRulesAllUsers(void);
/* Sorted sets data type */ /* Sorted sets data type */
@ -3043,7 +3043,7 @@ int incrCommandStatsOnError(struct redictCommand *cmd, int flags);
void call(client *c, int flags); void call(client *c, int flags);
void alsoPropagate(int dbid, robj **argv, int argc, int target); void alsoPropagate(int dbid, robj **argv, int argc, int target);
void postExecutionUnitOperations(void); void postExecutionUnitOperations(void);
void redisOpArrayFree(redictOpArray *oa); void redictOpArrayFree(redictOpArray *oa);
void forceCommandPropagation(client *c, int flags); void forceCommandPropagation(client *c, int flags);
void preventCommandPropagation(client *c); void preventCommandPropagation(client *c);
void preventCommandAOF(client *c); void preventCommandAOF(client *c);
@ -3356,9 +3356,9 @@ void sentinelPublishCommand(client *c);
void sentinelRoleCommand(client *c); void sentinelRoleCommand(client *c);
/* redict-check-rdb & aof */ /* redict-check-rdb & aof */
int redis_check_rdb(char *rdbfilename, FILE *fp); int redict_check_rdb(char *rdbfilename, FILE *fp);
int redis_check_rdb_main(int argc, char **argv, FILE *fp); int redict_check_rdb_main(int argc, char **argv, FILE *fp);
int redis_check_aof_main(int argc, char **argv); int redict_check_aof_main(int argc, char **argv);
/* Scripting */ /* Scripting */
void scriptingInit(int setup); void scriptingInit(int setup);
@ -3371,7 +3371,7 @@ void freeLuaScriptsAsync(dict *lua_scripts, list *lua_scripts_lru_list, lua_Stat
void freeFunctionsAsync(functionsLibCtx *lib_ctx); void freeFunctionsAsync(functionsLibCtx *lib_ctx);
int ldbIsEnabled(void); int ldbIsEnabled(void);
void ldbLog(sds entry); void ldbLog(sds entry);
void ldbLogRedisReply(char *reply); void ldbLogRedictReply(char *reply);
void sha1hex(char *digest, char *script, size_t len); void sha1hex(char *digest, char *script, size_t len);
unsigned long evalMemory(void); unsigned long evalMemory(void);
dict* evalScriptsDict(void); dict* evalScriptsDict(void);
@ -3448,11 +3448,11 @@ void dictListDestructor(dict *d, void *val);
void *dictSdsDup(dict *d, const void *key); void *dictSdsDup(dict *d, const void *key);
/* Git SHA1 */ /* Git SHA1 */
char *redisGitSHA1(void); char *redictGitSHA1(void);
char *redisGitDirty(void); char *redictGitDirty(void);
uint64_t redisBuildId(void); uint64_t redictBuildId(void);
const char *redisBuildIdRaw(void); const char *redictBuildIdRaw(void);
char *redisBuildIdString(void); char *redictBuildIdString(void);
/* Commands prototypes */ /* Commands prototypes */
void authCommand(client *c); void authCommand(client *c);
@ -3735,7 +3735,7 @@ void removeSigSegvHandlers(void);
const char *getSafeInfoString(const char *s, size_t len, char **tmp); const char *getSafeInfoString(const char *s, size_t len, char **tmp);
dict *genInfoSectionDict(robj **argv, int argc, char **defaults, int *out_all, int *out_everything); dict *genInfoSectionDict(robj **argv, int argc, char **defaults, int *out_all, int *out_everything);
void releaseInfoSectionDict(dict *sec); void releaseInfoSectionDict(dict *sec);
sds genRedisInfoString(dict *section_dict, int all_sections, int everything); sds genRedictInfoString(dict *section_dict, int all_sections, int everything);
sds genModulesInfoString(sds info); sds genModulesInfoString(sds info);
void applyWatchdogPeriod(void); void applyWatchdogPeriod(void);
void watchdogScheduleSignal(int period); void watchdogScheduleSignal(int period);
@ -3759,9 +3759,9 @@ sds getVersion(void);
_serverLog(level, __VA_ARGS__);\ _serverLog(level, __VA_ARGS__);\
} while(0) } while(0)
#define redisDebug(fmt, ...) \ #define redictDebug(fmt, ...) \
printf("DEBUG %s:%d > " fmt "\n", __FILE__, __LINE__, __VA_ARGS__) printf("DEBUG %s:%d > " fmt "\n", __FILE__, __LINE__, __VA_ARGS__)
#define redisDebugMark() \ #define redictDebugMark() \
printf("-- MARK %s:%d --\n", __FILE__, __LINE__) printf("-- MARK %s:%d --\n", __FILE__, __LINE__)
int iAmMaster(void); int iAmMaster(void);

View File

@ -24,10 +24,10 @@ static const clock_t RUN_ON_THREADS_TIMEOUT = 2;
static run_on_thread_cb g_callback = NULL; static run_on_thread_cb g_callback = NULL;
static volatile size_t g_tids_len = 0; static volatile size_t g_tids_len = 0;
static redisAtomic size_t g_num_threads_done = 0; static redictAtomic size_t g_num_threads_done = 0;
/* This flag is set while ThreadsManager_runOnThreads is running */ /* This flag is set while ThreadsManager_runOnThreads is running */
static redisAtomic int g_in_progress = 0; static redictAtomic int g_in_progress = 0;
/*============================ Internal prototypes ========================== */ /*============================ Internal prototypes ========================== */

View File

@ -67,7 +67,7 @@ void zlibc_free(void *ptr) {
#define update_zmalloc_stat_alloc(__n) atomicIncr(used_memory,(__n)) #define update_zmalloc_stat_alloc(__n) atomicIncr(used_memory,(__n))
#define update_zmalloc_stat_free(__n) atomicDecr(used_memory,(__n)) #define update_zmalloc_stat_free(__n) atomicDecr(used_memory,(__n))
static redisAtomic size_t used_memory = 0; static redictAtomic size_t used_memory = 0;
static void zmalloc_default_oom(size_t size) { static void zmalloc_default_oom(size_t size) {
fprintf(stderr, "zmalloc: Out of memory trying to allocate %zu bytes\n", fprintf(stderr, "zmalloc: Out of memory trying to allocate %zu bytes\n",