9527 Commits

Author SHA1 Message Date
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
Oran Agra
13bbd165e8 avoid using sendfile if tls-replication is enabled
this obviously broke the tests, but went unnoticed so far since tls
wasn't often tested.
2020-05-26 13:52:06 +03:00
Oran Agra
8f0c339892 tests: each test client work on a distinct port range
apparently when running tests in parallel (the default of --clients 16),
there's a chance for two tests to use the same port.
specifically, one test might shutdown a master and still have the
replica up, and then another test will re-use the port number of master
for another master, and then that replica will connect to the master of
the other test.

this can cause a master to count too many full syncs and fail a test if
we run the tests with --single integration/psync2 --loop --stop

see Probmem 2 in #7314
2020-05-26 11:17:08 +03:00
antirez
d325091ba6 Test: PSYNC2 test can now show server logs. 2020-05-25 20:26:29 +02:00
antirez
1bf75eaca7 Clarify what is happening in PR #7320. 2020-05-25 11:47:38 +02:00
Salvatore Sanfilippo
b7bb6a8ad9 Merge pull request #7320 from soloestoy/second-replid-offset-should-be-meaningful-offset
PSYNC2: second_replid_offset should be real meaningful offset
2020-05-25 11:37:25 +02:00
zhaozhao.zz
dd7739f314 PSYNC2: second_replid_offset should be real meaningful offset
After adjustMeaningfulReplOffset(), all the other related variable
should be updated, including server.second_replid_offset.

Or the old version redis like 5.0 may receive wrong data from
replication stream, cause redis 5.0 can sync with redis 6.0,
but doesn't know meaningful offset.
2020-05-25 11:17:54 +08:00
Salvatore Sanfilippo
07cdd478b3 Merge pull request #7315 from oranagra/ci-32bit
add CI for 32bit build
2020-05-24 09:50:04 +02:00
Oran Agra
c41e04bf41 add CI for 32bit build 2020-05-24 09:35:45 +03:00
antirez
7f994abc48 Make disconnectSlaves() synchronous in the base case.
Otherwise we run into that:

Backtrace:
src/redis-server 127.0.0.1:21322(logStackTrace+0x45)[0x479035]
src/redis-server 127.0.0.1:21322(sigsegvHandler+0xb9)[0x4797f9]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7fd373c5e390]
src/redis-server 127.0.0.1:21322(_serverAssert+0x6a)[0x47660a]
src/redis-server 127.0.0.1:21322(freeReplicationBacklog+0x42)[0x451282]
src/redis-server 127.0.0.1:21322[0x4552d4]
src/redis-server 127.0.0.1:21322[0x4c5593]
src/redis-server 127.0.0.1:21322(aeProcessEvents+0x2e6)[0x42e786]
src/redis-server 127.0.0.1:21322(aeMain+0x1d)[0x42eb0d]
src/redis-server 127.0.0.1:21322(main+0x4c5)[0x42b145]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fd3738a3830]
src/redis-server 127.0.0.1:21322(_start+0x29)[0x42b409]

Since we disconnect all the replicas and free the replication backlog in
certain replication paths, and the code that will free the replication
backlog expects that no replica is connected.

However we still need to free the replicas asynchronously in certain
cases, as documented in the top comment of disconnectSlaves().
2020-05-22 19:29:09 +02:00
antirez
8ecf2998ca Merge branch 'unstable' of github.com:/antirez/redis into unstable 2020-05-22 16:31:05 +02:00
antirez
ba7f0b7719 Fix #7306 less aggressively.
Citing from the issue:

btw I suggest we change this fix to something else:
* We revert the fix.
* We add a call that disconnects chained replicas in the place where we trim the replica (that is a master i this case) offset.
This way we can avoid disconnections when there is no trimming of the backlog.

Note that we now want to disconnect replicas asynchronously in
disconnectSlaves(), because it's in general safer now that we can call
it from freeClient(). Otherwise for instance the command:

    CLIENT KILL TYPE master

May crash: clientCommand() starts running the linked of of clients,
looking for clients to kill. However it finds the master, kills it
calling freeClient(), but this in turn calls replicationCacheMaster()
that may also call disconnectSlaves() now. So the linked list iterator
of the clientCommand() will no longer be valid.
2020-05-22 16:29:53 +02:00
Salvatore Sanfilippo
42afb7e635 Merge pull request #7096 from ShooterIT/sendfile
Implements sendfile for redis.
2020-05-22 13:55:46 +02:00
Salvatore Sanfilippo
51f840fd47 Merge pull request #7305 from madolson/unstable-connection
EAGAIN not handled for TLS during diskless load
2020-05-22 12:25:40 +02:00
Salvatore Sanfilippo
a688552350 Merge pull request #7306 from QuChen88/chained-replica-offset
Disconnect chained replicas when the replica performs PSYNC with the master always to avoid replication offset mismatch between master and chained replicas
2020-05-22 12:23:07 +02:00
Qu Chen
7de04d4d36 Disconnect chained replicas when the replica performs PSYNC with the master always to avoid replication offset mismatch between master and chained replicas. 2020-05-21 18:42:10 -07:00
Madelyn Olson
5d6f9cd3b1 EAGAIN for tls during diskless load 2020-05-21 15:20:59 -07:00
Salvatore Sanfilippo
a7d4f5f144 Merge pull request #7304 from hwware/lcs_fix
fix server crash for STRALGO command
2020-05-22 00:18:27 +02:00
hwware
7c87d86aef using moreargs variable 2020-05-21 18:13:35 -04:00
hwware
c4776244f8 fix server crash for STRALGO command 2020-05-21 17:30:36 -04:00
Salvatore Sanfilippo
5c4a67882a Merge pull request #7300 from ShooterIT/comment
Replace 'addDeferredMultiBulkLength' with 'addReplyDeferredLen' in comment
2020-05-21 15:53:01 +02:00
Salvatore Sanfilippo
5746b71485 Merge pull request #7288 from yossigo/tls-protocols-redis-conf-example
TLS: Improve tls-protocols clarity in redis.conf.
2020-05-21 15:49:37 +02:00
Salvatore Sanfilippo
a1bda4a393 Merge pull request #7299 from ShooterIT/reply-bytes
Fix reply bytes calculation error on 32bit platform
2020-05-21 15:47:15 +02:00
ShooterIT
fbe0c03030 Replace addDeferredMultiBulkLength with addReplyDeferredLen in comment 2020-05-21 21:45:35 +08:00
ShooterIT
9c0aa1a95b Fix reply bytes calculation error
Fix #7275.
2020-05-21 21:00:30 +08:00
Salvatore Sanfilippo
f38d0ec966 Merge pull request #7296 from soloestoy/tracking-broken-redir
Tracking: flag CLIENT_TRACKING_BROKEN_REDIR when redir broken
2020-05-21 09:26:12 +02:00
zhaozhao.zz
4a93049285 Tracking: flag CLIENT_TRACKING_BROKEN_REDIR when redir broken 2020-05-21 13:57:29 +08:00