9954 Commits

Author SHA1 Message Date
antirez
b7db223637 LPOS: tests + crash fix. 2020-06-11 12:39:06 +02:00
antirez
336e8a7fa2 LPOS: update to latest proposal.
See https://gist.github.com/antirez/3591c5096bc79cad8b5a992e08304f48
2020-06-11 11:18:20 +02:00
antirez
5766a69a41 LPOS: implement the final design. 2020-06-10 12:49:15 +02:00
Paul Spooren
cc04253b1d LRANK: Add command (the command will be renamed LPOS).
The `LRANK` command returns the index (position) of a given element
within a list. Using the `direction` argument it is possible to specify
going from head to tail (acending, 1) or from tail to head (decending,
-1). Only the first found index is returend. The complexity is O(N).

When using lists as a queue it can be of interest at what position a
given element is, for instance to monitor a job processing through a
work queue. This came up within the Python `rq` project which is based
on Redis[0].

[0]: https://github.com/rq/rq/issues/1197

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-06-10 12:07:40 +02:00
antirez
5d1b27f4f9 Adapt EVAL+busy script test to new behavior. 2020-06-09 12:19:14 +02:00
antirez
e286d3b4b6 Temporary fix for #7353 issue about EVAL during -BUSY. 2020-06-09 11:52:33 +02:00
hwware
44195a2047 fix server crash in STRALGO command 2020-06-08 23:36:01 -04:00
Salvatore Sanfilippo
37b318c7e0 Merge pull request #7363 from xhebox/unstable
return the correct proto version
2020-06-08 12:54:15 +02:00
Salvatore Sanfilippo
5f1defa179 Merge pull request #7370 from oranagra/no_queue_in_aborted_multi
Don't queue commands in an already aborted MULTI state
2020-06-08 11:08:08 +02:00
Salvatore Sanfilippo
783735c915 Merge pull request #7369 from oranagra/no_reject_watch
Avoid rejecting WATCH / UNWATCH, like MULTI/EXEC/DISCARD
2020-06-08 11:04:26 +02:00
Salvatore Sanfilippo
0c539f6497 Merge pull request #7357 from soloestoy/bugfix-aof-keepttl
AOF: append origin SET if no expire option
2020-06-08 11:02:00 +02:00
Salvatore Sanfilippo
6fed3d8708 Merge pull request #7371 from oranagra/fix_disconnectSlaves
fix disconnectSlaves, to try to free each slave.
2020-06-08 10:43:51 +02:00
Salvatore Sanfilippo
4ea93c04ff Merge pull request #7352 from soloestoy/donot-free-protected-client-when-blocking
donot free protected client in freeClientsInAsyncFreeQueue()
2020-06-08 10:43:17 +02:00
Oran Agra
25ae9c15ce fix disconnectSlaves, to try to free each slave.
the recent change in that loop (iteration rather than waiting for it to
be empty) was intended to avoid an endless loop in case some slave would
refuse to be freed.

but the lookup of the first client remained, which would have caused it
to try the first one again and again instead of moving on.
2020-06-08 09:50:06 +03:00
Oran Agra
0bf6face8a Don't queue commands in an already aborted MULTI state 2020-06-08 09:43:10 +03:00
Oran Agra
b64641f995 Avoid rejecting WATCH / UNWATCH, like MULTI/EXEC/DISCARD
Much like MULTI/EXEC/DISCARD, the WATCH and UNWATCH are not actually
operating on the database or server state, but instead operate on the
client state. the client may send them all in one long pipeline and check
all the responses only at the end, so failing them may lead to a
mismatch between the client state on the server and the one on the
client end, and execute the wrong commands (ones that were meant to be
discarded)

the watched keys are not actually stored in the client struct, but they
are in fact part of the client state. for instance, they're not cleared
or moved in SWAPDB or FLUSHDB.
2020-06-08 09:16:32 +03:00
xhe
4c5eb1cac1 return the correct proto version
HELLO should return the current proto version, while the code hardcoded
3
2020-06-07 13:34:55 +08:00
antirez
5fe90c04a1 Merge branch 'unstable' of github.com:/antirez/redis into unstable 2020-06-06 11:44:05 +02:00
antirez
8b15ba933d Revert "Implements sendfile for redis."
This reverts commit 5675053269b0cbc2cf525c99321c96b7c2b39abe.
2020-06-06 11:42:45 +02:00
antirez
3b452cac99 Revert "avoid using sendfile if tls-replication is enabled"
This reverts commit 13bbd165e87923558952203d310e9ad053d4d7c0.
2020-06-06 11:42:41 +02:00
zhaozhao.zz
cfc3e6f55d AOF: append origin SET if no expire option 2020-06-03 17:55:18 +08:00
zhaozhao.zz
14dc507de2 donot free protected client in freeClientsInAsyncFreeQueue
related #7234
2020-06-02 11:48:14 +08:00
Salvatore Sanfilippo
4109d2ff9d Merge pull request #7349 from oranagra/pingoff-test-race
fix pingoff  test race
2020-05-31 16:00:04 +02:00
Oran Agra
8422c4f9d6 fix pingoff test race 2020-05-31 15:51:52 +03:00
Salvatore Sanfilippo
a179552f8d Merge pull request #7334 from kevin-fwu/tls_load_chained_certs
Fix TLS certificate loading for chained certificates.
2020-05-31 14:32:56 +02:00
antirez
6df70da5ba Merge branch 'unstable' of github.com:/antirez/redis into unstable 2020-05-29 11:09:15 +02:00
antirez
7bb3ef2ec6 Fix handling of special chars in ACL LOAD.
Now it is also possible for ACL SETUSER to accept empty strings
as valid operations (doing nothing), so for instance

    ACL SETUSER myuser ""

Will have just the effect of creating a user in the default state.

This should fix #7329.
2020-05-29 11:07:13 +02:00
Salvatore Sanfilippo
fa3e801afe Merge pull request #7330 from liuzhen/unstable
fix clusters mixing accidentally by gossip
2020-05-29 10:15:26 +02:00
antirez
0071eb1311 Test: take PSYNC2 test master timeout high during switch.
This will likely avoid false positives due to trailing pings.
2020-05-28 10:47:30 +02:00
antirez
deea754004 Test: add the tracking unit as default. 2020-05-28 10:22:22 +02:00
antirez
d61473903f Merge branch 'unstable' of github.com:/antirez/redis into unstable 2020-05-28 10:08:29 +02:00
antirez
0cd63f06b4 Replication: showLatestBacklog() refactored out. 2020-05-28 10:08:16 +02:00
Salvatore Sanfilippo
504b01bdb4 Merge pull request #7327 from oranagra/test-port-ranges
tests: each test client work on a distinct port range
2020-05-28 09:52:10 +02:00
Salvatore Sanfilippo
8254ca8dc6 Merge pull request #7336 from oranagra/modules_ci_32bit
32bit CI needs to build modules correctly
2020-05-28 09:51:58 +02:00
Salvatore Sanfilippo
c42d5fb19c Merge pull request #7339 from oranagra/revive_mo_tests
Revive and adjust meaningful offset tests
2020-05-28 08:52:56 +02:00
Oran Agra
afc7ea44b5 adjust revived meaningful offset tests
these tests create several edge cases that are otherwise uncovered (at
least not consistently) by the test suite, so although they're no longer
testing what they were meant to test, it's still a good idea to keep
them in hope that they'll expose some issue in the future.
2020-05-28 09:10:51 +03:00
Oran Agra
49687e9cb6 revive meaningful offset tests 2020-05-28 08:21:24 +03:00
Oran Agra
033b4b31c7 32bit CI needs to build modules correctly 2020-05-27 18:19:30 +03:00
antirez
e1c7733319 Drop useless line from replicationCacheMaster(). 2020-05-27 17:08:51 +02:00
Oran Agra
ee211d651d tests: find_available_port start search from next port
i.e. don't start the search from scratch hitting the used ones again.
this will also reduce the likelihood of collisions (if there are any
left) by increasing the time until we re-use a port we did use in the
past.
2020-05-27 16:12:35 +03:00
Kevin Fwu
d50291e290 Fix TLS certificate loading for chained certificates.
This impacts client verification for chained certificates (such as Lets
Encrypt certificates). Client Verify requires the full chain in order to
properly verify the certificate.
2020-05-27 08:53:29 -04:00
antirez
fafe3502da Another meaningful offset test removed. 2020-05-27 12:50:02 +02:00
antirez
4c264e994e Remove the PSYNC2 meaningful offset test. 2020-05-27 12:47:34 +02:00
antirez
858845ad56 Remove the meaningful offset feature.
After a closer look, the Redis core devleopers all believe that this was
too fragile, caused many bugs that we didn't expect and that were very
hard to track. Better to find an alternative solution that is simpler.
2020-05-27 12:06:33 +02:00
antirez
a85dcd7ac3 Set a protocol error if master use the inline protocol.
We want to react a bit more aggressively if we sense that the master is
sending us some corrupted stream. By setting the protocol error we both
ensure that the replica will disconnect, and avoid caching the master so
that a full SYNC will be required. This is protective against
replication bugs.
2020-05-27 11:45:49 +02:00
Liu Zhen
7045d1cad9 fix clusters mixing accidentally by gossip
`clusterStartHandshake` will start hand handshake
and eventually send CLUSTER MEET message, which is strictly prohibited
in the REDIS CLUSTER SPEC.
Only system administrator can initiate CLUSTER MEET message.
Futher, according to the SPEC, rather than IP/PORT pairs, only nodeid
can be trusted.
2020-05-27 12:01:40 +08:00
antirez
7c0fb16790 Merge branch 'unstable' of github.com:/antirez/redis into unstable 2020-05-26 23:55:52 +02:00
antirez
d065e2b7d0 Replication: log backlog creation event. 2020-05-26 23:55:18 +02:00
Salvatore Sanfilippo
34722a4992 Merge pull request #7328 from oranagra/daily_tls_test
avoid using sendfile if tls-replication is enabled
2020-05-26 13:19:55 +02:00
Oran Agra
ee29ef0db0 daily CI test with tls 2020-05-26 14:00:26 +03:00