Unverified Commit 82034611 authored by Binbin's avatar Binbin Committed by GitHub
Browse files

Fix some outdated comments and some typo (#10946)

* Fix some outdated comments and some typo
parent 0a2e51f9
...@@ -1450,7 +1450,7 @@ appendfsync everysec ...@@ -1450,7 +1450,7 @@ appendfsync everysec
# BGSAVE or BGREWRITEAOF is in progress. # BGSAVE or BGREWRITEAOF is in progress.
# #
# This means that while another child is saving, the durability of Redis is # This means that while another child is saving, the durability of Redis is
# the same as "appendfsync none". In practical terms, this means that it is # the same as "appendfsync no". In practical terms, this means that it is
# possible to lose up to 30 seconds of log in the worst scenario (with the # possible to lose up to 30 seconds of log in the worst scenario (with the
# default Linux settings). # default Linux settings).
# #
......
...@@ -674,7 +674,7 @@ void fcallroCommand(client *c) { ...@@ -674,7 +674,7 @@ void fcallroCommand(client *c) {
* * Engine name * * Engine name
* * Library description * * Library description
* * Library code * * Library code
* RDB_OPCODE_FUNCTION is saved before each library to present * RDB_OPCODE_FUNCTION2 is saved before each library to present
* that the payload is a library. * that the payload is a library.
* RDB version and crc64 is saved at the end of the payload. * RDB version and crc64 is saved at the end of the payload.
* The RDB version is saved for backward compatibility. * The RDB version is saved for backward compatibility.
......
...@@ -49,7 +49,6 @@ ...@@ -49,7 +49,6 @@
#define LP_HDR_NUMELE_UNKNOWN UINT16_MAX #define LP_HDR_NUMELE_UNKNOWN UINT16_MAX
#define LP_MAX_INT_ENCODING_LEN 9 #define LP_MAX_INT_ENCODING_LEN 9
#define LP_MAX_BACKLEN_SIZE 5 #define LP_MAX_BACKLEN_SIZE 5
#define LP_MAX_ENTRY_BACKLEN 34359738367ULL
#define LP_ENCODING_INT 0 #define LP_ENCODING_INT 0
#define LP_ENCODING_STRING 1 #define LP_ENCODING_STRING 1
...@@ -569,9 +568,7 @@ unsigned long lpLength(unsigned char *lp) { ...@@ -569,9 +568,7 @@ unsigned long lpLength(unsigned char *lp) {
* this lib. * this lib.
* *
* Similarly, there is no error returned since the listpack normally can be * Similarly, there is no error returned since the listpack normally can be
* assumed to be valid, so that would be a very high API cost. However a function * assumed to be valid, so that would be a very high API cost. */
* in order to check the integrity of the listpack at load time is provided,
* check lpIsValid(). */
static inline unsigned char *lpGetWithSize(unsigned char *p, int64_t *count, unsigned char *intbuf, uint64_t *entry_size) { static inline unsigned char *lpGetWithSize(unsigned char *p, int64_t *count, unsigned char *intbuf, uint64_t *entry_size) {
int64_t val; int64_t val;
uint64_t uval, negstart, negmax; uint64_t uval, negstart, negmax;
......
...@@ -1160,7 +1160,6 @@ ssize_t rdbSaveAuxFieldStrInt(rio *rdb, char *key, long long val) { ...@@ -1160,7 +1160,6 @@ ssize_t rdbSaveAuxFieldStrInt(rio *rdb, char *key, long long val) {
/* Save a few default AUX fields with information about the RDB generated. */ /* Save a few default AUX fields with information about the RDB generated. */
int rdbSaveInfoAuxFields(rio *rdb, int rdbflags, rdbSaveInfo *rsi) { int rdbSaveInfoAuxFields(rio *rdb, int rdbflags, rdbSaveInfo *rsi) {
UNUSED(rdbflags);
int redis_bits = (sizeof(void*) == 8) ? 64 : 32; int redis_bits = (sizeof(void*) == 8) ? 64 : 32;
int aof_base = (rdbflags & RDBFLAGS_AOF_PREAMBLE) != 0; int aof_base = (rdbflags & RDBFLAGS_AOF_PREAMBLE) != 0;
...@@ -3247,7 +3246,7 @@ eoferr: ...@@ -3247,7 +3246,7 @@ eoferr:
* to do the actual loading. Moreover the ETA displayed in the INFO * to do the actual loading. Moreover the ETA displayed in the INFO
* output is initialized and finalized. * output is initialized and finalized.
* *
* If you pass an 'rsi' structure initialized with RDB_SAVE_OPTION_INIT, the * If you pass an 'rsi' structure initialized with RDB_SAVE_INFO_INIT, the
* loading code will fill the information fields in the structure. */ * loading code will fill the information fields in the structure. */
int rdbLoad(char *filename, rdbSaveInfo *rsi, int rdbflags) { int rdbLoad(char *filename, rdbSaveInfo *rsi, int rdbflags) {
FILE *fp; FILE *fp;
......
...@@ -635,7 +635,7 @@ void resetChildState() { ...@@ -635,7 +635,7 @@ void resetChildState() {
NULL); NULL);
} }
/* Return if child type is mutual exclusive with other fork children */ /* Return if child type is mutually exclusive with other fork children */
int isMutuallyExclusiveChildType(int type) { int isMutuallyExclusiveChildType(int type) {
return type == CHILD_TYPE_RDB || type == CHILD_TYPE_AOF || type == CHILD_TYPE_MODULE; return type == CHILD_TYPE_RDB || type == CHILD_TYPE_AOF || type == CHILD_TYPE_MODULE;
} }
...@@ -3594,8 +3594,8 @@ int commandCheckArity(client *c, sds *err) { ...@@ -3594,8 +3594,8 @@ int commandCheckArity(client *c, sds *err) {
* if C_ERR is returned the client was destroyed (i.e. after QUIT). */ * if C_ERR is returned the client was destroyed (i.e. after QUIT). */
int processCommand(client *c) { int processCommand(client *c) {
if (!scriptIsTimedout()) { if (!scriptIsTimedout()) {
/* Both EXEC and EVAL call call() directly so there should be /* Both EXEC and scripts call call() directly so there should be
* no way in_exec or in_eval is 1. * no way in_exec or scriptIsRunning() is 1.
* That is unless lua_timedout, in which case client may run * That is unless lua_timedout, in which case client may run
* some commands. */ * some commands. */
serverAssert(!server.in_exec); serverAssert(!server.in_exec);
...@@ -6366,7 +6366,7 @@ int redisFork(int purpose) { ...@@ -6366,7 +6366,7 @@ int redisFork(int purpose) {
server.stat_fork_rate = (double) zmalloc_used_memory() * 1000000 / server.stat_fork_time / (1024*1024*1024); /* GB per second. */ server.stat_fork_rate = (double) zmalloc_used_memory() * 1000000 / server.stat_fork_time / (1024*1024*1024); /* GB per second. */
latencyAddSampleIfNeeded("fork",server.stat_fork_time/1000); latencyAddSampleIfNeeded("fork",server.stat_fork_time/1000);
/* The child_pid and child_type are only for mutual exclusive children. /* The child_pid and child_type are only for mutually exclusive children.
* other child types should handle and store their pid's in dedicated variables. * other child types should handle and store their pid's in dedicated variables.
* *
* Today, we allows CHILD_TYPE_LDB to run in parallel with the other fork types: * Today, we allows CHILD_TYPE_LDB to run in parallel with the other fork types:
...@@ -6452,7 +6452,7 @@ void dismissClientMemory(client *c) { ...@@ -6452,7 +6452,7 @@ void dismissClientMemory(client *c) {
/* In the child process, we don't need some buffers anymore, and these are /* In the child process, we don't need some buffers anymore, and these are
* likely to change in the parent when there's heavy write traffic. * likely to change in the parent when there's heavy write traffic.
* We dismis them right away, to avoid CoW. * We dismiss them right away, to avoid CoW.
* see dismissMemeory(). */ * see dismissMemeory(). */
void dismissMemoryInChild(void) { void dismissMemoryInChild(void) {
/* madvise(MADV_DONTNEED) may not work if Transparent Huge Pages is enabled. */ /* madvise(MADV_DONTNEED) may not work if Transparent Huge Pages is enabled. */
......
...@@ -2194,7 +2194,7 @@ typedef int redisGetKeysProc(struct redisCommand *cmd, robj **argv, int argc, ge ...@@ -2194,7 +2194,7 @@ typedef int redisGetKeysProc(struct redisCommand *cmd, robj **argv, int argc, ge
* *
* CMD_NO_MANDATORY_KEYS: This key arguments for this command are optional. * CMD_NO_MANDATORY_KEYS: This key arguments for this command are optional.
* *
* CMD_NO_MULTI: The command is nt allowed inside a transaction * CMD_NO_MULTI: The command is not allowed inside a transaction
* *
* The following additional flags are only used in order to put commands * The following additional flags are only used in order to put commands
* in a specific ACL category. Commands can have multiple ACL categories. * in a specific ACL category. Commands can have multiple ACL categories.
...@@ -2244,7 +2244,6 @@ struct redisCommand { ...@@ -2244,7 +2244,6 @@ struct redisCommand {
struct redisCommandArg *args; struct redisCommandArg *args;
/* Runtime populated data */ /* Runtime populated data */
/* What keys should be loaded in background when calling this command? */
long long microseconds, calls, rejected_calls, failed_calls; long long microseconds, calls, rejected_calls, failed_calls;
int id; /* Command ID. This is a progressive ID starting from 0 that int id; /* Command ID. This is a progressive ID starting from 0 that
is assigned at runtime, and is used in order to check is assigned at runtime, and is used in order to check
...@@ -2610,7 +2609,6 @@ void decrRefCount(robj *o); ...@@ -2610,7 +2609,6 @@ void decrRefCount(robj *o);
void decrRefCountVoid(void *o); void decrRefCountVoid(void *o);
void incrRefCount(robj *o); void incrRefCount(robj *o);
robj *makeObjectShared(robj *o); robj *makeObjectShared(robj *o);
robj *resetRefCount(robj *obj);
void freeStringObject(robj *o); void freeStringObject(robj *o);
void freeListObject(robj *o); void freeListObject(robj *o);
void freeSetObject(robj *o); void freeSetObject(robj *o);
...@@ -2755,7 +2753,7 @@ void sendChildInfo(childInfoType info_type, size_t keys, char *pname); ...@@ -2755,7 +2753,7 @@ void sendChildInfo(childInfoType info_type, size_t keys, char *pname);
void receiveChildInfo(void); void receiveChildInfo(void);
/* Fork helpers */ /* Fork helpers */
int redisFork(int type); int redisFork(int purpose);
int hasActiveChildProcess(); int hasActiveChildProcess();
void resetChildState(); void resetChildState();
int isMutuallyExclusiveChildType(int type); int isMutuallyExclusiveChildType(int type);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment