All the options in redis.conf are also supported as options using the command
All the options in redis.conf are also supported as options using the command
...
@@ -216,7 +216,7 @@ Inside the root are the following important directories:
...
@@ -216,7 +216,7 @@ Inside the root are the following important directories:
*`src`: contains the Redis implementation, written in C.
*`src`: contains the Redis implementation, written in C.
*`tests`: contains the unit tests, implemented in Tcl.
*`tests`: contains the unit tests, implemented in Tcl.
*`deps`: contains libraries Redis uses. Everything needed to compile Redis is inside this directory; your system just needs to provide `libc`, a POSIX compatible interface and a C compiler. Notably `deps` contains a copy of `jemalloc`, which is the default allocator of Redis under Linux. Note that under `deps` there are also things which started with the Redis project, but for which the main repository is not `anitrez/redis`. An exception to this rule is `deps/geohash-int` which is the low level geocoding library used by Redis: it originated from a different project, but at this point it diverged so much that it is developed as a separated entity directly inside the Redis repository.
*`deps`: contains libraries Redis uses. Everything needed to compile Redis is inside this directory; your system just needs to provide `libc`, a POSIX compatible interface and a C compiler. Notably `deps` contains a copy of `jemalloc`, which is the default allocator of Redis under Linux. Note that under `deps` there are also things which started with the Redis project, but for which the main repository is not `antirez/redis`.
There are a few more directories but they are not very important for our goals
There are a few more directories but they are not very important for our goals
here. We'll focus mostly on `src`, where the Redis implementation is contained,
here. We'll focus mostly on `src`, where the Redis implementation is contained,
...
@@ -227,7 +227,7 @@ of complexity incrementally.
...
@@ -227,7 +227,7 @@ of complexity incrementally.
Note: lately Redis was refactored quite a bit. Function names and file
Note: lately Redis was refactored quite a bit. Function names and file
names have been changed, so you may find that this documentation reflects the
names have been changed, so you may find that this documentation reflects the
`unstable` branch more closely. For instance in Redis 3.0 the `server.c`
`unstable` branch more closely. For instance in Redis 3.0 the `server.c`
and `server.h` files were named to `redis.c` and `redis.h`. However the overall
and `server.h` files were named `redis.c` and `redis.h`. However the overall
structure is the same. Keep in mind that all the new developments and pull
structure is the same. Keep in mind that all the new developments and pull
requests should be performed against the `unstable` branch.
requests should be performed against the `unstable` branch.
...
@@ -245,7 +245,7 @@ A few important fields in this structure are:
...
@@ -245,7 +245,7 @@ A few important fields in this structure are:
*`server.db` is an array of Redis databases, where data is stored.
*`server.db` is an array of Redis databases, where data is stored.
*`server.commands` is the command table.
*`server.commands` is the command table.
*`server.clients` is a linked list of clients connected to the server.
*`server.clients` is a linked list of clients connected to the server.
*`server.master` is a special client, the master, if the instance is a slave.
*`server.master` is a special client, the master, if the instance is a replica.
There are tons of other fields. Most fields are commented directly inside
There are tons of other fields. Most fields are commented directly inside
the structure definition.
the structure definition.
...
@@ -323,7 +323,7 @@ Inside server.c you can find code that handles other vital things of the Redis s
...
@@ -323,7 +323,7 @@ Inside server.c you can find code that handles other vital things of the Redis s
networking.c
networking.c
---
---
This file defines all the I/O functions with clients, masters and slaves
This file defines all the I/O functions with clients, masters and replicas
(which in Redis are just special clients):
(which in Redis are just special clients):
*`createClient()` allocates and initializes a new client.
*`createClient()` allocates and initializes a new client.
...
@@ -390,16 +390,16 @@ replication.c
...
@@ -390,16 +390,16 @@ replication.c
This is one of the most complex files inside Redis, it is recommended to
This is one of the most complex files inside Redis, it is recommended to
approach it only after getting a bit familiar with the rest of the code base.
approach it only after getting a bit familiar with the rest of the code base.
In this file there is the implementation of both the master and slave role
In this file there is the implementation of both the master and replica role
of Redis.
of Redis.
One of the most important functions inside this file is `replicationFeedSlaves()` that writes commands to the clients representing slave instances connected
One of the most important functions inside this file is `replicationFeedSlaves()` that writes commands to the clients representing replica instances connected
to our master, so that the slaves can get the writes performed by the clients:
to our master, so that the replicas can get the writes performed by the clients:
this way their data set will remain synchronized with the one in the master.
this way their data set will remain synchronized with the one in the master.
This file also implements both the `SYNC` and `PSYNC` commands that are
This file also implements both the `SYNC` and `PSYNC` commands that are
used in order to perform the first synchronization between masters and
used in order to perform the first synchronization between masters and
slaves, or to continue the replication after a disconnection.
replicas, or to continue the replication after a disconnection.
@@ -2,7 +2,6 @@ This directory contains all Redis dependencies, except for the libc that
...
@@ -2,7 +2,6 @@ This directory contains all Redis dependencies, except for the libc that
should be provided by the operating system.
should be provided by the operating system.
***Jemalloc** is our memory allocator, used as replacement for libc malloc on Linux by default. It has good performances and excellent fragmentation behavior. This component is upgraded from time to time.
***Jemalloc** is our memory allocator, used as replacement for libc malloc on Linux by default. It has good performances and excellent fragmentation behavior. This component is upgraded from time to time.
***geohash-int** is inside the dependencies directory but is actually part of the Redis project, since it is our private fork (heavily modified) of a library initially developed for Ardb, which is in turn a fork of Redis.
***hiredis** is the official C client library for Redis. It is used by redis-cli, redis-benchmark and Redis Sentinel. It is part of the Redis official ecosystem but is developed externally from the Redis repository, so we just upgrade it as needed.
***hiredis** is the official C client library for Redis. It is used by redis-cli, redis-benchmark and Redis Sentinel. It is part of the Redis official ecosystem but is developed externally from the Redis repository, so we just upgrade it as needed.
***linenoise** is a readline replacement. It is developed by the same authors of Redis but is managed as a separated project and updated as needed.
***linenoise** is a readline replacement. It is developed by the same authors of Redis but is managed as a separated project and updated as needed.
***lua** is Lua 5.1 with minor changes for security and additional libraries.
***lua** is Lua 5.1 with minor changes for security and additional libraries.
...
@@ -42,11 +41,6 @@ the following additional steps:
...
@@ -42,11 +41,6 @@ the following additional steps:
changed, otherwise you could just copy the old implementation if you are
changed, otherwise you could just copy the old implementation if you are
upgrading just to a similar version of Jemalloc.
upgrading just to a similar version of Jemalloc.
Geohash
---
This is never upgraded since it's part of the Redis project. If there are changes to merge from Ardb there is the need to manually check differences, but at this point the source code is pretty different.