content
large_stringlengths
3
20.5k
url
large_stringlengths
53
192
branch
large_stringclasses
4 values
source
large_stringclasses
51 values
embeddings
listlengths
384
384
score
float64
-0.21
0.65
## Read-only scripts A read-only script is a script that only executes commands that don't modify any keys within Redis. Read-only scripts can be executed either by adding the `no-writes` [flag](/topics/lua-api#script\_flags) to the script or by executing the script with one of the read-only script command variants: `E...
https://github.com/redis/redis-doc/blob/master/docs/interact/programmability/_index.md
master
redis
[ -0.02806159108877182, -0.07335402071475983, -0.11396907269954681, 0.09218411892652512, 0.07200895249843597, -0.07066129148006439, 0.002492789411917329, 0.04506555572152138, 0.07416298985481262, 0.056262485682964325, 0.04429062083363533, 0.08880141377449036, -0.005763450171798468, -0.108008...
0.164741
and `SHUTDOWN NOSAVE`. \* It is possible to terminate a script that only executes read-only commands using the `SCRIPT KILL` and `FUNCTION KILL` commands. These commands do not violate the scripting semantic as no data was written to the dataset by the script yet. \* If the script had already performed even a single wr...
https://github.com/redis/redis-doc/blob/master/docs/interact/programmability/_index.md
master
redis
[ 0.018597645685076714, 0.08312907814979553, -0.026480967178940773, 0.03211573138833046, 0.026171470060944557, -0.024857524782419205, -0.038266897201538086, -0.02790151722729206, 0.03587102144956589, 0.08166507631540298, 0.029824234545230865, 0.1026405319571495, -0.018040837720036507, -0.101...
0.163515
This document provides information about how Redis handles clients at the network layer level: connections, timeouts, buffers, and other similar topics are covered here. The information contained in this document is \*\*only applicable to Redis version 2.6 or greater\*\*. ## Accepting Client Connections Redis accepts c...
https://github.com/redis/redis-doc/blob/master/docs/reference/clients.md
master
redis
[ -0.03887481987476349, -0.04040313512086868, -0.042299605906009674, 0.03844774514436722, -0.0032826089300215244, -0.02922048047184944, 0.02973412349820137, -0.036218512803316116, 0.08810272067785263, 0.0012091657845303416, -0.023378664627671242, 0.10569611191749573, 0.024482380598783493, -0...
0.147411
files limit to 100032 (Invalid argument), setting the max clients configuration to 10112. ``` When Redis is configured in order to handle a specific number of clients it is a good idea to make sure that the operating system limit for the maximum number of file descriptors per process is also set accordingly. Under Linu...
https://github.com/redis/redis-doc/blob/master/docs/reference/clients.md
master
redis
[ -0.020809438079595566, -0.03330555930733681, -0.08944597095251083, -0.02966015413403511, -0.001113434205763042, -0.07709221541881561, 0.0012719958322122693, 0.08609124273061752, 0.04464000090956688, 0.019605491310358047, -0.05852193757891655, 0.07843684405088425, 0.000931816000957042, -0.0...
0.118476
can be extremely high, leading to data eviction or out-of-memory errors. These cases can be mitigated to an extent using [output buffer limits](#output-buffer-limits), but Redis allows us a more robust configuration to limit the aggregate memory used by all clients' connections. This mechanism is called \*\*client evic...
https://github.com/redis/redis-doc/blob/master/docs/reference/clients.md
master
redis
[ 0.017185227945446968, -0.043848879635334015, -0.08108370751142502, 0.048900265246629715, -0.041450854390859604, -0.08481929451227188, 0.02739696204662323, 0.03936443105340004, 0.053743813186883926, 0.024344993755221367, -0.023522740229964256, 0.11307571828365326, 0.06617970019578934, -0.04...
0.107898
precise: Redis avoids setting timer events or running O(N) algorithms in order to check idle clients, so the check is performed incrementally from time to time. This means that it is possible that while the timeout is set to 10 seconds, the client connection will be closed, for instance, after 12 seconds if many client...
https://github.com/redis/redis-doc/blob/master/docs/reference/clients.md
master
redis
[ -0.012503174133598804, 0.02201871946454048, -0.13386182487010956, 0.048691652715206146, 0.0363803431391716, -0.05464077368378639, 0.05954570695757866, -0.010379364714026451, 0.07739946991205215, 0.0033337962813675404, -0.03128954768180847, 0.06385579705238342, -0.0006459848373197019, -0.04...
0.183257
Redis Sentinel is a monitoring solution for Redis instances that handles automatic failover of Redis masters and service discovery (who is the current master for a given group of instances?). Since Sentinel is both responsible for reconfiguring instances during failovers, and providing configurations to clients connect...
https://github.com/redis/redis-doc/blob/master/docs/reference/sentinel-clients.md
master
redis
[ -0.0432569719851017, -0.0942917987704277, 0.00297378096729517, 0.058850254863500595, 0.042811740189790726, -0.0704076737165451, 0.04998595640063286, -0.023004522547125816, 0.03405090048909187, 0.008036650717258453, -0.08842827379703522, 0.046914827078580856, 0.056308403611183167, -0.038488...
0.21444
in the list. Step 3: call the ROLE command in the target instance --- Once the client discovered the address of the master instance, it should attempt a connection with the master, and call the `ROLE` command in order to verify the role of the instance is actually a master. If the `ROLE` commands is not available (it w...
https://github.com/redis/redis-doc/blob/master/docs/reference/sentinel-clients.md
master
redis
[ -0.01101786270737648, -0.10228133946657181, -0.0191381573677063, 0.04047700762748718, 0.0008042276022024453, -0.06243782117962837, 0.014034708961844444, -0.04505384713411331, 0.013333913870155811, 0.004231676924973726, -0.020862095057964325, 0.07174823433160782, 0.08577339351177216, -0.002...
0.051921
case of errors. Specifically: \* If no Sentinel can be contacted (so that the client was never able to get the reply to `SENTINEL get-master-addr-by-name`), an error that clearly states that Redis Sentinel is unreachable should be returned. \* If all the Sentinels in the pool replied with a null reply, the user should ...
https://github.com/redis/redis-doc/blob/master/docs/reference/sentinel-clients.md
master
redis
[ -0.06376650184392929, -0.086258664727211, -0.00564764766022563, 0.0830836221575737, 0.0483354777097702, -0.08538150787353516, -0.004627417307347059, -0.018619069829583168, 0.012936553917825222, 0.0482880137860775, -0.02939695306122303, 0.0059709507040679455, 0.01725260354578495, -0.0334830...
0.176183
Redis versions 4.0 and above support the ARM processor in general, and the Raspberry Pi specifically, as a main platform. Every new release of Redis is tested on the Pi environment, and we update this documentation page with information about supported devices and other useful information. While Redis does run on Andro...
https://github.com/redis/redis-doc/blob/master/docs/reference/arm.md
master
redis
[ -0.033771008253097534, -0.020326625555753708, -0.020765583962202072, -0.01394415833055973, -0.0072373454459011555, -0.1027771532535553, -0.025601694360375404, 0.050007592886686325, 0.04601433873176575, -0.005775737576186657, -0.024488825350999832, 0.0677175372838974, 0.05320509150624275, -...
0.273876
21,000 ops/sec Raspberry Pi 1 model B: \* Test 1 : 5 millions writes with 1 million keys (even distribution among keys). No persistence, no pipelining. 2,200 ops/sec. \* Test 2: Like test 1 but with pipelining using groups of 8 operations: 8,500 ops/sec. \* Test 3: Like test 1 but with AOF enabled, fsync 1 sec: 1,820 o...
https://github.com/redis/redis-doc/blob/master/docs/reference/arm.md
master
redis
[ -0.01933586597442627, -0.06062944233417511, -0.0714583545923233, 0.05799116939306259, -0.08067145943641663, -0.13146734237670898, -0.06876736879348755, 0.02699124626815319, 0.036282557994127274, 0.006086410488933325, -0.005573950242251158, 0.08107369393110275, -0.010612787678837776, -0.091...
0.114778
Command tips are an array of strings. These provide Redis clients with additional information about the command. The information can instruct Redis Cluster clients as to how the command should be executed and its output processed in a clustered deployment. Unlike the command's flags (see the 3rd element of `COMMAND`'s ...
https://github.com/redis/redis-doc/blob/master/docs/reference/command-tips.md
master
redis
[ -0.022734610363841057, -0.06840421259403229, -0.05992893502116203, 0.0565481074154377, 0.03901849687099457, -0.06899844855070114, 0.10114376246929169, -0.0011306077940389514, 0.053354404866695404, -0.0019461001502349973, 0.05013681575655937, 0.007555238902568817, 0.03956326097249985, -0.09...
0.135766
should be as follows: 1. The command doesn't accept key name arguments: the client can aggregate all replies within a single nested data structure. For example, the array replies we get from calling `KEYS` against all shards. These should be packed in a single in no particular order. 1. For commands that accept one or ...
https://github.com/redis/redis-doc/blob/master/docs/reference/command-tips.md
master
redis
[ -0.019518190994858742, -0.013452793471515179, 0.02880895882844925, 0.024413466453552246, -0.03189147636294365, -0.050078168511390686, 0.07254965603351593, -0.011383146978914738, 0.06859534233808517, 0.05752786993980408, 0.0024179178290069103, -0.022938748821616173, 0.08821691572666168, -0....
0.108871
\*\* Note: Support for Gopher was removed in Redis 7.0 \*\* Redis contains an implementation of the Gopher protocol, as specified in the [RFC 1436](https://www.ietf.org/rfc/rfc1436.txt). The Gopher protocol was very popular in the late '90s. It is an alternative to the web, and the implementation both server and client...
https://github.com/redis/redis-doc/blob/master/docs/reference/gopher.md
master
redis
[ -0.13021500408649445, 0.04916086047887802, 0.0019399289740249515, -0.041759926825761795, -0.012775140814483166, -0.03455694019794464, -0.012009473517537117, -0.0311574749648571, 0.02614300511777401, 0.04042006656527519, 0.00843927264213562, 0.08647552877664566, 0.058330100029706955, 0.0272...
0.174182
This document provides information about how Redis reacts to different POSIX signals such as `SIGTERM` and `SIGSEGV`. The information in this document \*\*only applies to Redis version 2.6 or greater\*\*. ## SIGTERM and SIGINT The `SIGTERM` and `SIGINT` signals tell Redis to shut down gracefully. When the server receiv...
https://github.com/redis/redis-doc/blob/master/docs/reference/signals.md
master
redis
[ -0.037271443754434586, -0.04434247687458992, -0.0279680322855711, 0.06218690797686577, 0.04621439427137375, -0.06305048614740372, -0.009393777698278427, 0.03193699195981026, 0.11738660931587219, 0.016601750627160072, -0.04343743994832039, 0.09640969336032867, -0.040371693670749664, -0.0629...
0.166414
memory test is performed as a first check of the reliability of the crashing system. \* If the server was daemonized, the PID file is removed. \* Finally the server unregisters its own signal handler for the received signal and resends the same signal to itself to make sure that the default action is performed, such as...
https://github.com/redis/redis-doc/blob/master/docs/reference/signals.md
master
redis
[ -0.009691356681287289, -0.03390065208077431, -0.06568272411823273, 0.03421001881361008, 0.022446591407060623, -0.01650286093354225, -0.01885111816227436, 0.054677169770002365, 0.047000396996736526, 0.08461026847362518, 0.014834284782409668, 0.12145338207483292, 0.01609133556485176, -0.0591...
0.154259
Welcome to the \*\*Redis Cluster Specification\*\*. Here you'll find information about the algorithms and design rationales of Redis Cluster. This document is a work in progress as it is continuously synchronized with the actual implementation of Redis. ## Main properties and rationales of the design ### Redis Cluster ...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ -0.05347496271133423, -0.0280357263982296, -0.06082656979560852, 0.050603386014699936, 0.005241336300969124, -0.0670040026307106, -0.02641412615776062, 0.0040040952153503895, 0.018601587042212486, 0.043147772550582886, -0.05612083896994591, 0.06557991355657578, 0.08187489956617355, -0.0784...
0.233376
all the nodes in the cluster, getting redirected if needed, so the client is not required to hold the state of the cluster. However clients that are able to cache the map between keys and nodes can improve the performance in a sensible way. ### Write safety Redis Cluster uses asynchronous replication between nodes, and...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ 0.020422056317329407, -0.023373831063508987, 0.015199157409369946, 0.06631611287593842, 0.03443998470902443, -0.03706958144903183, -0.027084365487098694, 0.015038909390568733, 0.05508052185177803, 0.027909496799111366, -0.0585026741027832, 0.07197493314743042, 0.080654077231884, -0.0946082...
0.113251
However the minority side of a Redis Cluster will start refusing writes as soon as `NODE\_TIMEOUT` time has elapsed without contact with the majority, so there is a maximum window after which the minority becomes no longer available. Hence, no writes are accepted or lost after that time. ### Availability Redis Cluster ...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ -0.01712992787361145, -0.04740919545292854, 0.020215334370732307, 0.08900357037782669, 0.04714054614305496, -0.04770415276288986, -0.05926906317472458, 0.005089274607598782, 0.05123290792107582, 0.02163104899227619, -0.06210410222411156, 0.04448705166578293, 0.031234152615070343, -0.068567...
0.080421
are avoided The Redis Cluster design avoids conflicting versions of the same key-value pair in multiple nodes as in the case of the Redis data model this is not always desirable. Values in Redis are often very large; it is common to see lists or sorted sets with millions of elements. Also data types are semantically co...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ 0.010777589865028858, -0.06286261975765228, -0.05760108679533005, 0.003245101310312748, -0.008311821147799492, -0.07943493872880936, -0.0722118690609932, 0.0043673282489180565, 0.04083095118403435, -0.018336182460188866, -0.03842226788401604, 0.06775180995464325, 0.08988266438245773, -0.05...
0.106141
`{` character. \* AND IF there is a `}` character to the right of `{`. \* AND IF there are one or more characters between the first occurrence of `{` and the first occurrence of `}`. Then instead of hashing the key, only what is between the first occurrence of `{` and the following first occurrence of `}` is hashed. Ex...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ -0.023513728752732277, 0.010585611686110497, 0.017733285203576088, -0.09508726745843887, -0.07912953943014145, -0.02347017638385296, 0.05263572186231613, -0.010961772873997688, 0.026837926357984543, -0.023338615894317627, 0.053354088217020035, 0.04857600852847099, 0.15410369634628296, -0.1...
0.040325
} ### Cluster node attributes Every node has a unique name in the cluster. The node name is the hex representation of a 160 bit random number, obtained the first time a node is started (usually using /dev/urandom). The node will save its ID in the node configuration file, and will use the same ID forever, or at least a...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ -0.01688964292407036, 0.024571575224399567, 0.011275374330580235, 0.03875421732664108, 0.06695222854614258, 0.03161991015076637, 0.01797838881611824, -0.10112543404102325, 0.03877304121851921, 0.003200797364115715, -0.020767753943800926, 0.0485575832426548, 0.061939138919115067, -0.1035824...
0.22987
the Cluster bus protocol: a binary protocol composed of frames of different types and sizes. The Cluster bus binary protocol is not publicly documented since it is not intended for external software devices to talk with Redis Cluster nodes using this protocol. However you can obtain more details about the Cluster bus p...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ -0.0036594001576304436, -0.038393162190914154, -0.0584426149725914, 0.06964798271656036, 0.033208053559064865, -0.01958739385008812, 0.028067538514733315, -0.03105749748647213, 0.08319979906082153, -0.005398157984018326, -0.03486163914203644, 0.0361996553838253, 0.04522307217121124, -0.077...
0.229675
will check its internal hash slot to node map, and will reply to the client with a MOVED error, like in the following example: GET x -MOVED 3999 127.0.0.1:6381 The error includes the hash slot of the key (3999) and the endpoint:port of the instance that can serve the query. The client needs to reissue the query to the ...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ 0.003021023701876402, 0.029437409713864326, 0.018880972638726234, 0.04640644043684006, 0.02891439013183117, -0.007107047829777002, 0.029078705236315727, -0.03972587361931801, 0.038389336317777634, 0.014908543787896633, 0.01554778404533863, 0.01449348870664835, 0.0726044699549675, -0.092459...
0.148147
does during \*resharding\* is to move keys from an instance to another instance. Moving a hash slot means moving all the keys that happen to hash into this hash slot. To understand how this works we need to show the `CLUSTER` subcommands that are used to manipulate the slots translation table in a Redis Cluster node. T...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ 0.003985898569226265, -0.06038268655538559, -0.06361224502325058, -0.014470221474766731, -0.007003471255302429, -0.045385636389255524, 0.03536943718791008, -0.032886408269405365, -0.0015506964409723878, 0.012281158939003944, 0.045661959797143936, -0.011975943110883236, 0.05345418304204941, ...
0.165822
8 from A to B. This is performed using the following command: CLUSTER GETKEYSINSLOT slot count The above command will return `count` keys in the specified hash slot. For keys returned, `redis-cli` sends node "A" a `MIGRATE` command, that will migrate the specified keys from A to B in an atomic way (both instances are l...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ -0.003511197166517377, -0.07548832893371582, -0.09237596392631531, 0.009223761968314648, 0.0036633892450481653, -0.04591181501746178, -0.005859849043190479, -0.04957380145788193, 0.04662374407052994, -0.0026033027097582817, 0.0418907105922699, 0.03549380227923393, 0.09532558172941208, -0.1...
0.114715
the new endpoint and port pair. Note that if a buggy client performs the map earlier this is not a problem since it will not send the ASKING command before issuing the query, so B will redirect the client to A using a MOVED redirection error. Slots migration is explained in similar terms but with different wording (for...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ 0.019915029406547546, -0.06012566015124321, -0.006680031307041645, 0.010587497614324093, -0.03646146133542061, -0.018418041989207268, -0.012148714624345303, -0.023316534236073494, -0.015166770666837692, 0.035675495862960815, 0.008865095674991608, 0.000668264168780297, 0.01078755035996437, ...
0.112667
resharding of the hash slot the keys belong to is in progress. More specifically, even during a resharding the multi-key operations targeting keys that all exist and all still hash to the same slot (either the source or destination node) are still available. Operations on keys that don't exist or are - during the resha...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ 0.011139259673655033, -0.06127399951219559, -0.023075107485055923, 0.041472651064395905, -0.005897190887480974, -0.08326530456542969, -0.03444276377558708, -0.0006096655852161348, 0.045686665922403336, 0.027146365493535995, 0.0030979784205555916, 0.10668492317199707, 0.055256251245737076, ...
0.107295
will try to send 99 pings every 30 seconds, with a total amount of pings of 3.3 per second. Multiplied by 100 nodes, this is 330 pings per second in the total cluster. There are ways to lower the number of messages, however there have been no reported issues with the bandwidth currently used by Redis Cluster failure de...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ 0.0057485224679112434, 0.001267602201551199, -0.042182356119155884, 0.0353090725839138, 0.018008483573794365, -0.051176585257053375, 0.04735150188207626, -0.03612609952688217, -0.00394716439768672, 0.018976157531142235, -0.058646637946367264, -0.019966939464211464, 0.05175568163394928, -0....
0.16722
and is a non-acknowledged failure type. `FAIL` means that a node is failing and that this condition was confirmed by a majority of masters within a fixed amount of time. \*\*PFAIL flag:\*\* A node flags another node with the `PFAIL` flag when the node is not reachable for more than `NODE\_TIMEOUT` time. Both master and...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ 0.004121474921703339, -0.0531829409301281, -0.04103889688849449, 0.08426985889673233, 0.058848168700933456, -0.0413244292140007, -0.005207414273172617, 0.004707229323685169, 0.01969015598297119, 0.01846088096499443, -0.02366594225168228, 0.03173721209168434, 0.022806763648986816, -0.050255...
0.160757
has elapsed without any detectable replica promotion. It's better for it to rejoin the cluster and continue in this case. It is useful to note that while the `PFAIL` -> `FAIL` transition uses a form of agreement, the agreement used is weak: 1. Nodes collect views of other nodes over some time period, so even if the maj...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ -0.04728451743721962, -0.09430833160877228, 0.029610056430101395, 0.0371684730052948, 0.09820178896188736, -0.01625230349600315, -0.024631446227431297, 0.0023678771685808897, 0.0059905084781348705, 0.02468668296933174, -0.008114615455269814, -0.012362257577478886, 0.08386929333209991, -0.0...
0.049019
"term". In Redis Cluster the term is called epoch instead, and it is used in order to give incremental versioning to events. When multiple nodes provide conflicting information, it becomes possible for another node to understand which state is the most up to date. The `currentEpoch` is a 64 bit unsigned number. At node...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ 0.005824318155646324, -0.026349753141403198, -0.023488381877541542, 0.037530846893787384, 0.04541095346212387, -0.044682372361421585, 0.01134585216641426, -0.03893464803695679, 0.0799618661403656, -0.021840695291757584, 0.006164433900266886, 0.015640821307897568, 0.035195667296648026, -0.0...
0.214443
the following conditions are met: \* The replica's master is in `FAIL` state. \* The master was serving a non-zero number of slots. \* The replica replication link was disconnected from the master for no longer than a given amount of time, in order to ensure the promoted replica's data is reasonably fresh. This time is...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ -0.07147952169179916, -0.011806783266365528, -0.008020075969398022, 0.007633022498339415, 0.03833000361919403, -0.006469327956438065, -0.023570440709590912, -0.023853356018662453, 0.024717018008232117, 0.0680513083934784, 0.003280223812907934, 0.004684082698076963, 0.13202644884586334, -0....
0.130776
of other nodes, a pong packet is broadcast to all the nodes of the cluster. Currently unreachable nodes will eventually be reconfigured when they receive a ping or pong packet from another node or will receive an `UPDATE` packet from another node if the information it publishes via heartbeat packets are detected to be ...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ -0.026729362085461617, -0.05216622352600098, 0.05864743888378143, -0.022853877395391464, 0.03508008271455765, -0.04383717104792595, -0.02517368644475937, -0.0864027738571167, -0.02275663986802101, -0.0011655738344416022, -0.030051376670598984, 0.038632187992334366, 0.05801274999976158, -0....
0.060335
replica is the most likely to start an election and win it before the other replicas, since it will usually be able to start the voting process earlier because of its \*higher rank\* as explained in the previous section. 6. When a master refuses to vote for a given replica there is no negative response, the request is ...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ -0.06236635148525238, -0.008581684902310371, 0.05141426995396614, -0.03766174241900444, 0.029860537499189377, 0.0083747124299407, -0.043719809502363205, 0.007268386427313089, 0.014165050350129604, 0.00043346438906155527, -0.026142697781324387, -0.002144496189430356, 0.11206717789173126, -0...
0.078368
(or its master, if it is a replica) serves. 2. `UPDATE` messages. Since in every heartbeat packet there is information about the sender `configEpoch` and set of hash slots served, if a receiver of a heartbeat packet finds the sender information is stale, it will send a packet with new information, forcing the stale nod...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ 0.004197545349597931, -0.024276696145534515, -0.039781101047992706, 0.019673243165016174, 0.020712105557322502, -0.06765080988407135, 0.003400255460292101, -0.07415138930082321, 0.07078087329864502, 0.01846165582537651, 0.03233737125992775, 0.038928546011447906, 0.056949079036712646, -0.10...
0.136239
import operation, its configuration epoch is incremented to make sure the change will be propagated throughout the cluster. ### UPDATE messages, a closer look With the previous section in mind, it is easier to see how update messages work. Node A may rejoin the cluster after some time. It will send heartbeat packets wh...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ -0.06341084092855453, -0.03105683997273445, 0.01682642474770546, -0.02481522224843502, 0.012565301731228828, -0.04002276435494423, -0.00783319678157568, -0.10864550620317459, -0.006399170495569706, -0.029036683961749077, 0.04264170303940773, 0.02275238186120987, 0.08271899074316025, -0.105...
0.142155
above scenario is to add replicas to every master, however this is costly as it requires more instances of Redis to be executed, more memory, and so forth. An alternative is to create an asymmetry in the cluster, and let the cluster layout automatically change over time. For example the cluster may have three masters A...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ -0.04154449328780174, -0.03098820336163044, -0.03198964148759842, 0.0017187759513035417, -0.007636161521077156, -0.04032932221889496, -0.08449491113424301, -0.0655868798494339, -0.01000076811760664, 0.029153022915124893, -0.010183160193264484, -0.016074340790510178, 0.09470362216234207, -0...
0.09779
by a user-configurable parameter called `cluster-migration-barrier`: the number of good replicas a master must be left with before a replica can migrate away. For example, if this parameter is set to 2, a replica can try to migrate only if its master remains with two working replicas. ### configEpoch conflicts resoluti...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ -0.01451466977596283, -0.04827610403299332, 0.01262094546109438, -0.014125518500804901, 0.06334376335144043, -0.030082108452916145, 0.004092214163392782, -0.04963332787156105, 0.005318235605955124, 0.020847085863351822, 0.008788063190877438, -0.032467398792505264, 0.095746248960495, -0.087...
0.085015
eventually, every node will pick a unique configEpoch regardless of what happened. This mechanism also guarantees that after a fresh cluster is created, all nodes start with a different `configEpoch` (even if this is not actually used) since `redis-cli` makes sure to use `CLUSTER SET-CONFIG-EPOCH` at startup. However i...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ -0.04871603474020958, -0.08286582678556442, -0.009178719483315945, 0.06621074676513672, 0.0511355884373188, -0.05214919149875641, 0.020622190088033676, -0.06563453376293182, 0.04229835048317909, -0.026446174830198288, 0.051978252828121185, 0.058806948363780975, 0.03293271362781525, -0.0492...
0.132919
subscribe to every node, and can also publish to every other node. The cluster will make sure that published messages are forwarded as needed. The clients can send SUBSCRIBE to any node and can also send PUBLISH to any node. It will simply broadcast each published message to all other nodes. Redis 7.0 and later feature...
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ 0.03576647862792015, -0.06963460147380829, -0.09147673100233078, 0.006588314659893513, -0.03669164329767227, -0.013098758645355701, 0.014027006924152374, -0.07230651378631592, 0.04892180860042572, 0.016474435105919838, -0.028453852981328964, 0.02609403431415558, 0.11996182054281235, -0.030...
0.162446
crc = (crc<<8) ^ crc16tab[((crc>>8) ^ \*buf++)&0x00FF]; return crc; }
https://github.com/redis/redis-doc/blob/master/docs/reference/cluster-spec.md
master
redis
[ 0.032208655029535294, 0.0968601182103157, -0.058415062725543976, -0.04503628611564636, -0.06693808734416962, 0.014333060011267662, -0.02281155437231064, 0.04470464587211609, -0.044878337532281876, 0.035994596779346466, -0.012713128700852394, -0.11332781612873077, 0.04818252846598625, 0.028...
0.016775
Many of the commands in Redis accept key names as input arguments. The 9th element in the reply of `COMMAND` (and `COMMAND INFO`) is an array that consists of the command's key specifications. A \_key specification\_ describes a rule for extracting the names of one or more keys from the arguments of a given command. Ke...
https://github.com/redis/redis-doc/blob/master/docs/reference/key-specs.md
master
redis
[ -0.05241534486413002, -0.03418673202395439, -0.05930687114596367, 0.03921442851424217, -0.004744996782392263, -0.06389328092336655, -0.00659819645807147, 0.01719469390809536, 0.03693907707929611, 0.002322282874956727, -0.013661477714776993, 0.02081570029258728, 0.07191808521747589, -0.0456...
0.159496
`find\_keys` value of a key specification tells the client how to continue the search for key names. `find\_keys` has three possible types: 1. \*\*range:\*\* keys stop at a specific index or relative to the last argument. 2. \*\*keynum:\*\* an additional argument specifies the number of input keys. 3. \*\*unknown:\*\* ...
https://github.com/redis/redis-doc/blob/master/docs/reference/key-specs.md
master
redis
[ -0.08080519735813141, 0.02692357636988163, 0.01793680526316166, 0.010599508881568909, -0.008267920464277267, -0.02388647012412548, 0.06043107435107231, 0.018482260406017303, 0.024921245872974396, -0.007187471259385347, 0.060761839151382446, -0.02298586070537567, 0.09621458500623703, -0.083...
0.095409
the remove flag. The command deletes the key. ### Logical operation flags The following flags declare the type of operations performed on the data stored as the key's value and its TTL (if any), not the metadata. These flags describe the logical operation that the command executes on data, driven by the input arguments...
https://github.com/redis/redis-doc/blob/master/docs/reference/key-specs.md
master
redis
[ -0.0015084762126207352, 0.05275523290038109, -0.06297733634710312, 0.03250013664364815, -0.030530115589499474, -0.063810333609581, 0.09165532886981964, -0.08358585834503174, 0.06049327552318573, 0.022632328793406487, 0.06550104171037674, 0.034020621329545975, 0.010587557218968868, -0.10201...
0.121916
on other arguments. ## Examples ### `SET`'s key specifications ``` 1) 1) "flags" 2) 1) RW 2) access 3) update 3) "begin\_search" 4) 1) "type" 2) "index" 3) "spec" 4) 1) "index" 2) (integer) 1 5) "find\_keys" 6) 1) "type" 2) "range" 3) "spec" 4) 1) "lastkey" 2) (integer) 0 3) "keystep" 4) (integer) 1 5) "limit" 6) (inte...
https://github.com/redis/redis-doc/blob/master/docs/reference/key-specs.md
master
redis
[ -0.038114335387945175, 0.06504612416028976, -0.08659320324659348, 0.027988234534859657, -0.04385616257786751, -0.003845610423013568, 0.12510617077350616, 0.012267077341675758, -0.04465175420045853, 0.05295296013355255, 0.014725536108016968, -0.010605726391077042, 0.12189427018165588, -0.08...
0.121182
To communicate with the Redis server, Redis clients use a protocol called REdis Serialization Protocol (RESP). While the protocol was designed specifically for Redis, you can use it for other client-server software projects. RESP is a compromise among the following considerations: \* Simple to implement. \* Fast to par...
https://github.com/redis/redis-doc/blob/master/docs/reference/protocol-spec.md
master
redis
[ 0.0009497689898125827, 0.00020220584701746702, -0.07211824506521225, 0.029417850077152252, -0.004153682384639978, -0.07003112882375717, 0.04339086264371872, 0.040169935673475266, 0.03812994062900543, -0.026917770504951477, -0.057753726840019226, 0.032731641083955765, 0.03544645011425018, -...
0.163878
by the server. Before terminating the connection, Redis unconditionally sends a `-DENIED` reply, regardless of whether the client writes to the socket. \* The [RESP3 Push type](#resp3-pushes). As the name suggests, a push type allows the server to send out-of-band data to the connection. The server may push data at any...
https://github.com/redis/redis-doc/blob/master/docs/reference/protocol-spec.md
master
redis
[ -0.039866235107183456, -0.04145263880491257, -0.04390731826424599, 0.03250344842672348, -0.04090552777051926, -0.0982537493109703, 0.034385796636343, -0.009052537381649017, 0.07287445664405823, 0.020129719749093056, -0.05565475672483444, 0.0610598623752594, 0.014283644035458565, -0.0484772...
0.161393
and is terminated by CRLF (i.e., `\r\n`). Simple strings transmit short, non-binary strings with minimal overhead. For example, many Redis commands reply with just "OK" on success. The encoding of this Simple String is the following 5 bytes: +OK\r\n When Redis replies with a simple string, a client library should retur...
https://github.com/redis/redis-doc/blob/master/docs/reference/protocol-spec.md
master
redis
[ -0.05260300263762474, 0.017834512516856194, -0.020822560414671898, 0.002565629780292511, -0.02247440814971924, -0.08837635070085526, 0.02476228028535843, 0.09851443022489548, 0.009116845205426216, 0.022858481854200363, -0.02401932142674923, 0.01197509653866291, 0.060059159994125366, -0.042...
0.233482
represents a single binary string. The string can be of any size, but by default, Redis limits it to 512 MB (see the `proto-max-bulk-len` configuration directive). RESP encodes bulk strings in the following way: $\r\n\r\n \* The dollar sign (`$`) as the first byte. \* One or more decimal digits (`0`..`9`) as the string...
https://github.com/redis/redis-doc/blob/master/docs/reference/protocol-spec.md
master
redis
[ -0.058831021189689636, -0.004544292576611042, -0.0718265026807785, -0.046703848987817764, -0.0217334795743227, -0.11727555096149445, 0.020773932337760925, 0.061817578971385956, 0.026395810768008232, -0.009307368658483028, 0.002272441051900387, -0.05583248287439346, 0.04880911484360695, -0....
0.18884
data type for [null values](#nulls), RESP2 has no such type. Instead, due to historical reasons, the representation of null values in RESP2 is via predetermined forms of the [Bulk Strings](#bulk-strings) and [arrays](#arrays) types. Null arrays exist as an alternative way of representing a null value. For instance, whe...
https://github.com/redis/redis-doc/blob/master/docs/reference/protocol-spec.md
master
redis
[ -0.04089773818850517, 0.011157829314470291, -0.07673699408769608, 0.04991675540804863, -0.05675448104739189, -0.06823072582483292, 0.03375662490725517, 0.039507634937763214, 0.011878274381160736, -0.014456952922046185, -0.003667013719677925, -0.0037886665668338537, 0.031541336327791214, -0...
0.13425
byte. \* An optional plus (`+`) or minus (`-`) as the sign. \* One or more decimal digits (`0`..`9`) as an unsigned, base-10 value. \* The CRLF terminator. Example: (3492890328409238509324850943850943825024385\r\n Big numbers can be positive or negative but can't include fractionals. Client libraries written in languag...
https://github.com/redis/redis-doc/blob/master/docs/reference/protocol-spec.md
master
redis
[ -0.06987183541059494, 0.008453217335045338, -0.02462945692241192, -0.01899757981300354, -0.051748014986515045, -0.07473351061344147, 0.056731611490249634, 0.09142281860113144, 0.0042370581068098545, -0.0067867496982216835, -0.07445787638425827, -0.031567685306072235, 0.07623425871133804, 0...
0.082539
example) will likely return an array along with type information that indicates to the caller that it is a dictionary. {{% alert title="Map pattern in RESP2" color="info" %}} RESP2 doesn't have a map type. A map in RESP2 is represented by a flat array containing the keys and the values. The first element is a key, foll...
https://github.com/redis/redis-doc/blob/master/docs/reference/protocol-spec.md
master
redis
[ -0.01629612408578396, 0.042663443833589554, -0.029261576011776924, -0.014973869547247887, -0.044719796627759933, -0.06672178208827972, 0.13184486329555511, 0.03575354442000389, -0.04846997931599617, -0.05234604701399803, -0.03581870347261429, -0.0034323588479310274, 0.11162229627370834, -0...
0.128695
credentials in the command's optional `!AUTH` clause: Client: HELLO 3 AUTH default mypassword Server: -ERR invalid password (the connection remains in RESP2 mode) A successful reply to the `HELLO` command is a map reply. The information in the reply is partly server-dependent, but certain fields are mandatory for all t...
https://github.com/redis/redis-doc/blob/master/docs/reference/protocol-spec.md
master
redis
[ -0.07541628181934357, -0.047371841967105865, -0.04719775915145874, -0.007348388433456421, -0.021380331367254257, -0.06989736109972, 0.01651320978999138, 0.023573679849505424, 0.028495140373706818, 0.05751636251807213, -0.0423722006380558, -0.01059566717594862, 0.06459154933691025, -0.01358...
0.140941
operation per character while at the same time scanning for the CR character. Example (in C): ```c #include int main(void) { unsigned char \*p = "$123\r\n"; int len = 0; p++; while(\*p != '\r') { len = (len\*10)+(\*p - '0'); p++; } /\* Now p points at '\r', and the len is in bulk\_len. \*/ printf("%d\n", len); return 0...
https://github.com/redis/redis-doc/blob/master/docs/reference/protocol-spec.md
master
redis
[ -0.03620944917201996, 0.005088798236101866, -0.06838404387235641, -0.011479857377707958, -0.057966236025094986, -0.05560837313532829, 0.06753697246313095, 0.040874797850847244, 0.03735164552927017, -0.03239898011088371, 0.0216902494430542, 0.035947173833847046, 0.07712402939796448, -0.0252...
0.101585
The `COMMAND DOCS` command returns documentation-focused information about available Redis commands. The map reply that the command returns includes the \_arguments\_ key. This key stores an array that describes the command's arguments. Every element in the \_arguments\_ array is a map with the following fields: \* \*\...
https://github.com/redis/redis-doc/blob/master/docs/reference/command-arguments.md
master
redis
[ -0.029373453930020332, 0.018283464014530182, -0.0829152911901474, 0.07667072117328644, -0.031019901856780052, -0.05728526413440704, 0.04900607466697693, 0.02821933664381504, 0.02931513823568821, -0.05011569336056709, -0.03901183605194092, -0.027222277596592903, 0.04734686017036438, -0.0393...
0.192421
\_=\_ and \_~\_, is a \_pure-token\_. 3. \*\*threshold:\*\* this nested argument is a \_string\_. 4. \*\*count:\*\* this nested argument is an optional \_integer\_ with a \_token\_ (\_LIMIT\_). Here's `XADD`'s arguments array: ``` 1) 1) "name" 2) "key" 3) "type" 4) "key" 5) "value" 6) "key" 2) 1) "name" 2) "nomkstream"...
https://github.com/redis/redis-doc/blob/master/docs/reference/command-arguments.md
master
redis
[ 0.01242564246058464, 0.03773995116353035, -0.03473800793290138, -0.055079083889722824, -0.06820499151945114, -0.02610781416296959, 0.1456230878829956, 0.03654512017965317, 0.00003885701880790293, 0.005210602190345526, 0.03600156679749489, -0.14254572987556458, 0.05754195898771286, -0.02889...
0.129478
\*\*Note: this document was written by the creator of Redis, Salvatore Sanfilippo, early in the development of Redis (c. 2010). Virtual Memory has been deprecated since Redis 2.6, so this documentation is here only for historical interest.\*\* The implementation of Redis strings is contained in `sds.c` (`sds` stands fo...
https://github.com/redis/redis-doc/blob/master/docs/reference/internals/internals-sds.md
master
redis
[ -0.05064210668206215, 0.009385285899043083, -0.07440980523824692, 0.009315792471170425, -0.027175499126315117, -0.04019835218787193, 0.042222633957862854, 0.08978906273841858, 0.04948321729898453, -0.029019854962825775, 0.015232691541314125, 0.018885141238570213, 0.001721127307973802, -0.0...
0.222327
\*\*Note: this document was written by the creator of Redis, Salvatore Sanfilippo, early in the development of Redis (c. 2010). Virtual Memory has been deprecated since Redis 2.6, so this documentation is here only for historical interest.\*\* This document details the internals of the Redis Virtual Memory subsystem pr...
https://github.com/redis/redis-doc/blob/master/docs/reference/internals/internals-vm.md
master
redis
[ -0.04349333047866821, -0.00021594230202026665, -0.09030279517173767, 0.03234640881419182, -0.03631759434938431, -0.02797015942633152, 0.07220949977636337, 0.060186803340911865, 0.04261717572808266, 0.01154419220983982, 0.010894381441175938, 0.0015659481287002563, 0.012867056764662266, -0.0...
0.203811
an object is swapped on disk (`REDIS\_VM\_SWAPPED` or `REDIS\_VM\_LOADING`), how do we know where it is stored, what type it is, and so forth? That's simple: the \_vtype\_ field is set to the original type of the Redis object swapped, while the \_vm\_ field (that is a \_redisObjectVM\_ structure) holds information abou...
https://github.com/redis/redis-doc/blob/master/docs/reference/internals/internals-vm.md
master
redis
[ -0.012359022162854671, 0.03704283758997917, -0.059611402451992035, 0.041747331619262695, -0.005956894718110561, -0.014044762589037418, 0.0019985847175121307, 0.029191600158810616, 0.04015525430440903, 0.010987788438796997, 0.0021790352184325457, 0.0555824413895607, -0.06014055758714676, -0...
0.199136
page table. Transferring objects from memory to swap --- In order to transfer an object from memory to disk we need to perform the following steps (assuming non threaded VM, just a simple blocking approach): \* Find how many pages are needed in order to store this object on the swap file. This is trivially accomplished...
https://github.com/redis/redis-doc/blob/master/docs/reference/internals/internals-vm.md
master
redis
[ -0.013706705532968044, 0.0016711772186681628, -0.08126762509346008, 0.030689775943756104, -0.03492421656847, 0.019069762900471687, -0.0355260893702507, 0.014918163418769836, -0.0323089063167572, 0.1221088394522667, -0.01857648603618145, -0.0032303291372954845, 0.05389619991183281, -0.05287...
0.057263
parameter is very important as it is used in order to trigger swapping: Redis will try to swap objects only if it is using more memory than the max memory setting, otherwise there is no need to swap as we are matching the user requested memory usage. Blocking VM swapping --- Swapping of object from memory to disk happe...
https://github.com/redis/redis-doc/blob/master/docs/reference/internals/internals-vm.md
master
redis
[ -0.038245104253292084, 0.009506060741841793, -0.08834079653024673, 0.05433120205998421, -0.03525989502668381, -0.02429206855595112, 0.06809063255786896, 0.04521336406469345, 0.030445074662566185, 0.032850947231054306, 0.01578894816339016, 0.016768459230661392, -0.023496391251683235, -0.059...
0.156473
loading of the key from the swap file to memory. So this is what happens: \* The user calls some command having as argument a swapped key \* The command implementation calls the lookup function \* The lookup function search for the key in the top level hash table. If the value associated with the requested key is swapp...
https://github.com/redis/redis-doc/blob/master/docs/reference/internals/internals-vm.md
master
redis
[ -0.0426691398024559, -0.013047905638813972, -0.0517345629632473, 0.019763080403208733, -0.03637298196554184, -0.025048615410923958, 0.023439422249794006, 0.019251404330134392, 0.025976689532399178, 0.06914304196834564, -0.0009370172047056258, 0.07102136313915253, 0.008644158951938152, -0.1...
0.060739
but for real-time usage one of the good points of Redis is the low latency. The blocking VM will have bad latency behaviors as when a client is accessing a swapped out value, or when Redis needs to swap out values, no other clients will be served in the meantime. Swapping out keys should happen in background. Similarly...
https://github.com/redis/redis-doc/blob/master/docs/reference/internals/internals-vm.md
master
redis
[ -0.07768827676773071, 0.01806946098804474, -0.050118762999773026, 0.007408175151795149, -0.017009779810905457, -0.028066759929060936, 0.0022787449415773153, -0.0242221150547266, 0.031134676188230515, 0.028149841353297234, 0.025696296244859695, 0.035985227674245834, -0.06470099836587906, -0...
0.144853
this key \*/ robj \*val; /\* the value to swap for REDIS\_IOREQ\_\*\_SWAP, otherwise this \* field is populated by the I/O thread for REDIS\_IOREQ\_LOAD. \*/ off\_t page; /\* Swap page where to read/write the object \*/ off\_t pages; /\* Swap pages needed to save object. PREPARE\_SWAP return val \*/ int canceled; /\* T...
https://github.com/redis/redis-doc/blob/master/docs/reference/internals/internals-vm.md
master
redis
[ -0.0948999673128128, 0.01134508941322565, -0.06404252350330353, 0.015129880048334599, -0.06066717579960823, -0.05692111328244209, 0.03313390165567398, 0.0035066399723291397, 0.0250468160957098, 0.03714970871806145, 0.007622784469276667, 0.03898731619119644, 0.004779832437634468, -0.1203180...
0.232864
using an UNIX pipe. The pipe file descriptor has a readable event associated in the main thread event loop, that is the function `vmThreadedIOCompletedJob`. If this function detects that all the values needed for a blocked client were loaded, the client is restarted and the original command called. So you can think of ...
https://github.com/redis/redis-doc/blob/master/docs/reference/internals/internals-vm.md
master
redis
[ -0.06834836304187775, 0.050726357847452164, 0.015265511348843575, -0.009827486239373684, -0.021384764462709427, -0.031237145885825157, -0.005641529336571693, -0.01559926476329565, 0.05449619144201279, 0.021681854501366615, 0.01141747459769249, 0.05387980490922928, -0.060090430080890656, -0...
0.112957
do is waiting for the item to move to the next queue in a \*blocking way\*. Fortunately this condition happens very rarely so it's not a performance problem. \* If the job is in the processed queue, we just mark it as \_canceled\_ marking setting the `canceled` field to 1 in the iojob structure. The function processing...
https://github.com/redis/redis-doc/blob/master/docs/reference/internals/internals-vm.md
master
redis
[ -0.1430118978023529, 0.06810171902179718, 0.030760299414396286, 0.03439471125602722, -0.01495109312236309, -0.08920656889677048, 0.0745878666639328, -0.10027662664651871, 0.03160194307565689, 0.04977250471711159, 0.0034570973366498947, 0.06014533340930939, -0.032499294728040695, -0.0762068...
0.143032
--- title: "Event library" linkTitle: "Event library" weight: 1 description: What's an event library, and how was the original Redis event library implemented? aliases: - /topics/internals-eventlib - /topics/internals-rediseventlib --- \*\*Note: this document was written by the creator of Redis, Salvatore Sanfilippo, ...
https://github.com/redis/redis-doc/blob/master/docs/reference/internals/internals-rediseventlib.md
master
redis
[ -0.07946261018514633, -0.026863224804401398, -0.032044682651758194, -0.0008247701334767044, 0.018004760146141052, -0.044109150767326355, 0.07108035683631897, 0.00048639479791745543, 0.08819431811571121, 0.0028994237072765827, -0.0309982281178236, 0.03757124021649361, -0.06126116216182709, ...
0.214931
`NULL`. \* `finalizerProc`: Pointer to the function that has to be called before the timed event is removed from the list of timed events. `initServer` calls `aeCreateTimeEvent` to add a timed event to `timeEventHead` field of `server.el`. `timeEventHead` is a pointer to a list of such timed events. The call to `aeCrea...
https://github.com/redis/redis-doc/blob/master/docs/reference/internals/internals-rediseventlib.md
master
redis
[ -0.0663515105843544, 0.04509318992495537, -0.07067763805389404, 0.00034175949986092746, 0.027639256790280342, -0.050140973180532455, 0.08215092122554779, 0.05605114623904228, 0.08319894969463348, 0.004672701004892588, 0.02724483422935009, -0.048948634415864944, -0.04443027824163437, -0.049...
0.136455
elapsed `processTimeEvents` calls the registered callback. In this case it calls the only timed event callback registered, that is, `redis.c:serverCron`. The callback returns the time in milliseconds after which the callback must be called again. This change is recorded via a call to `ae.c:aeAddMilliSeconds` and will b...
https://github.com/redis/redis-doc/blob/master/docs/reference/internals/internals-rediseventlib.md
master
redis
[ -0.05744238197803497, -0.01393358688801527, -0.0810294970870018, 0.03033297136425972, 0.00853127520531416, -0.07073201984167099, 0.07100023329257965, 0.033918801695108414, 0.11834223568439484, -0.06877005100250244, 0.0103924460709095, -0.0009639541385695338, -0.07896068692207336, -0.064534...
0.091169
\*\*Note: this document was written by the creator of Redis, Salvatore Sanfilippo, early in the development of Redis (c. 2013), as part of a series of design drafts. This is preserved for historical interest.\*\* # Redis Design Draft 2 -- RDB version 7 info fields \* Author: Salvatore Sanfilippo `antirez@gmail.com` \* ...
https://github.com/redis/redis-doc/blob/master/docs/reference/internals/rdd.md
master
redis
[ -0.06286967545747757, 0.02536400593817234, -0.059835996478796005, 0.015086316503584385, -0.007469965610653162, -0.001336983172222972, -0.0418534092605114, 0.028319332748651505, -0.022641632705926895, 0.03146017715334892, -0.051149193197488785, 0.02723921649158001, 0.047704823315143585, -0....
0.078497
Info field 2 -- Redis version This field represents a null-terminated string containing the Redis version that generated the file, as displayed in the Redis version INFO field.
https://github.com/redis/redis-doc/blob/master/docs/reference/internals/rdd.md
master
redis
[ 0.012343809008598328, 0.043793898075819016, -0.058785758912563324, -0.011266023851931095, 0.07140875607728958, -0.05197611451148987, 0.007238847203552723, -0.006547168362885714, 0.03948230296373367, -0.03709215670824051, 0.04417946934700012, 0.004625075496733189, -0.0005059869727119803, -0...
0.09336
## Sections \* [Heap allocation raw functions](#section-heap-allocation-raw-functions) \* [Commands API](#section-commands-api) \* [Module information and time measurement](#section-module-information-and-time-measurement) \* [Automatic memory management for modules](#section-automatic-memory-management-for-modules) \*...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ -0.037506211549043655, 0.01607716828584671, -0.0668279230594635, 0.019030723720788956, -0.010392504744231701, -0.05912342295050621, 0.01966010592877865, 0.014859856106340885, -0.04782146215438843, 0.059128399938344955, 0.00808653049170971, -0.02605033479630947, 0.08772391825914383, -0.0149...
0.102858
## Commands API These functions are used to implement custom Redis commands. For examples, see [https://redis.io/topics/modules-intro](https://redis.io/topics/modules-intro). ### `RedisModule\_IsKeysPositionRequest` int RedisModule\_IsKeysPositionRequest(RedisModuleCtx \*ctx); \*\*Available since:\*\* 4.0.0 Return non-...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ -0.02470935881137848, -0.009478028863668442, -0.09412279725074768, 0.0014329425757750869, -0.04842584952712059, -0.0676325112581253, 0.08061137795448303, 0.03527620807290077, 0.020252492278814316, -0.006907612085342407, 0.04916864633560181, -0.01557567622512579, 0.07292863726615906, -0.065...
0.137893
`REDISMODULE\_OK` is returned and the new command is registered. This function must be called during the initialization of the module inside the `RedisModule\_OnLoad()` function. Calling this function outside of the initialization function is not defined. The command function type is the following: int MyCommand\_Redis...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ 0.0026461740490049124, -0.02353201061487198, -0.16057220101356506, 0.07082165032625198, -0.0860043540596962, -0.07541802525520325, 0.1002938374876976, 0.047168176621198654, -0.06619437783956528, -0.039144162088632584, 0.04566536471247673, -0.05351802334189415, 0.019329547882080078, -0.0413...
0.141522
numbers refer to counting backwards from the last argument (-1 means the last argument provided) 0 for commands with no keys. \* `keystep`: Step between first and last key indexes. 0 for commands with no keys. This information is used by ACL, Cluster and the `COMMAND` command. NOTE: The scheme described above serves a ...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ -0.013391117565333843, -0.0005049251485615969, -0.10125773400068283, 0.04313870891928673, -0.0918155312538147, 0.02571188099682331, 0.0882757231593132, 0.013733922503888607, -0.03455185890197754, -0.0477023608982563, 0.022102251648902893, -0.09991106390953064, 0.059374600648880005, -0.0701...
0.098959
versions. Always set this field to `REDISMODULE\_COMMAND\_INFO\_VERSION`. - `summary`: A short description of the command (optional). - `complexity`: Complexity description (optional). - `since`: The version where the command was introduced (optional). Note: The version specified should be the module's, not Redis versi...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ -0.0008072893251664937, 0.02400384470820427, -0.08930256217718124, 0.010174552910029888, -0.010892820544540882, -0.05978775396943092, 0.01706196740269661, 0.0009046784252859652, -0.001624214113689959, -0.02927219867706299, -0.013735047541558743, 0.03196415677666664, 0.0005563125014305115, ...
0.160937
searching. Can be negative, which means start search from the end, in reverse. Example: -2 means to start in reverse from the penultimate argument. (`REDISMODULE\_KSPEC\_BS\_KEYWORD` only.) \* `find\_keys\_type`: After the "begin search", this describes which arguments are keys. The strategies are: \* `REDISMODULE\_KSP...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ -0.02577560767531395, -0.012002982199192047, -0.05289790779352188, 0.02510414645075798, -0.016205457970499992, 0.01576138101518154, 0.07331939786672592, 0.01886756159365177, 0.04200301319360733, -0.05354287102818489, 0.043089114129543304, 0.018105171620845795, 0.09022171795368195, -0.06917...
0.120582
The key is not actually a key, but should be routed in cluster mode as if it was a key. \* `REDISMODULE\_CMD\_KEY\_INCOMPLETE`: The keyspec might not point out all the keys it should cover. \* `REDISMODULE\_CMD\_KEY\_VARIABLE\_FLAGS`: Some keys might have different flags depending on arguments. - `args`: An array of `R...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ 0.03304910659790039, 0.008836803957819939, -0.06413918733596802, 0.0558314174413681, -0.025581849738955498, -0.04210648685693741, 0.08785370737314224, 0.037160228937864304, -0.10429061949253082, -0.030532706528902054, 0.022565647959709167, -0.07102930545806885, 0.019283782690763474, -0.084...
0.16819
### `RedisModule\_CachedMicroseconds` ustime\_t RedisModule\_CachedMicroseconds(void); \*\*Available since:\*\* 7.2.0 Return the cached UNIX time in microseconds. It is updated in the server cron job and before executing a command. It is useful for complex call stacks, such as a command causing a key space notification...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ -0.06602793186903, 0.0037960936315357685, -0.09330813586711884, 0.05785059556365013, 0.02928049862384796, -0.06390447914600372, 0.042189255356788635, 0.038752295076847076, 0.04751504957675934, -0.03645982965826988, -0.019340867176651955, 0.0041280463337898254, -0.03660886362195015, -0.0599...
0.126384
## Automatic memory management for modules ### `RedisModule\_AutoMemory` void RedisModule\_AutoMemory(RedisModuleCtx \*ctx); \*\*Available since:\*\* 4.0.0 Enable automatic memory management. The function must be called as the first function of a command implementation that wants to use automatic memory. When enabled, ...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ 0.012056437321007252, 0.008893082849681377, -0.09212673455476761, 0.06292913854122162, -0.050209879875183105, -0.045294422656297684, 0.11659496277570724, 0.06267998367547989, -0.00508420355618, 0.008356296457350254, 0.017540758475661278, -0.019961800426244736, 0.01815006695687771, -0.03487...
0.214334
released with [`RedisModule\_FreeString()`](#RedisModule\_FreeString), unless automatic memory is enabled. The passed context `ctx` may be NULL if necessary. See the [`RedisModule\_CreateString()`](#RedisModule\_CreateString) documentation for more info. ### `RedisModule\_FreeString` void RedisModule\_FreeString(RedisM...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ -0.00022088640253059566, 0.02311379835009575, -0.10340724140405655, 0.06040326878428459, -0.052493467926979065, -0.013664966449141502, 0.09370063990354538, 0.042820677161216736, 0.02018127217888832, -0.022116130217909813, 0.05060888081789017, -0.04109349101781845, 0.029980098828673363, -0....
0.113701
to optimize memory usage. Threaded modules that reference held strings from other threads \*must\* explicitly trim the allocation as soon as the string is held. Not doing so may result with automatic trimming which is not thread safe. ### `RedisModule\_StringPtrLen` const char \*RedisModule\_StringPtrLen(const RedisMod...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ 0.06877127289772034, 0.027919499203562737, -0.014693924225866795, 0.027462581172585487, -0.10607655346393585, 0.016394738107919693, 0.00034379103453829885, 0.08835283666849136, -0.003433670848608017, -0.08103743940591812, -0.00240246020257473, 0.03124532289803028, -0.0038215452805161476, -...
0.101527
\*not thread safe\*. A background thread manipulating a recently retained string may end up in a race condition with the auto-trim, which could result with data corruption. ## Reply APIs These functions are used for sending replies to the client. Most functions always return `REDISMODULE\_OK` so you can use it with 're...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ -0.06636517494916916, 0.03238764405250549, 0.002405160805210471, 0.06711423397064209, -0.09008301049470901, -0.07002853602170944, 0.04593294858932495, -0.02003466710448265, 0.07217060774564743, -0.0075896126218140125, 0.005891173612326384, -0.01536977756768465, -0.0008494134526699781, -0.0...
0.083325
'len' elements. Visit [https://github.com/antirez/RESP3/blob/master/spec.md](https://github.com/antirez/RESP3/blob/master/spec.md) for more info about RESP3. After starting a set reply, the module must make `len` calls to other `ReplyWith\*` style functions in order to emit the elements of the set. See Reply APIs secti...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ -0.07206004858016968, 0.005748532246798277, -0.042970094829797745, 0.0549195371568203, -0.061534300446510315, -0.036312125623226166, 0.07609882950782776, 0.050949838012456894, 0.02702896110713482, -0.019444765523076057, -0.04720667004585266, -0.01775476150214672, 0.024513954296708107, -0.0...
0.086604
\*\*Available since:\*\* 4.0.0 Reply with a bulk string, taking in input a `RedisModuleString` object. The function always returns `REDISMODULE\_OK`. ### `RedisModule\_ReplyWithEmptyString` int RedisModule\_ReplyWithEmptyString(RedisModuleCtx \*ctx); \*\*Available since:\*\* 6.0.0 Reply with an empty string. The functi...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ -0.011885803192853928, 0.006627859082072973, -0.029665719717741013, 0.046351268887519836, -0.01773916929960251, -0.024335062131285667, 0.08033602684736252, 0.072405144572258, -0.07389405369758606, -0.01013213861733675, -0.02682742476463318, -0.09134446084499359, 0.0018554431153461337, -0.0...
0.121661
(see `addReplyHumanLongDouble` in networking.c). The function always returns `REDISMODULE\_OK`. ## Commands replication API ### `RedisModule\_Replicate` int RedisModule\_Replicate(RedisModuleCtx \*ctx, const char \*cmdname, const char \*fmt, ...); \*\*Available since:\*\* 4.0.0 Replicate the specified command and argum...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ -0.07823742926120758, -0.03894396498799324, -0.06670968979597092, 0.04581136256456375, -0.044648364186286926, -0.09416350722312927, -0.012777364812791348, -0.006491674110293388, -0.010792667046189308, 0.011515837162733078, 0.06429755687713623, -0.00843253917992115, 0.023031312972307205, -0...
0.16857
} ### `RedisModule\_GetClientUserNameById` RedisModuleString \*RedisModule\_GetClientUserNameById(RedisModuleCtx \*ctx, uint64\_t id); \*\*Available since:\*\* 6.2.1 Return the ACL user name used by the client with the specified client ID. Client ID can be obtained with [`RedisModule\_GetClientId()`](#RedisModule\_GetC...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ -0.0881604254245758, 0.07068265229463577, -0.12599726021289825, 0.014029104262590408, -0.0333070307970047, -0.0390770360827446, 0.12358792126178741, 0.03793894127011299, -0.013253414072096348, -0.09265553951263428, 0.008449454791843891, -0.0617951937019825, 0.07603834569454193, -0.07263820...
0.146296
The command was sent over the replication link by the MASTER \* `REDISMODULE\_CTX\_FLAGS\_MASTER`: The Redis instance is a master \* `REDISMODULE\_CTX\_FLAGS\_SLAVE`: The Redis instance is a slave \* `REDISMODULE\_CTX\_FLAGS\_READONLY`: The Redis instance is read-only \* `REDISMODULE\_CTX\_FLAGS\_CLUSTER`: The Redis in...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ -0.01775055192410946, -0.0677180364727974, -0.12357791513204575, 0.02532222867012024, 0.02062518335878849, -0.06079534813761711, 0.019237706437706947, -0.08075171709060669, -0.005845659412443638, 0.021345507353544235, 0.04146202281117439, 0.019663006067276, 0.08321532607078552, -0.06981576...
0.091243
4.0.0 Return a handle representing a Redis key, so that it is possible to call other APIs with the key handle as argument to perform operations on the key. The return value is the handle representing the key, that must be closed with [`RedisModule\_CloseKey()`](#RedisModule\_CloseKey). If the key does not exist and `RE...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ -0.018454015254974365, 0.015705745667219162, -0.09635510295629501, 0.08272357285022736, -0.04336144030094147, -0.07548978924751282, 0.07473786175251007, 0.01415187492966652, -0.013319650664925575, -0.009139424189925194, 0.012903264723718166, 0.008741800673305988, 0.025126421824097633, -0.0...
0.085268
writing or is an empty key. ### `RedisModule\_GetAbsExpire` mstime\_t RedisModule\_GetAbsExpire(RedisModuleKey \*key); \*\*Available since:\*\* 6.2.2 Return the key expire value, as absolute Unix timestamp. If no TTL is associated with the key or if the key is empty, `REDISMODULE\_NO\_EXPIRE` is returned. ### `RedisMod...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ -0.02657424472272396, -0.0019003249472007155, -0.09131333231925964, 0.04161882400512695, -0.017219722270965576, -0.0016805388731881976, 0.025588031858205795, 0.09896763414144516, 0.029446396976709366, -0.01186672318726778, 0.06702416390180588, -0.020856890827417374, 0.04457651078701019, -0...
0.136608
later call StringDMA() again to get the pointer. ### `RedisModule\_StringTruncate` int RedisModule\_StringTruncate(RedisModuleKey \*key, size\_t newlen); \*\*Available since:\*\* 4.0.0 If the key is open for writing and is of string type, resize it, padding with zero bytes if the new length is greater than the old one....
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ 0.008411419577896595, 0.03546658903360367, -0.0063676731660962105, 0.015674546360969543, -0.10367430001497269, -0.06403008848428726, 0.07659170776605606, 0.11149528622627258, -0.05335797369480133, -0.003950731363147497, 0.019815780222415924, 0.026391642168164253, -0.02205478772521019, -0.0...
0.123903
element, 1 the second element and so on. Negative indices can be used to designate elements starting at the tail of the list. Here, -1 means the last element, -2 means the penultimate and so forth. When no value is found at the given key and index, NULL is returned and `errno` is set as follows: - EINVAL if key is NULL...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ 0.006403790321201086, 0.058897461742162704, -0.05228128284215927, 0.04400653392076492, 0.006912376265972853, -0.05806422233581543, 0.12568123638629913, 0.08343848586082458, -0.029778651893138885, -0.03446340560913086, 0.05470287427306175, -0.034299347549676895, 0.041785828769207, -0.084363...
0.198226
input flags are: REDISMODULE\_ZADD\_XX: Element must already exist. Do nothing otherwise. REDISMODULE\_ZADD\_NX: Element must not exist. Do nothing otherwise. REDISMODULE\_ZADD\_GT: If element exists, new score must be greater than the current score. Do nothing otherwise. Can optionally be combined with XX. REDISMODULE...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ -0.014377312734723091, 0.033998604863882065, -0.059942469000816345, 0.03859624266624451, 0.007918975315988064, -0.00814898032695055, 0.07823874801397324, -0.027730541303753853, -0.012759384699165821, -0.008030647411942482, 0.044034674763679504, -0.019312653690576553, 0.06832152605056763, -...
0.117105
in the following conditions: 1. The value stored at key is not a sorted set or the key is empty. The range is specified according to the two double values 'min' and 'max'. Both can be infinite using the following two macros: \* `REDISMODULE\_POSITIVE\_INFINITE` for positive infinite value \* `REDISMODULE\_NEGATIVE\_INF...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ -0.006598243024200201, 0.054601702839136124, -0.024960018694400787, -0.0009194466983899474, -0.0455324687063694, -0.02166581153869629, 0.04674384742975235, 0.0642293244600296, -0.09249594062566757, -0.050633519887924194, 0.028813453391194344, -0.0573241263628006, 0.1305939108133316, -0.040...
0.022522
no special behavior is needed. REDISMODULE\_HASH\_NX: The operation is performed only if the field was not already existing in the hash. REDISMODULE\_HASH\_XX: The operation is performed only if the field was already existing, so that a new value could be associated to an existing filed, but no new fields are created. ...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ 0.006916575133800507, -0.02006099745631218, -0.05798952654004097, 0.026477821171283722, 0.00038967415457591414, -0.0745985135436058, 0.04639989137649536, -0.06396129727363586, 0.09952203929424286, -0.025558466091752052, 0.039694320410490036, 0.04795091599225998, 0.035240910947322845, -0.06...
0.07785
{ uint64\_t ms; uint64\_t seq; } RedisModuleStreamID; See also [`RedisModule\_ValueLength()`](#RedisModule\_ValueLength), which returns the length of a stream, and the conversion functions [`RedisModule\_StringToStreamID()`](#RedisModule\_StringToStreamID) and [`RedisModule\_CreateStringFromStreamID()`](#RedisModule\_C...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ 0.04003659263253212, 0.04790028557181358, -0.11337536573410034, -0.04660731181502342, -0.025768080726265907, -0.02428930252790451, 0.06792505830526352, 0.0720953494310379, -0.013948936946690083, -0.04086000472307205, -0.011413266882300377, -0.09431483596563339, 0.027374302968382835, -0.080...
0.086617
invalid arguments were given. The stream IDs are retrieved using [`RedisModule\_StreamIteratorNextID()`](#RedisModule\_StreamIteratorNextID) and for each stream ID, the fields and values are retrieved using [`RedisModule\_StreamIteratorNextField()`](#RedisModule\_StreamIteratorNextField). The iterator is freed by calli...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ 0.026078984141349792, 0.03871086612343788, -0.08160529285669327, -0.04861338064074516, 0.03630054369568825, -0.006986256688833237, 0.06241852790117264, 0.028235986828804016, -0.04092763364315033, -0.07109376043081284, -0.028392499312758446, -0.07059688121080399, 0.0036150417290627956, -0.0...
0.066906
`RedisModule\_StreamIteratorDelete` int RedisModule\_StreamIteratorDelete(RedisModuleKey \*key); \*\*Available since:\*\* 6.2.0 Deletes the current stream entry while iterating. This function can be called after [`RedisModule\_StreamIteratorNextID()`](#RedisModule\_StreamIteratorNextID) or after any calls to [`RedisMod...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ -0.0010262641590088606, -0.013266101479530334, -0.08649555593729019, -0.02228400856256485, 0.05438389629125595, -0.05506712198257446, 0.09881194680929184, -0.0009278973448090255, 0.03806270658969879, -0.06558439880609512, 0.02831001952290535, -0.028995150700211525, -0.013552796095609665, -...
0.176723
\*\*Available since:\*\* 7.0.0 Return the 'idx'-th nested call reply element of a set reply, or NULL if the reply type is wrong or the index is out of range. ### `RedisModule\_CallReplyMapElement` int RedisModule\_CallReplyMapElement(RedisModuleCallReply \*reply, size\_t idx, RedisModuleCallReply \*\*key, RedisModuleCa...
https://github.com/redis/redis-doc/blob/master/docs/reference/modules/modules-api-ref.md
master
redis
[ -0.01150701753795147, 0.028684493154287338, -0.017401395365595818, 0.0454915389418602, -0.08645709604024887, -0.026633400470018387, 0.11671622842550278, 0.060832008719444275, -0.04541684314608574, -0.035936228930950165, -0.012075139209628105, -0.05721428245306015, 0.0445873886346817, -0.08...
0.110156