Browse Source

Fixed some typos, add a spell check ci and others minor fix (#8890)

This PR adds a spell checker CI action that will fail future PRs if they introduce typos and spelling mistakes.
This spell checker is based on blacklist of common spelling mistakes, so it will not catch everything,
but at least it is also unlikely to cause false positives.

Besides that, the PR also fixes many spelling mistakes and types, not all are a result of the spell checker we use.

Here's a summary of other changes:
1. Scanned the entire source code and fixes all sorts of typos and spelling mistakes (including missing or extra spaces).
2. Outdated function / variable / argument names in comments
3. Fix outdated keyspace masks error log when we check `config.notify-keyspace-events` in loadServerConfigFromString.
4. Trim the white space at the end of line in `module.c`. Check: https://github.com/redis/redis/pull/7751
5. Some outdated https link URLs.
6. Fix some outdated comment. Such as:
    - In README: about the rdb, we used to said create a `thread`, change to `process`
    - dbRandomKey function coment (about the dictGetRandomKey, change to dictGetFairRandomKey)
    - notifyKeyspaceEvent fucntion comment (add type arg)
    - Some others minor fix in comment (Most of them are incorrectly quoted by variable names)
7. Modified the error log so that users can easily distinguish between TCP and TLS in `changeBindAddr`
pull/9018/head^2
Binbin 1 year ago committed by GitHub
parent
commit
0bfccc55e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      .github/.codespellrc
  2. 2
      .github/ISSUE_TEMPLATE/crash_report.md
  3. 15
      .github/wordlist.txt
  4. 25
      .github/workflows/spell-check.yml
  5. 6
      CONTRIBUTING
  6. 4
      README.md
  7. 2
      sentinel.conf
  8. 6
      src/acl.c
  9. 6
      src/aof.c
  10. 4
      src/bitops.c
  11. 2
      src/cli_common.c
  12. 4
      src/cli_common.h
  13. 4
      src/cluster.c
  14. 2
      src/config.c
  15. 2
      src/connhelpers.h
  16. 2
      src/crcspeed.c
  17. 2
      src/db.c
  18. 2
      src/debug.c
  19. 2
      src/evict.c
  20. 8
      src/geo.c
  21. 2
      src/geohash_helper.c
  22. 2
      src/hyperloglog.c
  23. 2
      src/intset.c
  24. 16
      src/listpack.c
  25. 2
      src/lolwut.c
  26. 2
      src/lolwut5.c
  27. 4
      src/lolwut6.c
  28. 138
      src/module.c
  29. 2
      src/modules/hellodict.c
  30. 2
      src/modules/hellotype.c
  31. 14
      src/networking.c
  32. 3
      src/notify.c
  33. 6
      src/object.c
  34. 4
      src/pubsub.c
  35. 20
      src/rax.c
  36. 12
      src/rdb.c
  37. 6
      src/redis-benchmark.c
  38. 4
      src/redis-check-rdb.c
  39. 14
      src/redis-cli.c
  40. 20
      src/replication.c
  41. 2
      src/rio.c
  42. 4
      src/scripting.c
  43. 8
      src/sds.c
  44. 6
      src/sentinel.c
  45. 24
      src/server.c
  46. 14
      src/server.h
  47. 2
      src/sort.c
  48. 2
      src/stream.h
  49. 22
      src/t_stream.c
  50. 10
      src/t_zset.c
  51. 2
      src/tls.c
  52. 6
      src/tracking.c
  53. 2
      src/util.h
  54. 16
      src/ziplist.c
  55. 8
      src/zipmap.c
  56. 2
      tests/cluster/tests/03-failover-loop.tcl
  57. 4
      tests/cluster/tests/08-update-msg.tcl
  58. 2
      tests/cluster/tests/12.1-replica-migration-3.tcl
  59. 4
      tests/cluster/tests/16-transactions-on-replica.tcl
  60. 8
      tests/cluster/tests/18-info.tcl
  61. 2
      tests/integration/corrupt-dump-fuzzer.tcl
  62. 4
      tests/integration/corrupt-dump.tcl
  63. 2
      tests/integration/psync2.tcl
  64. 2
      tests/integration/rdb.tcl
  65. 2
      tests/integration/replication.tcl
  66. 2
      tests/modules/commandfilter.c
  67. 2
      tests/modules/keyspace_events.c
  68. 2
      tests/modules/propagate.c
  69. 2
      tests/sentinel/tests/07-down-conditions.tcl
  70. 4
      tests/support/server.tcl
  71. 2
      tests/support/util.tcl
  72. 2
      tests/unit/introspection.tcl
  73. 2
      tests/unit/memefficiency.tcl
  74. 2
      tests/unit/moduleapi/auth.tcl
  75. 4
      tests/unit/moduleapi/misc.tcl
  76. 2
      tests/unit/multi.tcl
  77. 2
      tests/unit/obuf-limits.tcl
  78. 2
      tests/unit/scripting.tcl
  79. 2
      tests/unit/type/stream-cgroups.tcl
  80. 2
      utils/lru/lfu-simulation.c
  81. 2
      utils/redis-sha1.rb
  82. 2
      utils/speed-regression.tcl
  83. 2
      utils/srandmember/showfreq.rb
  84. 4
      utils/tracking_collisions.c

5
.github/.codespellrc

@ -0,0 +1,5 @@
[codespell]
quiet-level = 2
count =
skip = ./deps,./src/crc16_slottable.h
ignore-words = ./.github/wordlist.txt

2
.github/ISSUE_TEMPLATE/crash_report.md

@ -14,7 +14,7 @@ Paste the complete crash log between the quotes below. Please include a few line
```
```
**Aditional information**
**Additional information**
1. OS distribution and version
2. Steps to reproduce (if any)

15
.github/wordlist.txt

@ -0,0 +1,15 @@
ake
bale
fle
fo
gameboy
mutli
nd
nees
oll
optin
ot
smove
te
tre
cancelability

25
.github/workflows/spell-check.yml

@ -0,0 +1,25 @@
# A CI action that using codespell to check spell.
# .github/.codespellrc is a config file.
# .github/wordlist.txt is a list of words that will ignore word checks.
# More details please check the following link:
# https://github.com/codespell-project/codespell
name: Spellcheck
on:
push:
pull_request:
jobs:
build:
name: Spellcheck
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install prerequisites
run: sudo pip install codespell==2.0.0
- name: Spell check
run: codespell --config=./.github/.codespellrc

6
CONTRIBUTING

@ -18,7 +18,7 @@ all the support in the mailing list.
There is also an active community of Redis users at Stack Overflow:
http://stackoverflow.com/questions/tagged/redis
https://stackoverflow.com/questions/tagged/redis
Issues and pull requests for documentation belong on the redis-doc repo:
@ -38,10 +38,10 @@ Here you'll see if there is consensus about your idea.
2. If in step 1 you get an acknowledgment from the project leaders, use the
following procedure to submit a patch:
a. Fork Redis on github ( http://help.github.com/fork-a-repo/ )
a. Fork Redis on github ( https://docs.github.com/en/github/getting-started-with-github/fork-a-repo )
b. Create a topic branch (git checkout -b my_branch)
c. Push to your branch (git push origin my_branch)
d. Initiate a pull request on github ( https://help.github.com/articles/creating-a-pull-request/ )
d. Initiate a pull request on github ( https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request )
e. Done :)
3. Keep in mind that we are very overloaded, so issues and PRs sometimes wait

4
README.md

@ -380,8 +380,8 @@ aof.c and rdb.c
As you can guess from the names, these files implement the RDB and AOF
persistence for Redis. Redis uses a persistence model based on the `fork()`
system call in order to create a thread with the same (shared) memory
content of the main Redis thread. This secondary thread dumps the content
system call in order to create a process with the same (shared) memory
content of the main Redis process. This secondary process dumps the content
of the memory on disk. This is used by `rdb.c` to create the snapshots
on disk and by `aof.c` in order to perform the AOF rewrite when the
append only file gets too big.

2
sentinel.conf

@ -178,7 +178,7 @@ acllog-max-len 128
# incoming connections (via ACL), and for outgoing connections (via
# sentinel-user and sentinel-pass)
#
# The requirepass is not compatable with aclfile option and the ACL LOAD
# The requirepass is not compatible with aclfile option and the ACL LOAD
# command, these will cause requirepass to be ignored.
# sentinel sentinel-user <username>

6
src/acl.c

@ -1363,7 +1363,7 @@ int ACLCheckPubsubPerm(client *c, int idx, int count, int literal, int *idxptr)
}
/* Check whether the command is ready to be exceuted by ACLCheckCommandPerm.
/* Check whether the command is ready to be executed by ACLCheckCommandPerm.
* If check passes, then check whether pub/sub channels of the command is
* ready to be executed by ACLCheckPubsubPerm */
int ACLCheckAllPerm(client *c, int *idxptr) {
@ -2254,8 +2254,8 @@ void authCommand(client *c) {
* will just use "default" as username. */
robj *username, *password;
if (c->argc == 2) {
/* Mimic the old behavior of giving an error for the two commands
* from if no password is configured. */
/* Mimic the old behavior of giving an error for the two argument
* form if no password is configured. */
if (DefaultUser->flags & USER_FLAG_NOPASS) {
addReplyError(c,"AUTH <password> called without any password "
"configured for the default user. Are you sure "

6
src/aof.c

@ -419,7 +419,7 @@ void flushAppendOnlyFile(int force) {
* than two seconds this is still ok. Postpone again. */
return;
}
/* Otherwise fall trough, and go write since we can't wait
/* Otherwise fall through, and go write since we can't wait
* over two seconds. */
server.aof_delayed_fsync++;
serverLog(LL_NOTICE,"Asynchronous AOF fsync is taking too long (disk is busy?). Writing the AOF buffer without waiting for fsync to complete, this may slow down Redis.");
@ -1745,7 +1745,7 @@ int rewriteAppendOnlyFileBackground(void) {
server.aof_rewrite_scheduled = 0;
server.aof_rewrite_time_start = time(NULL);
/* We set appendseldb to -1 in order to force the next call to the
/* We set aof_selected_db to -1 in order to force the next call to the
* feedAppendOnlyFile() to issue a SELECT command, so the differences
* accumulated by the parent into server.aof_rewrite_buf will start
* with a SELECT statement and it will be safe to merge. */
@ -1885,7 +1885,7 @@ void backgroundRewriteDoneHandler(int exitcode, int bysignal) {
oldfd = open(server.aof_filename,O_RDONLY|O_NONBLOCK);
} else {
/* AOF enabled */
oldfd = -1; /* We'll set this to the current AOF filedes later. */
oldfd = -1; /* We'll set this to the current AOF file descriptor later. */
}
/* Rename the temporary file. This will not unlink the target file if

4
src/bitops.c

@ -472,7 +472,7 @@ int getBitfieldTypeFromArgument(client *c, robj *o, int *sign, int *bits) {
return C_OK;
}
/* This is an helper function for commands implementations that need to write
/* This is a helper function for commands implementations that need to write
* bits to a string object. The command creates or pad with zeroes the string
* so that the 'maxbit' bit can be addressed. The object is finally
* returned. Otherwise if the key holds a wrong type NULL is returned and
@ -1025,7 +1025,7 @@ void bitfieldGeneric(client *c, int flags) {
return;
}
/* Lookup by making room up to the farest bit reached by
/* Lookup by making room up to the farthest bit reached by
* this operation. */
if ((o = lookupStringForBitCommand(c,
highest_write_offset)) == NULL) {

2
src/cli_common.c

@ -166,7 +166,7 @@ ssize_t cliWriteConn(redisContext *c, const char *buf, size_t buf_len)
*
* Do we still have data that was there prior to our buf? If so,
* restore buffer to it's original state and report no new data was
* writen.
* written.
*/
if (sdslen(c->obuf) > buf_len) {
sdsrange(c->obuf, 0, -(buf_len+1));

4
src/cli_common.h

@ -16,9 +16,9 @@ typedef struct cliSSLconfig {
char *cert;
/* Private key file to authenticate with, or NULL */
char *key;
/* Prefered cipher list, or NULL (applies only to <= TLSv1.2) */
/* Preferred cipher list, or NULL (applies only to <= TLSv1.2) */
char* ciphers;
/* Prefered ciphersuites list, or NULL (applies only to TLSv1.3) */
/* Preferred ciphersuites list, or NULL (applies only to TLSv1.3) */
char* ciphersuites;
} cliSSLconfig;

4
src/cluster.c

@ -1185,7 +1185,7 @@ void clusterHandleConfigEpochCollision(clusterNode *sender) {
* CLUSTER nodes blacklist
*
* The nodes blacklist is just a way to ensure that a given node with a given
* Node ID is not readded before some time elapsed (this time is specified
* Node ID is not re-added before some time elapsed (this time is specified
* in seconds in CLUSTER_BLACKLIST_TTL).
*
* This is useful when we want to remove a node from the cluster completely:
@ -4203,7 +4203,7 @@ sds clusterGenNodeDescription(clusterNode *node, int use_pport) {
"connected" : "disconnected");
/* Slots served by this instance. If we already have slots info,
* append it diretly, otherwise, generate slots only if it has. */
* append it directly, otherwise, generate slots only if it has. */
if (node->slots_info) {
ci = sdscatsds(ci, node->slots_info);
} else if (node->numslots > 0) {

2
src/config.c

@ -581,7 +581,7 @@ void loadServerConfigFromString(char *config) {
int flags = keyspaceEventsStringToFlags(argv[1]);
if (flags == -1) {
err = "Invalid event class character. Use 'g$lshzxeA'.";
err = "Invalid event class character. Use 'Ag$lshzxeKEtmd'.";
goto loaderr;
}
server.notify_keyspace_events = flags;

2
src/connhelpers.h

@ -41,7 +41,7 @@
* of connections from within a handler.
*/
/* Incremenet connection references.
/* Increment connection references.
*
* Inside a connection handler, we guarantee refs >= 1 so it is always
* safe to connClose().

2
src/crcspeed.c

@ -248,7 +248,7 @@ uint16_t crcspeed16big(uint16_t big_table[8][256], uint16_t crc_in, void *buf,
/* Return the CRC of buf[0..len-1] with initial crc, processing eight bytes
at a time using passed-in lookup table.
This selects one of two routines depending on the endianess of
This selects one of two routines depending on the endianness of
the architecture. */
uint64_t crcspeed64native(uint64_t table[8][256], uint64_t crc, void *buf,
size_t len) {

2
src/db.c

@ -295,7 +295,7 @@ robj *dbRandomKey(redisDb *db) {
* it could happen that all the keys are already logically
* expired in the slave, so the function cannot stop because
* expireIfNeeded() is false, nor it can stop because
* dictGetRandomKey() returns NULL (there are keys to return).
* dictGetFairRandomKey() returns NULL (there are keys to return).
* To prevent the infinite loop we do some tries, but if there
* are the conditions for an infinite loop, eventually we
* return a key name that may be already expired. */

2
src/debug.c

@ -1980,7 +1980,7 @@ void disableWatchdog(void) {
* of microseconds, i.e. -10 means 100 nanoseconds. */
void debugDelay(int usec) {
/* Since even the shortest sleep results in context switch and system call,
* the way we achive short sleeps is by statistically sleeping less often. */
* the way we achieve short sleeps is by statistically sleeping less often. */
if (usec < 0) usec = (rand() % -usec) == 0 ? 1: 0;
if (usec) usleep(usec);
}

2
src/evict.c

@ -133,7 +133,7 @@ void evictionPoolAlloc(void) {
EvictionPoolLRU = ep;
}
/* This is an helper function for performEvictions(), it is used in order
/* This is a helper function for performEvictions(), it is used in order
* to populate the evictionPool with a few entries every time we want to
* expire a key. Keys with idle time bigger than one of the current
* keys are added. Keys are always added if there are free entries.

8
src/geo.c

@ -213,7 +213,7 @@ void addReplyDoubleDistance(client *c, double d) {
* representing a point, and a GeoShape, appends this entry as a geoPoint
* into the specified geoArray only if the point is within the search area.
*
* returns C_OK if the point is included, or REIDS_ERR if it is outside. */
* returns C_OK if the point is included, or C_ERR if it is outside. */
int geoAppendIfWithinShape(geoArray *ga, GeoShape *shape, double score, sds member) {
double distance = 0, xy[2];
@ -241,10 +241,10 @@ int geoAppendIfWithinShape(geoArray *ga, GeoShape *shape, double score, sds memb
}
/* Query a Redis sorted set to extract all the elements between 'min' and
* 'max', appending them into the array of geoPoint structures 'gparray'.
* 'max', appending them into the array of geoPoint structures 'geoArray'.
* The command returns the number of elements added to the array.
*
* Elements which are farest than 'radius' from the specified 'x' and 'y'
* Elements which are farther than 'radius' from the specified 'x' and 'y'
* coordinates are not included.
*
* The ability of this function to append to an existing set of points is
@ -330,7 +330,7 @@ void scoresOfGeoHashBox(GeoHashBits hash, GeoHashFix52Bits *min, GeoHashFix52Bit
*
* To get the min score we just use the initial hash value left
* shifted enough to get the 52 bit value. Later we increment the
* 6 bit prefis (see the hash.bits++ statement), and get the new
* 6 bit prefix (see the hash.bits++ statement), and get the new
* prefix: 101011, which we align again to 52 bits to get the maximum
* value (which is excluded from the search). So we get everything
* between the two following scores (represented in binary):

2
src/geohash_helper.c

@ -216,7 +216,7 @@ GeoHashFix52Bits geohashAlign52Bits(const GeoHashBits hash) {
return bits;
}
/* Calculate distance using haversin great circle distance formula. */
/* Calculate distance using haversine great circle distance formula. */
double geohashGetDistance(double lon1d, double lat1d, double lon2d, double lat2d) {
double lat1r, lon1r, lat2r, lon2r, u, v;
lat1r = deg_rad(lat1d);

2
src/hyperloglog.c

@ -899,7 +899,7 @@ promote: /* Promote to dense representation. */
* the element belongs to is incremented if needed.
*
* This function is actually a wrapper for hllSparseSet(), it only performs
* the hashshing of the element to obtain the index and zeros run length. */
* the hashing of the element to obtain the index and zeros run length. */
int hllSparseAdd(robj *o, unsigned char *ele, size_t elesize) {
long index;
uint8_t count = hllPatLen(ele,elesize,&index);

2
src/intset.c

@ -306,7 +306,7 @@ int intsetValidateIntegrity(const unsigned char *p, size_t size, int deep) {
return 0;
}
/* check that the size matchies (all records are inside the buffer). */
/* check that the size matches (all records are inside the buffer). */
uint32_t count = intrev32ifbe(is->length);
if (sizeof(*is) + count*record_size != size)
return 0;

16
src/listpack.c

@ -116,7 +116,7 @@
(p)[5] = ((v)>>8)&0xff; \
} while(0)
/* Validates that 'p' is not ouside the listpack.
/* Validates that 'p' is not outside the listpack.
* All function that return a pointer to an element in the listpack will assert
* that this element is valid, so it can be freely used.
* Generally functions such lpNext and lpDelete assume the input pointer is
@ -125,7 +125,7 @@
assert((p) >= (lp)+LP_HDR_SIZE && (p) < (lp)+lpGetTotalBytes((lp))); \
} while (0)
/* Similar to the above, but validates the entire element lenth rather than just
/* Similar to the above, but validates the entire element length rather than just
* it's pointer. */
#define ASSERT_INTEGRITY_LEN(lp, p, len) do { \
assert((p) >= (lp)+LP_HDR_SIZE && (p)+(len) < (lp)+lpGetTotalBytes((lp))); \
@ -218,7 +218,7 @@ int lpStringToInt64(const char *s, unsigned long slen, int64_t *value) {
/* Create a new, empty listpack.
* On success the new listpack is returned, otherwise an error is returned.
* Pre-allocate at least `capacity` bytes of memory,
* over-allocated memory can be shrinked by `lpShrinkToFit`.
* over-allocated memory can be shrunk by `lpShrinkToFit`.
* */
unsigned char *lpNew(size_t capacity) {
unsigned char *lp = lp_malloc(capacity > LP_HDR_SIZE+1 ? capacity : LP_HDR_SIZE+1);
@ -416,7 +416,7 @@ uint32_t lpCurrentEncodedSizeUnsafe(unsigned char *p) {
}
/* Return bytes needed to encode the length of the listpack element pointed by 'p'.
* This includes just the encodign byte, and the bytes needed to encode the length
* This includes just the encoding byte, and the bytes needed to encode the length
* of the element (excluding the element data itself)
* If the element encoding is wrong then 0 is returned. */
uint32_t lpCurrentEncodedSizeBytes(unsigned char *p) {
@ -641,7 +641,7 @@ unsigned char *lpGet(unsigned char *p, int64_t *count, unsigned char *intbuf) {
*
* If 'newp' is not NULL, at the end of a successful call '*newp' will be set
* to the address of the element just added, so that it will be possible to
* continue an interation with lpNext() and lpPrev().
* continue an interaction with lpNext() and lpPrev().
*
* For deletion operations ('ele' set to NULL) 'newp' is set to the next
* element, on the right of the deleted one, or to NULL if the deleted element
@ -879,7 +879,7 @@ int lpValidateNext(unsigned char *lp, unsigned char **pp, size_t lpbytes) {
if (!lenbytes)
return 0;
/* make sure the encoded entry length doesn't rech outside the edge of the listpack */
/* make sure the encoded entry length doesn't reach outside the edge of the listpack */
if (OUT_OF_RANGE(p + lenbytes))
return 0;
@ -888,7 +888,7 @@ int lpValidateNext(unsigned char *lp, unsigned char **pp, size_t lpbytes) {
unsigned long encodedBacklen = lpEncodeBacklen(NULL,entrylen);
entrylen += encodedBacklen;
/* make sure the entry doesn't rech outside the edge of the listpack */
/* make sure the entry doesn't reach outside the edge of the listpack */
if (OUT_OF_RANGE(p + entrylen))
return 0;
@ -925,7 +925,7 @@ int lpValidateIntegrity(unsigned char *lp, size_t size, int deep){
if (!deep)
return 1;
/* Validate the invividual entries. */
/* Validate the individual entries. */
uint32_t count = 0;
unsigned char *p = lpFirst(lp);
while(p) {

2
src/lolwut.c

@ -84,7 +84,7 @@ void lolwutCommand(client *c) {
}
}
/* ========================== LOLWUT Canvase ===============================
/* ========================== LOLWUT Canvas ===============================
* Many LOLWUT versions will likely print some computer art to the screen.
* This is the case with LOLWUT 5 and LOLWUT 6, so here there is a generic
* canvas implementation that can be reused. */

2
src/lolwut5.c

@ -102,7 +102,7 @@ lwCanvas *lwDrawSchotter(int console_cols, int squares_per_row, int squares_per_
}
/* Converts the canvas to an SDS string representing the UTF8 characters to
* print to the terminal in order to obtain a graphical representaiton of the
* print to the terminal in order to obtain a graphical representation of the
* logical canvas. The actual returned string will require a terminal that is
* width/2 large and height/4 tall in order to hold the whole image without
* overflowing or scrolling, since each Barille character is 2x4. */

4
src/lolwut6.c

@ -32,7 +32,7 @@
* fun and interesting, and should be replaced by a new implementation at
* each new version of Redis.
*
* Thanks to Michele Hiki Falcone for the original image that ispired
* Thanks to Michele Hiki Falcone for the original image that inspired
* the image, part of his game, Plaguemon.
*
* Thanks to the Shhh computer art collective for the help in tuning the
@ -180,7 +180,7 @@ void lolwut6Command(client *c) {
return;
/* Limits. We want LOLWUT to be always reasonably fast and cheap to execute
* so we have maximum number of columns, rows, and output resulution. */
* so we have maximum number of columns, rows, and output resolution. */
if (cols < 1) cols = 1;
if (cols > 1000) cols = 1000;
if (rows < 1) rows = 1;

138
src/module.c

@ -851,7 +851,7 @@ int64_t commandFlagsFromString(char *s) {
* other reason.
* * **"no-auth"**: This command can be run by an un-authenticated client.
* Normally this is used by a command that is used
* to authenticate a client.
* to authenticate a client.
* * **"may-replicate"**: This command may generate replication traffic, even
* though it's not a write command.
*
@ -962,7 +962,7 @@ long long RM_Milliseconds(void) {
* the elapsed execution time when RM_BlockedClientMeasureTimeEnd() is called.
* Within the same command, you can call multiple times
* RM_BlockedClientMeasureTimeStart() and RM_BlockedClientMeasureTimeEnd()
* to accummulate indepedent time intervals to the background duration.
* to accumulate independent time intervals to the background duration.
* This method always return REDISMODULE_OK. */
int RM_BlockedClientMeasureTimeStart(RedisModuleBlockedClient *bc) {
elapsedStart(&(bc->background_timer));
@ -1277,19 +1277,19 @@ void RM_RetainString(RedisModuleCtx *ctx, RedisModuleString *str) {
* The main difference between the two is that this function will always
* succeed, whereas RedisModule_RetainString() may fail because of an
* assertion.
*
*
* The function returns a pointer to RedisModuleString, which is owned
* by the caller. It requires a call to RedisModule_FreeString() to free
* the string when automatic memory management is disabled for the context.
* When automatic memory management is enabled, you can either call
* RedisModule_FreeString() or let the automation free it.
*
*
* This function is more efficient than RedisModule_CreateStringFromString()
* because whenever possible, it avoids copying the underlying
* RedisModuleString. The disadvantage of using this function is that it
* might not be possible to use RedisModule_StringAppendBuffer() on the
* returned RedisModuleString.
*
*
* It is possible to call this function with a NULL context.
*/
RedisModuleString* RM_HoldString(RedisModuleCtx *ctx, RedisModuleString *str) {
@ -1555,7 +1555,7 @@ int RM_ReplyWithArray(RedisModuleCtx *ctx, long len) {
return REDISMODULE_OK;
}
/* Reply to the client with a null array, simply null in RESP3
/* Reply to the client with a null array, simply null in RESP3
* null array in RESP2.
*
* The function always returns REDISMODULE_OK. */
@ -1566,7 +1566,7 @@ int RM_ReplyWithNullArray(RedisModuleCtx *ctx) {
return REDISMODULE_OK;
}
/* Reply to the client with an empty array.
/* Reply to the client with an empty array.
*
* The function always returns REDISMODULE_OK. */
int RM_ReplyWithEmptyArray(RedisModuleCtx *ctx) {
@ -1664,7 +1664,7 @@ int RM_ReplyWithEmptyString(RedisModuleCtx *ctx) {
return REDISMODULE_OK;
}
/* Reply with a binary safe string, which should not be escaped or filtered
/* Reply with a binary safe string, which should not be escaped or filtered
* taking in input a C buffer pointer and length.
*
* The function always returns REDISMODULE_OK. */
@ -1882,7 +1882,7 @@ unsigned long long RM_GetClientId(RedisModuleCtx *ctx) {
/* Return the ACL user name used by the client with the specified client ID.
* Client ID can be obtained with RM_GetClientId() API. If the client does not
* exist, NULL is returned and errno is set to ENOENT. If the client isn't
* exist, NULL is returned and errno is set to ENOENT. If the client isn't
* using an ACL user, NULL is returned and errno is set to ENOTSUP */
RedisModuleString *RM_GetClientUserNameById(RedisModuleCtx *ctx, uint64_t id) {
client *client = lookupClientByID(id);
@ -1902,7 +1902,7 @@ RedisModuleString *RM_GetClientUserNameById(RedisModuleCtx *ctx, uint64_t id) {
return str;
}
/* This is an helper for RM_GetClientInfoById() and other functions: given
/* This is a helper for RM_GetClientInfoById() and other functions: given
* a client, it populates the client info structure with the appropriate
* fields depending on the version provided. If the version is not valid
* then REDISMODULE_ERR is returned. Otherwise the function returns
@ -1935,7 +1935,7 @@ int modulePopulateClientInfoStructure(void *ci, client *client, int structver) {
return REDISMODULE_OK;
}
/* This is an helper for moduleFireServerEvent() and other functions:
/* This is a helper for moduleFireServerEvent() and other functions:
* It populates the replication info structure with the appropriate
* fields depending on the version provided. If the version is not valid
* then REDISMODULE_ERR is returned. Otherwise the function returns
@ -2354,7 +2354,7 @@ int RM_UnlinkKey(RedisModuleKey *key) {
* REDISMODULE_NO_EXPIRE is returned. */
mstime_t RM_GetExpire(RedisModuleKey *key) {
mstime_t expire = getExpire(key->db,key->key);
if (expire == -1 || key->value == NULL)
if (expire == -1 || key->value == NULL)
return REDISMODULE_NO_EXPIRE;
expire -= mstime();
return expire >= 0 ? expire : 0;
@ -2386,7 +2386,7 @@ int RM_SetExpire(RedisModuleKey *key, mstime_t expire) {
* REDISMODULE_NO_EXPIRE is returned. */
mstime_t RM_GetAbsExpire(RedisModuleKey *key) {
mstime_t expire = getExpire(key->db,key->key);
if (expire == -1 || key->value == NULL)
if (expire == -1 || key->value == NULL)
return REDISMODULE_NO_EXPIRE;
return expire;
}
@ -3049,8 +3049,8 @@ int RM_ZsetRangePrev(RedisModuleKey *key) {
*
* The function is variadic and the user must specify pairs of field
* names and values, both as RedisModuleString pointers (unless the
* CFIELD option is set, see later). At the end of the field/value-ptr pairs,
* NULL must be specified as last argument to signal the end of the arguments
* CFIELD option is set, see later). At the end of the field/value-ptr pairs,
* NULL must be specified as last argument to signal the end of the arguments
* in the variadic function.
*
* Example to set the hash argv[1] to the value argv[2]:
@ -3093,7 +3093,7 @@ int RM_ZsetRangePrev(RedisModuleKey *key) {
*
* The number of fields existing in the hash prior to the call, which have been
* updated (its old value has been replaced by a new value) or deleted. If the
* flag REDISMODULE_HASH_COUNT_ALL is set, insterted fields not previously
* flag REDISMODULE_HASH_COUNT_ALL is set, inserted fields not previously
* existing in the hash are also counted.
*
* If the return value is zero, `errno` is set (since Redis 6.2) as follows:
@ -3333,7 +3333,7 @@ int RM_StreamAdd(RedisModuleKey *key, int flags, RedisModuleStreamID *id, RedisM
return REDISMODULE_ERR;
}
/* Create key if necessery */
/* Create key if necessary */
int created = 0;
if (key->value == NULL) {
moduleCreateEmptyKey(key, REDISMODULE_KEYTYPE_STREAM);
@ -4147,9 +4147,9 @@ RedisModuleCallReply *RM_Call(RedisModuleCtx *ctx, const char *cmdname, const ch
if (getNodeByQuery(c,c->cmd,c->argv,c->argc,NULL,&error_code) !=
server.cluster->myself)
{
if (error_code == CLUSTER_REDIR_DOWN_RO_STATE) {
if (error_code == CLUSTER_REDIR_DOWN_RO_STATE) {
errno = EROFS;
} else if (error_code == CLUSTER_REDIR_DOWN_STATE) {
} else if (error_code == CLUSTER_REDIR_DOWN_STATE) {
errno = ENETDOWN;
} else {
errno = EPERM;
@ -4470,7 +4470,7 @@ robj *moduleTypeDupOrReply(client *c, robj *fromkey, robj *tokey, robj *value) {
* to have significant internal complexity. To determine this, the defrag mechanism
* uses the free_effort callback and the 'active-defrag-max-scan-fields' config directive.
* NOTE: The value is passed as a `void**` and the function is expected to update the
* pointer if the top-level value pointer is defragmented and consequentially changes.
* pointer if the top-level value pointer is defragmented and consequently changes.
*
* Note: the module name "AAAAAAAAA" is reserved and produces an error, it
* happens to be pretty lame as well.
@ -4925,7 +4925,7 @@ ssize_t rdbSaveModulesAux(rio *rdb, int when) {
* foreach key,value {
* AddElement(key);
* AddElement(value);
* EndSquence();
* EndSequence();
* }
*
* Because the key and value will be always in the above order, while instead
@ -5832,7 +5832,7 @@ void moduleReleaseGIL(void) {
* etc), and the subscriber callback receives only events that match a specific
* mask of event types.
*
* When subscribing to notifications with RedisModule_SubscribeToKeyspaceEvents
* When subscribing to notifications with RedisModule_SubscribeToKeyspaceEvents
* the module must provide an event type-mask, denoting the events the subscriber
* is interested in. This can be an ORed mask of any of the following flags:
*
@ -6058,13 +6058,13 @@ int RM_SendClusterMessage(RedisModuleCtx *ctx, char *target_id, uint8_t type, un
}
/* Return an array of string pointers, each string pointer points to a cluster
* node ID of exactly REDISMODULE_NODE_ID_SIZE bytes (without any null term).
* node ID of exactly REDISMODULE_NODE_ID_LEN bytes (without any null term).
* The number of returned node IDs is stored into `*numnodes`.
* However if this function is called by a module not running an a Redis
* instance with Redis Cluster enabled, NULL is returned instead.
*
* The IDs returned can be used with RedisModule_GetClusterNodeInfo() in order
* to get more information about single nodes.
* to get more information about single node.
*
* The array returned by this function must be freed using the function
* RedisModule_FreeClusterNodesList().
@ -6074,7 +6074,7 @@ int RM_SendClusterMessage(RedisModuleCtx *ctx, char *target_id, uint8_t type, un
* size_t count, j;
* char **ids = RedisModule_GetClusterNodesList(ctx,&count);
* for (j = 0; j < count; j++) {
* RedisModule_Log("notice","Node %.*s",
* RedisModule_Log(ctx,"notice","Node %.*s",
* REDISMODULE_NODE_ID_LEN,ids[j]);
* }
* RedisModule_FreeClusterNodesList(ids);
@ -6386,20 +6386,20 @@ int RM_GetTimerInfo(RedisModuleCtx *ctx, RedisModuleTimerID id, uint64_t *remain
/* --------------------------------------------------------------------------
* ## Modules ACL API
*
* Implements a hook into the authentication and authorization within Redis.
* Implements a hook into the authentication and authorization within Redis.
* --------------------------------------------------------------------------*/
/* This function is called when a client's user has changed and invokes the
* client's user changed callback if it was set. This callback should
* cleanup any state the module was tracking about this client.
*
* A client's user can be changed through the AUTH command, module
* cleanup any state the module was tracking about this client.
*
* A client's user can be changed through the AUTH command, module
* authentication, and when a client is freed. */
void moduleNotifyUserChanged(client *c) {
if (c->auth_callback) {
c->auth_callback(c->id, c->auth_callback_privdata);
/* The callback will fire exactly once, even if the user remains
/* The callback will fire exactly once, even if the user remains
* the same. It is expected to completely clean up the state
* so all references are cleared here. */
c->auth_callback = NULL;
@ -6439,7 +6439,7 @@ static void moduleFreeAuthenticatedClients(RedisModule *module) {
if (!c->auth_module) continue;
RedisModule *auth_module = (RedisModule *) c->auth_module;
if (auth_module == module) {
if (auth_module == module) {
revokeClientAuthentication(c);
}
}
@ -6483,37 +6483,37 @@ int RM_FreeModuleUser(RedisModuleUser *user) {
return REDISMODULE_OK;
}
/* Sets the permissions of a user created through the redis module
* interface. The syntax is the same as ACL SETUSER, so refer to the
/* Sets the permissions of a user created through the redis module
* interface. The syntax is the same as ACL SETUSER, so refer to the
* documentation in acl.c for more information. See RM_CreateModuleUser
* for detailed usage.
*
*
* Returns REDISMODULE_OK on success and REDISMODULE_ERR on failure
* and will set an errno describing why the operation failed. */
int RM_SetModuleUserACL(RedisModuleUser *user, const char* acl) {
return ACLSetUser(user->user, acl, -1);
}
/* Authenticate the client associated with the context with
/* Authenticate the client associated with the context with
* the provided user. Returns REDISMODULE_OK on success and
* REDISMODULE_ERR on error.
*
*
* This authentication can be tracked with the optional callback and private
* data fields. The callback will be called whenever the user of the client
* changes. This callback should be used to cleanup any state that is being
* kept in the module related to the client authentication. It will only be
* called once, even when the user hasn't changed, in order to allow for a
* new callback to be specified. If this authentication does not need to be
* tracked, pass in NULL for the callback and privdata.
*
* tracked, pass in NULL for the callback and privdata.
*
* If client_id is not NULL, it will be filled with the id of the client
* that was authenticated. This can be used with the
* RM_DeauthenticateAndCloseClient() API in order to deauthenticate a
* previously authenticated client if the authentication is no longer valid.
*
* that was authenticated. This can be used with the
* RM_DeauthenticateAndCloseClient() API in order to deauthenticate a
* previously authenticated client if the authentication is no longer valid.
*
* For expensive authentication operations, it is recommended to block the
* client and do the authentication in the background and then attach the user
* to the client in a threadsafe context. */
* to the client in a threadsafe context. */
static int authenticateClientWithUser(RedisModuleCtx *ctx, user *user, RedisModuleUserChangedFunc callback, void *privdata, uint64_t *client_id) {
if (user->flags & USER_FLAG_DISABLED) {
return REDISMODULE_ERR;
@ -6543,18 +6543,18 @@ static int authenticateClientWithUser(RedisModuleCtx *ctx, user *user, RedisModu
}
/* Authenticate the current context's user with the provided redis acl user.
/* Authenticate the current context's user with the provided redis acl user.
* Returns REDISMODULE_ERR if the user is disabled.
*
*
* See authenticateClientWithUser for information about callback, client_id,
* and general usage for authentication. */
int RM_AuthenticateClientWithUser(RedisModuleCtx *ctx, RedisModuleUser *module_user, RedisModuleUserChangedFunc callback, void *privdata, uint64_t *client_id) {
return authenticateClientWithUser(ctx, module_user->user, callback, privdata, client_id);
}
/* Authenticate the current context's user with the provided redis acl user.
/* Authenticate the current context's user with the provided redis acl user.
* Returns REDISMODULE_ERR if the user is disabled or the user does not exist.
*
*
* See authenticateClientWithUser for information about callback, client_id,
* and general usage for authentication. */
int RM_AuthenticateClientWithACLUser(RedisModuleCtx *ctx, const char *name, size_t len, RedisModuleUserChangedFunc callback, void *privdata, uint64_t *client_id) {
@ -6567,15 +6567,15 @@ int RM_AuthenticateClientWithACLUser(RedisModuleCtx *ctx, const char *name, size
}
/* Deauthenticate and close the client. The client resources will not be
* be immediately freed, but will be cleaned up in a background job. This is
* the recommended way to deauthenicate a client since most clients can't
* be immediately freed, but will be cleaned up in a background job. This is
* the recommended way to deauthenticate a client since most clients can't
* handle users becoming deauthenticated. Returns REDISMODULE_ERR when the
* client doesn't exist and REDISMODULE_OK when the operation was successful.
*
* client doesn't exist and REDISMODULE_OK when the operation was successful.
*
* The client ID is returned from the RM_AuthenticateClientWithUser and
* RM_AuthenticateClientWithACLUser APIs, but can be obtained through
* the CLIENT api or through server events.
*
* the CLIENT api or through server events.
*
* This function is not thread safe, and must be executed within the context
* of a command or thread safe context. */
int RM_DeauthenticateAndCloseClient(RedisModuleCtx *ctx, uint64_t client_id) {
@ -6598,7 +6598,7 @@ int RM_DeauthenticateAndCloseClient(RedisModuleCtx *ctx, uint64_t client_id) {
*
* - Connection ID does not exist
* - Connection is not a TLS connection
* - Connection is a TLS connection but no client ceritifcate was used
* - Connection is a TLS connection but no client certificate was used
*/
RedisModuleString *RM_GetClientCertificate(RedisModuleCtx *ctx, uint64_t client_id) {
client *c = lookupClientByID(client_id);
@ -6698,7 +6698,7 @@ void *RM_DictGet(RedisModuleDict *d, RedisModuleString *key, int *nokey) {
}
/* Remove the specified key from the dictionary, returning REDISMODULE_OK if
* the key was found and delted, or REDISMODULE_ERR if instead there was
* the key was found and deleted, or REDISMODULE_ERR if instead there was
* no such key in the dictionary. When the operation is successful, if
* 'oldval' is not NULL, then '*oldval' is set to the value stored at the
* key before it was deleted. Using this feature it is possible to get
@ -6720,7 +6720,7 @@ int RM_DictDel(RedisModuleDict *d, RedisModuleString *key, void *oldval) {
* operators available are:
*
* * `^` -- Seek the first (lexicographically smaller) key.
* * `$` -- Seek the last (lexicographically biffer) key.
* * `$` -- Seek the last (lexicographically bigger) key.
* * `>` -- Seek the first element greater than the specified key.
* * `>=` -- Seek the first element greater or equal than the specified key.
* * `<` -- Seek the first element smaller than the specified key.
@ -6806,7 +6806,7 @@ void *RM_DictNextC(RedisModuleDictIter *di, size_t *keylen, void **dataptr) {
/* This function is exactly like RedisModule_DictNext() but after returning
* the currently selected element in the iterator, it selects the previous
* element (laxicographically smaller) instead of the next one. */
* element (lexicographically smaller) instead of the next one. */
void *RM_DictPrevC(RedisModuleDictIter *di, size_t *keylen, void **dataptr) {
if (!raxPrev(&di->ri)) return NULL;
if (keylen) *keylen = di->ri.key_len;
@ -6829,7 +6829,7 @@ RedisModuleString *RM_DictNext(RedisModuleCtx *ctx, RedisModuleDictIter *di, voi
}
/* Like RedisModule_DictNext() but after returning the currently selected
* element in the iterator, it selects the previous element (laxicographically
* element in the iterator, it selects the previous element (lexicographically
* smaller) instead of the next one. */
RedisModuleString *RM_DictPrev(RedisModuleCtx *ctx, RedisModuleDictIter *di, void **dataptr) {
size_t keylen;
@ -6841,7 +6841,7 @@ RedisModuleString *RM_DictPrev(RedisModuleCtx *ctx, RedisModuleDictIter *di, voi
/* Compare the element currently pointed by the iterator to the specified
* element given by key/keylen, according to the operator 'op' (the set of
* valid operators are the same valid for RedisModule_DictIteratorStart).
* If the comparision is successful the command returns REDISMODULE_OK
* If the comparison is successful the command returns REDISMODULE_OK
* otherwise REDISMODULE_ERR is returned.
*
* This is useful when we want to just emit a lexicographical range, so
@ -7308,7 +7308,7 @@ int moduleUnregisterUsedAPI(RedisModule *module) {
/* Unregister all filters registered by a module.
* This is called when a module is being unloaded.
*
*
* Returns the number of filters unregistered. */
int moduleUnregisterFilters(RedisModule *module) {
listIter li;
@ -7614,7 +7614,7 @@ void RM_ScanCursorDestroy(RedisModuleScanCursor *cursor) {
* RedisModule_ScanCursorDestroy(c);
*
* It is also possible to use this API from another thread while the lock
* is acquired during the actuall call to RM_Scan:
* is acquired during the actual call to RM_Scan:
*
* RedisModuleCursor *c = RedisModule_ScanCursorCreate();
* RedisModule_ThreadSafeContextLock(ctx);
@ -7711,7 +7711,7 @@ static void moduleScanKeyCallback(void *privdata, const dictEntry *de) {
* RedisModule_ScanCursorDestroy(c);
*
* It is also possible to use this API from another thread while the lock is acquired during
* the actuall call to RM_ScanKey, and re-opening the key each time:
* the actual call to RM_ScanKey, and re-opening the key each time:
*
* RedisModuleCursor *c = RedisModule_ScanCursorCreate();
* RedisModule_ThreadSafeContextLock(ctx);
@ -7813,7 +7813,7 @@ int RM_ScanKey(RedisModuleKey *key, RedisModuleScanCursor *cursor, RedisModuleSc
* ## Module fork API
* -------------------------------------------------------------------------- */
/* Create a background child process with the current frozen snaphost of the
/* Create a background child process with the current frozen snapshot of the
* main process where you can do some processing in the background without
* affecting / freezing the traffic and no need for threads and GIL locking.
* Note that Redis allows for only one concurrent fork.
@ -7973,7 +7973,7 @@ void ModuleForkDoneHandler(int exitcode, int bysignal) {
* The above events are triggered not just when the user calls the
* relevant commands like BGSAVE, but also when a saving operation
* or AOF rewriting occurs because of internal server triggers.
* The SYNC_RDB_START sub events are happening in the forground due to
* The SYNC_RDB_START sub events are happening in the foreground due to
* SAVE command, FLUSHALL, or server shutdown, and the other RDB and
* AOF sub events are executed in a background fork child, so any
* action the module takes can only affect the generated AOF or RDB,
@ -8001,7 +8001,7 @@ void ModuleForkDoneHandler(int exitcode, int bysignal) {
* int32_t dbnum; // Flushed database number, -1 for all the DBs
* // in the case of the FLUSHALL operation.
*
* The start event is called *before* the operation is initated, thus
* The start event is called *before* the operation is initiated, thus
* allowing the callback to call DBSIZE or other operation on the
* yet-to-free keyspace.
*
@ -8093,7 +8093,7 @@ void ModuleForkDoneHandler(int exitcode, int bysignal) {
*
* This event is called repeatedly called while an RDB or AOF file
* is being loaded.
* The following sub events are availble:
* The following sub events are available:
*
* * `REDISMODULE_SUBEVENT_LOADING_PROGRESS_RDB`
* * `REDISMODULE_SUBEVENT_LOADING_PROGRESS_AOF`
@ -8219,7 +8219,7 @@ int RM_IsSubEventSupported(RedisModuleEvent event, int64_t subevent) {
}
/* This is called by the Redis internals every time we want to fire an
* event that can be interceppted by some module. The pointer 'data' is useful
* event that can be intercepted by some module. The pointer 'data' is useful
* in order to populate the event-specific structure when needed, in order
* to return the structure with more information to the callback.
*
@ -8963,11 +8963,11 @@ int RM_ModuleTypeReplaceValue(RedisModuleKey *key, moduleType *mt, void *new_val
/* For a specified command, parse its arguments and return an array that
* contains the indexes of all key name arguments. This function is
* essnetially a more efficient way to do COMMAND GETKEYS.
* essentially a more efficient way to do COMMAND GETKEYS.
*
* A NULL return value indicates the specified command has no keys, or
* an error condition. Error conditions are indicated by setting errno
* as folllows:
* as follows:
*
* * ENOENT: Specified command does not exist.
* * EINVAL: Invalid command arity specified.

2
src/modules/hellodict.c

@ -88,7 +88,7 @@ int cmd_KEYRANGE(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
/* Reply with the matching items. */
char *key;
size_t keylen;
long long replylen = 0; /* Keep track of the amitted array len. */
long long replylen = 0; /* Keep track of the emitted array len. */
RedisModule_ReplyWithArray(ctx,REDISMODULE_POSTPONED_ARRAY_LEN);
while((key = RedisModule_DictNextC(iter,&keylen,NULL)) != NULL) {
if (replylen >= count) break;

2
src/modules/hellotype.c

@ -229,7 +229,7 @@ void HelloBlock_FreeData(RedisModuleCtx *ctx, void *privdata) {
RedisModule_Free(privdata);
}
/* HELLOTYPE.BRANGE key first count timeout -- This is a blocking verison of
/* HELLOTYPE.BRANGE key first count timeout -- This is a blocking version of
* the RANGE operation, in order to show how to use the API
* RedisModule_BlockClientOnKeys(). */
int HelloTypeBRange_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {

14
src/networking.c

@ -302,7 +302,7 @@ void _addReplyProtoToList(client *c, const char *s, size_t len) {
/* Note that 'tail' may be NULL even if we have a tail node, because when
* addReplyDeferredLen() is used, it sets a dummy node to NULL just
* fo fill it later, when the size of the bulk length is set. */
* to fill it later, when the size of the bulk length is set. */
/* Append to tail string when possible. */
if (tail) {
@ -1752,7 +1752,7 @@ int processInlineBuffer(client *c) {
/* Masters should never send us inline protocol to run actual
* commands. If this happens, it is likely due to a bug in Redis where
* we got some desynchronization in the protocol, for example
* beause of a PSYNC gone bad.
* because of a PSYNC gone bad.
*
* However the is an exception: masters may send us just a newline
* to keep the connection active. */
@ -1783,7 +1783,7 @@ int processInlineBuffer(client *c) {
return C_OK;
}
/* Helper function. Record protocol erro details in server log,
/* Helper function. Record protocol error details in server log,
* and set the client as CLIENT_CLOSE_AFTER_REPLY and
* CLIENT_PROTOCOL_ERROR. */
#define PROTO_DUMP_LEN 128
@ -2367,7 +2367,7 @@ sds getAllClientsInfoString(int type) {
/* This function implements CLIENT SETNAME, including replying to the
* user with an error if the charset is wrong (in that case C_ERR is
* returned). If the function succeeeded C_OK is returned, and it's up
* returned). If the function succeeded C_OK is returned, and it's up
* to the caller to send a reply if needed.
*
* Setting an empty string as name has the effect of unsetting the
@ -2484,7 +2484,7 @@ void clientCommand(client *c) {
"UNPAUSE",
" Stop the current client pause, resuming traffic.",
"PAUSE <timeout> [WRITE|ALL]",
" Suspend all, or just write, clients for <timout> milliseconds.",
" Suspend all, or just write, clients for <timeout> milliseconds.",
"REPLY (ON|OFF|SKIP)",
" Control the replies sent to the current connection.",
"SETNAME <name>",
@ -3312,7 +3312,7 @@ void flushSlavesOutputBuffers(void) {
*
* A main use case of this function is to allow pausing replication traffic
* so that a failover without data loss to occur. Replicas will continue to receive
* traffic to faciliate this functionality.
* traffic to facilitate this functionality.
*
* This function is also internally used by Redis Cluster for the manual
* failover procedure implemented by CLUSTER FAILOVER.