9904 Commits

Author SHA1 Message Date
antirez
0b02b27705 Port PR #6110 to new connection object code. 2020-01-17 10:47:38 +01:00
Vasyl Melnychuk
037755edd4 Make error when submitting command in incorrect context more explicit
So error message `ERR only (P)SUBSCRIBE / (P)UNSUBSCRIBE / PING / QUIT allowed in this context` will become
`ERR 'get' command submitted, but only (P)SUBSCRIBE / (P)UNSUBSCRIBE / PING / QUIT allowed in this context`
2020-01-17 10:47:38 +01:00
WuYunlong
1588f30ae2 Fix potential memory leak of clusterLoadConfig(). 2020-01-17 10:47:38 +01:00
antirez
a6eb3f8bfb A few comments about main thread serving I/O as well.
Related to #6110.
2020-01-17 10:47:38 +01:00
WuYunlong
2a3a035b64 Fix potential memory leak of rioWriteBulkStreamID(). 2020-01-17 10:47:38 +01:00
zhaozhao.zz
1f76ff2fb9 Threaded IO: use main thread to handle read work 2020-01-17 10:47:38 +01:00
zhaozhao.zz
0a3410db70 Threaded IO: use main thread to handle write work 2020-01-17 10:47:38 +01:00
John Sully
9af43f254d Merge branch 'unstable' of https://github.com/JohnSully/KeyDB into unstable
Former-commit-id: 762396d997b4e155778ba62346376b37b4673154
2020-01-11 16:35:06 -05:00
John Sully
6e096ca33e Avoid crash due to excessive posted functions for AOF rewrite
Former-commit-id: c575e7df9408ad7bd66ac7a104a38e841d525681
2020-01-11 16:34:30 -05:00
John Sully
b9b8272724 Avoid crash due to excessive posted functions for AOF rewrite
Former-commit-id: aa6409f2e8a37288eb4953fbcf3a82e02545348b
2020-01-11 16:34:09 -05:00
John Sully
18df86fcde Merge branch 'unstable' into RELEASE_5
Former-commit-id: e603e57588d040f96876d6b281a3867a8db53f6a
2020-01-10 17:46:23 -05:00
John Sully
18cc4b3ebe Ignore other flags after pro is enabled since we won't understand them
Former-commit-id: 049b48ef79fdde4c9b1c9f227a329bd9223e2b1d
2020-01-10 17:46:02 -05:00
John Sully
900e596440 Update README.md
Former-commit-id: 0ba0a6ab0a2c552e17a4344f9935b40f26c694e1
2020-01-10 14:21:11 -05:00
John Sully
09ff507ee9 Update graphs
Former-commit-id: 7475ea1b0b7d8b2f7a8dfb6c6b754126d5160e5b
2020-01-10 14:19:44 -05:00
ShooterIT
4e0c2ff1d8 Rename rdb asynchronously 2020-01-10 13:16:25 +01:00
Leo Murillo
b6caf319e5 Fix bug on KEYS command where pattern starts with * followed by \x00 (null char). 2020-01-10 13:16:25 +01:00
Jamie Scott
0b36c7eb26 Update to directive in redis.conf (missing s)
The directive tls-prefer-server-cipher is actually tls-prefer-server-ciphers in config.c. This results in a failed directive call shown below. This pull request adds the "s" in ciphers so that the directive is able to be properly called in config.c

ubuntu@ip-172-31-16-31:~/redis$ src/redis-server ./redis.conf 

*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 200
>>> 'tls-prefer-server-cipher yes'
Bad directive or wrong number of arguments
2020-01-10 13:16:25 +01:00
antirez
a4f462bebb Free fakeclient argv on AOF error.
We exit later, so no bug fixed, but it is more correct.

See #6054, thanks to @ShooterIT for finding the issue.
2020-01-10 13:16:25 +01:00
antirez
d08b8b92fc Git ignore: ignore more files. 2020-01-10 13:16:14 +01:00
Guy Benoish
3913ffd5bc Blocking XREAD[GROUP] should always reply with valid data (or timeout)
This commit solves the following bug:
127.0.0.1:6379> XGROUP CREATE x grp $ MKSTREAM
OK
127.0.0.1:6379> XADD x 666 f v
"666-0"
127.0.0.1:6379> XREADGROUP GROUP grp Alice BLOCK 0 STREAMS x >
1) 1) "x"
   2) 1) 1) "666-0"
         2) 1) "f"
            2) "v"
127.0.0.1:6379> XADD x 667 f v
"667-0"
127.0.0.1:6379> XDEL x 667
(integer) 1
127.0.0.1:6379> XREADGROUP GROUP grp Alice BLOCK 0 STREAMS x >
1) 1) "x"
   2) (empty array)

The root cause is that we use s->last_id in streamCompareID
while we should use the last *valid* ID
2020-01-10 13:16:14 +01:00
John Sully
2539a8a3ce Add support for incremental build with header files 2020-01-10 13:16:14 +01:00
WuYunlong
7030e66807 Fix petential cluster link error.
Funcion adjustOpenFilesLimit() has an implicit parameter, which is server.maxclients.
This function aims to ajust maximum file descriptor number according to server.maxclients
by best effort, which is "bestlimit" could be lower than "maxfiles" but greater than "oldlimit".
When we try to increase "maxclients" using CONFIG SET command, we could increase maximum
file descriptor number to a bigger value without calling aeResizeSetSize the same time.
When later more and more clients connect to server, the allocated fd could be bigger and bigger,
and eventually exceeds events size of aeEventLoop.events. When new nodes joins the cluster,
new link is created, together with new fd, but when calling aeCreateFileEvent, we did not
check the return value. In this case, we have a non-null "link" but the associated fd is not
registered.

So when we dynamically set "maxclients" we could reach an inconsistency between maximum file
descriptor number of the process and server.maxclients. And later could cause cluster link and link
fd inconsistency.

While setting "maxclients" dynamically, we consider it as failed when resulting "maxclients" is not
the same as expected. We try to restore back the maximum file descriptor number when we failed to set
"maxclients" to the specified value, so that server.maxclients could act as a guard as before.
2020-01-10 13:16:14 +01:00
Yossi Gottlieb
3f8a690161 Add REDISMODULE_CTX_FLAGS_MULTI_DIRTY. 2020-01-10 13:16:03 +01:00
hwware
86fd8f0e3f typo fix in acl.c 2020-01-10 13:16:03 +01:00
Itamar Haber
d6a6b6f40c Adjusts 'io_threads_num' max to 128
Instead of 512, use the defined max from networking.c
2020-01-10 13:16:03 +01:00
antirez
4a63d5d881 XCLAIM: Create the consumer only on successful claims.
Fixes #6744.
2020-01-08 12:31:39 +01:00
yz1509
28622cc532 avoid sentinel changes promoted_slave to be its own replica. 2020-01-08 12:31:25 +01:00
John Sully
c6cda62f04 Merge branch 'unstable' into RELEASE_5
Former-commit-id: d0654af74f2090060a74aa25b26637a197a6179f
2020-01-06 14:24:49 -05:00
John Sully
174a8b886d pro launch should respect KEYDB_PRO_DIRECTORY
Former-commit-id: d5f8df59977194ee0cfce798364eb5620435e6f3
2020-01-06 14:24:37 -05:00
John Sully
2d5197d30e Bump version
Former-commit-id: 39acb312efbb06f38e98c3ebbb98d17a556b050a
2020-01-06 12:07:57 -05:00
John Sully
0bc26f88bb Merge branch 'unstable' into RELEASE_5
Former-commit-id: b643c3820485886d2a1911af7bc1cd8419e21f99
2020-01-06 12:07:11 -05:00
John Sully
4a6748d29f Merge branch 'unstable' of https://github.com/JohnSully/KeyDB into unstable
Former-commit-id: dd70f5efd732c1b771030a6254fc1a4e9fc45356
2020-01-06 12:04:00 -05:00
John Sully
5907dccdae Add new flags to example configuration file
Former-commit-id: bb38628f0ef4f417db968154cc37d103f11b4c63
2020-01-05 20:19:28 -05:00
John Sully
e49ec97f98 subkey expire testes
Former-commit-id: 0cf3af6857c192bd03656c28b5a0a2bb11416b8c
2020-01-03 16:50:13 -05:00
John Sully
6ab3e82e45 Drop severity of master disconnect log when multimaster is enabled
Former-commit-id: edb993d52b25c30392c6eb1e60896498f991a223
2020-01-02 15:36:02 -05:00
John Sully
85c8fc72b7 Fix issue where expire is lost when performing a defrag
Former-commit-id: aea333bb78fafabbddb340dfd4c232c2e207cfba
2020-01-01 20:41:17 -05:00
John Sully
2e50d383a6 C++ wrapper classes for SDS
Former-commit-id: 45817db8c3a86815945359113dcbccfde4257ce5
2020-01-01 19:13:48 -05:00
antirez
d22d40a2eb Fix active expire division by zero.
Likely fix #6723.

This is what happens AFAIK: we enter the main loop where we expire stuff
until a given percentage of keys is still found to be logically expired.
There are however other potential exit conditions.

However the "sampled" variable is not always incremented inside the
loop, because we may found no valid slot as we scan the hash table, but
just NULLs ad dict entries. So when the do/while loop condition is
triggered at the end, we do (expired*100/sampled), dividing by zero if
we sampled 0 keys.
2020-01-01 18:10:39 +01:00
John Sully
ad0cb8da40 Fix issue #130 due to fastlock timeout reduction
Former-commit-id: dbef17c2e16f115733242721e9b5a43f01e7a554
2020-01-01 11:52:00 -05:00
antirez
c2461ba531 Fix duplicated CLIENT SETNAME reply.
Happened when we set the name to "" to cancel the name.
Was introduced during the RESP3 refactoring.

See #6036.
2019-12-29 15:46:31 +01:00
Guy Benoish
444dd1075c Stream: Handle streamID-related edge cases
This commit solves several edge cases that are related to
exhausting the streamID limits: We should correctly calculate
the succeeding streamID instead of blindly incrementing 'seq'
This affects both XREAD and XADD.

Other (unrelated) changes:
Reply with a better error message when trying to add an entry
to a stream that has exhausted last_id
2019-12-29 15:46:31 +01:00
Oran Agra
f866b31a74 config.c adjust config limits and mutable
- make lua-replicate-commands mutable (it never was, but i don't see why)
- make tcp-backlog immutable (fix a recent refactory mistake)
- increase the max limit of a few configs to match what they were before
the recent refactory
2019-12-29 15:46:31 +01:00
antirez
1b56a873d5 Inline protocol: handle empty strings well.
This bug is from the first version of Redis. Probably the problem here
is that before we used an SDS split function that created empty strings
for additional spaces, like in "SET    foo          bar".
AFAIK later we replaced it with the curretn sdssplitarg() API that has
no such a problem. As a result, we introduced a bug, where it is no
longer possible to do something like:

    SET foo ""

Using the inline protocol. Now it is fixed.
2019-12-29 15:46:31 +01:00
antirez
a640d1bb5c Fix ip and missing mode in RM_GetClusterNodeInfo(). 2019-12-29 15:46:31 +01:00
John Sully
55cddbe82f Fix some static analysis warnings
Former-commit-id: 42a8f22c21706f9ddcaa63ceafc5ad817c1fe876
2019-12-27 18:17:22 -05:00
John Sully
8f20fc7f33 Ignore dependency files
Former-commit-id: 6e06e0dfc7cd572d93cce99c4b8b8b0b59e95e60
2019-12-27 17:45:56 -05:00
John Sully
082e493d32 Make incremental building work with header files
Former-commit-id: bf500ab44b82e9a3ad7f341b7d2f7f583fdf336f
2019-12-27 17:34:41 -05:00
John Sully
e530793e82 Multimaster requires Active Replication
Former-commit-id: 4d4eca54336c73848ffa36cb1778b7c853f77f7f
2019-12-21 18:24:02 -05:00
Petr Vaněk
8146f24391 Rename redis.conf to keydb.conf
Former-commit-id: 4b01ad1e30568a5385881accedd8a841c7a7882f
2019-12-21 15:00:24 -05:00
Petr Vaněk
8c7a04d747 Rename default pid file
Former-commit-id: 3b60929bdc95f43901799042b302c713b520aee8
2019-12-21 15:00:24 -05:00