Commit Graph
187 Commits
Author SHA1 Message Date
John Sully d4dd336834 Merge tag '6.0.5' into unstable
Redis 6.0.5


Former-commit-id: b736a95b0d
2020-07-13 00:55:23 +00:00
John Sully c5f6cb1ba5 Add multi-master-no-forward command to reduce bus traffic with multi-master
Former-commit-id: d99d06b125
2020-07-12 19:25:19 +00:00
John Sully cd08792df7 Fix failure to merge databases on active replica sync, due to bad merge with Redis 6
Former-commit-id: cd9514f4c8
2020-07-12 01:13:22 +00:00
John Sully 2c560f27b8 replication test race
Former-commit-id: e1f3cd6ec3
2020-06-07 01:14:57 -04:00
Oran Agra f33de403ed fix pingoff test race 2020-06-06 11:44:21 +02:00
John Sully 9fb7552b63 PSYNC test shouldn't wait forever
Former-commit-id: 130613e166
2020-06-01 16:13:58 -04:00
John Sully 2b08505fed PSYNC test reliability improvements (test only issue)
Former-commit-id: 50fd4fa7e6
2020-06-01 16:01:26 -04:00
John Sully 4f7102f46c Fix for issue #187 we need to properly handle the case where a key with a subkey expirey itself expires during load
Former-commit-id: e6a9a6b428
2020-06-01 15:33:19 -04:00
John Sully df5b0f0be5 sendfile has high latency in some scenarios, don't use it
Former-commit-id: 1eb0e3c1c6
2020-05-31 23:22:25 -04:00
John Sully eddc1ad46a Don't start multimaster tests until all nodes are connected
Former-commit-id: 202b97eff7
2020-05-31 22:50:30 -04:00
John Sully 2aed24d0a5 active replica tests on slow computers
Former-commit-id: c9920849dd
2020-05-29 01:58:15 -04:00
John Sully acde7c340e Fix test issue with TLS
Former-commit-id: 81b240f81d
2020-05-29 01:44:52 -04:00
John Sully cfe9f8f3bc Merge tag '6.0.4' into unstable
Redis 6.0.4.


Former-commit-id: 9c31ac7925
2020-05-29 00:57:07 -04:00
antirez 59cd4c9f65 Test: take PSYNC2 test master timeout high during switch.
This will likely avoid false positives due to trailing pings.
2020-05-28 10:56:14 +02:00
Oran Agra ab2984b1e2 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 10:09:51 +02:00
Oran Agra 1ff5a222de revive meaningful offset tests 2020-05-28 10:09:51 +02:00
antirez 3f8d113f1b Another meaningful offset test removed. 2020-05-28 10:09:51 +02:00
antirez d4541349dc Remove the PSYNC2 meaningful offset test. 2020-05-28 10:09:51 +02:00
antirez 8f10137227 Test: PSYNC2 test can now show server logs. 2020-05-28 10:09:51 +02:00
John Sully 2d783a3cbf Merge tag '6.0.2' into unstable
Redis 6.0.2


Former-commit-id: a010e4a4b2
2020-05-22 16:45:18 -04:00
John Sully 1eeb5de69f Merge commit 'c57d9146f41f4b661d9d2cb48b83b3abc757ba0e' into unstable
Former-commit-id: d74871da40
2020-05-22 15:36:44 -04:00
Qu Chen 58fc456cbd 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:37:59 +02:00
Oran Agra 00d8b92b89 fix valgrind test failure in replication test
in b4416280c i added more keys to that test to make it run longer
but in valgrind this now means the test times out, give valgrind more
time.
2020-05-22 12:37:49 +02:00
Oran Agra 5e17e6276c add regression test for the race in #7205
with the original version of 6.0.0, this test detects an excessive full
sync.
with the fix in 1a7cd2c0e, this test detects memory corruption,
especially when using libc allocator with or without valgrind.
2020-05-22 12:37:49 +02:00
antirez 96e7c011e2 Improve the PSYNC2 test reliability. 2020-05-22 12:37:49 +02:00
John Sully 27eb239f1a Fix bad merge in CI.yml
Former-commit-id: 6311d709c3
2020-05-21 22:09:06 -04:00
Oran Agra 9da134cd88 fix redis 6.0 not freeing closed connections during loading.
This bug was introduced by a recent change in which readQueryFromClient
is using freeClientAsync, and despite the fact that now
freeClientsInAsyncFreeQueue is in beforeSleep, that's not enough since
it's not called during loading in processEventsWhileBlocked.
furthermore, afterSleep was called in that case but beforeSleep wasn't.

This bug also caused slowness sine the level-triggered mode of epoll
kept signaling these connections as readable causing us to keep doing
connRead again and again for ll of these, which keep accumulating.

now both before and after sleep are called, but not all of their actions
are performed during loading, some are only reserved for the main loop.

fixes issue #7215
2020-05-14 11:29:43 +02:00
Oran Agra 5c41802d55 fix unstable replication test
this test which has coverage for varoius flows of diskless master was
failing randomly from time to time.

the failure was:
[err]: diskless all replicas drop during rdb pipe in tests/integration/replication.tcl
log message of '*Diskless rdb transfer, last replica dropped, killing fork child*' not found

what seemed to have happened is that the master didn't detect that all
replicas dropped by the time the replication ended, it thought that one
replica is still connected.

now the test takes a few seconds longer but it seems stable.
2020-05-14 11:29:43 +02:00
John 181fadb708 more reliability fixes for multimaster
Former-commit-id: 3543a3c763
2020-05-11 05:38:21 -04:00
John 3d6f990104 Make multimaster tests more reliable
Former-commit-id: 3122912920
2020-05-11 05:23:47 -04:00
Oran Agra 3d3861dd88 add daily github actions with libc malloc and valgrind
* fix memlry leaks with diskless replica short read.
* fix a few timing issues with valgrind runs
* fix issue with valgrind and watchdog schedule signal

about the valgrind WD issue:
the stack trace test in logging.tcl, has issues with valgrind:
==28808== Can't extend stack to 0x1ffeffdb38 during signal delivery for thread 1:
==28808==   too small or bad protection modes

it seems to be some valgrind bug with SA_ONSTACK.
SA_ONSTACK seems unneeded since WD is not recursive (SA_NODEFER was removed),
also, not sure if it's even valid without a call to sigaltstack()
2020-05-08 10:37:35 +02:00
Oran Agra ea63aea72d fix loading race in psync2 tests 2020-04-28 11:20:15 +02:00
Oran Agra e4d2bb62b2 Keep track of meaningful replication offset in replicas too
Now both master and replicas keep track of the last replication offset
that contains meaningful data (ignoring the tailing pings), and both
trim that tail from the replication backlog, and the offset with which
they try to use for psync.

the implication is that if someone missed some pings, or even have
excessive pings that the promoted replica has, it'll still be able to
psync (avoid full sync).

the downside (which was already committed) is that replicas running old
code may fail to psync, since the promoted replica trims pings form it's
backlog.

This commit adds a test that reproduces several cases of promotions and
demotions with stale and non-stale pings

Background:
The mearningful offset on the master was added recently to solve a problem were
the master is left all alone, injecting PINGs into it's backlog when no one is
listening and then gets demoted and tries to replicate from a replica that didn't
have any of the PINGs (or at least not the last ones).

however, consider this case:
master A has two replicas (B and C) replicating directly from it.
there's no traffic at all, and also no network issues, just many pings in the
tail of the backlog. now B gets promoted, A becomes a replica of B, and C
remains a replica of A. when A gets demoted, it trims the pings from its
backlog, and successfully replicate from B. however, C is still aware of
these PINGs, when it'll disconnect and re-connect to A, it'll ask for something
that's not in the backlog anymore (since A trimmed the tail of it's backlog),
and be forced to do a full sync (something it didn't have to do before the
meaningful offset fix).

Besides that, the psync2 test was always failing randomly here and there, it
turns out the reason were PINGs. Investigating it shows the following scenario:

cycle 1: redis #1 is master, and all the rest are direct replicas of #1
cycle 2: redis #2 is promoted to master, #1 is a replica of #2 and #3 is replica of #1
now we see that when #1 is demoted it prints:
17339:S 21 Apr 2020 11:16:38.523 * Using the meaningful offset 3929963 instead of 3929977 to exclude the final PINGs (14 bytes difference)
17339:S 21 Apr 2020 11:16:39.391 * Trying a partial resynchronization (request e2b3f8817735fdfe5fa4626766daa938b61419e5:3929964).
17339:S 21 Apr 2020 11:16:39.392 * Successful partial resynchronization with master.
and when #3 connects to the demoted #2, #2 says:
17339:S 21 Apr 2020 11:16:40.084 * Partial resynchronization not accepted: Requested offset for secondary ID was 3929978, but I can reply up to 3929964

so the issue here is that the meaningful offset feature saved the day for the
demoted master (since it needs to sync from a replica that didn't get the last
ping), but it didn't help one of the other replicas which did get the last ping.
2020-04-27 15:52:49 +02:00
John Sully c498381b1a Merge branch 'unstable' into redis_6_merge
Former-commit-id: cc9924ffa6
2020-04-15 23:00:13 -04:00
John Sully 24223ed818 Multithreading reliability, force single thread for test relying on internal behavior
Former-commit-id: 033761c5f9
2020-04-15 20:52:25 -04:00
John Sully 02147b4be0 Merge commit '0f7dfc378ce5ab0524ac28b6142545bc41435386' into redis_6_merge
Former-commit-id: cc3ebbe519
2020-04-14 22:19:29 -04:00
John Sully aa48225a76 Merge commit '76d57161d960f27ac92765118e3b80fef8847b8f' into redis_6_merge
Former-commit-id: 320bc3c032
2020-04-14 21:04:42 -04:00
John Sully eeca58777d Fix subkey expires not replicating correctly, and AOF issues
Former-commit-id: bd183cdee1
2020-04-04 21:52:27 -04:00
antirez e257f121e1 PSYNC2: meaningful offset test. 2020-03-25 15:55:24 +01:00
Oran Agra 6173815408 fix for flaky psync2 test
*** [err]: PSYNC2: total sum of full synchronizations is exactly 4 in tests/integration/psync2.tcl
Expected 5 == 4 (context: type eval line 6 cmd {assert {$sum == 4}} proc ::test)

issue was that sometime the test got an unexpected full sync since it
tried to switch to the replica before it was in sync with it's master.
2020-03-12 15:53:47 +01:00
John Sully ee99605def Merge branch 'unstable' into redis_6_merge
Former-commit-id: 18a5f46b61
2020-02-11 02:39:08 -05:00
John Sully 9dc9707693 Add missing test file
Former-commit-id: 0c101dccc8
2020-02-10 18:15:29 -05:00
John Sully 9cd3b8253d Ensure multi-master works for ring topologies
Former-commit-id: a7cc3aac28
2020-02-10 00:25:03 -05:00
John Sully a21c81c30e Add test to detect issue #137 and #132
Former-commit-id: 49d86746ed
2020-02-06 23:31:12 -05:00
John Sully 8e7f3304b2 More threading fixes from merge
Former-commit-id: 4a980f4ddb
2020-01-28 17:54:00 -05:00
John Sully 39378f982e Fix most tests (still some failures)
Former-commit-id: da83e84125
2020-01-27 18:16:19 -05:00
John Sully 8e5fe97525 Merge remote-tracking branch 'redis/6.0' into redis_merge
Former-commit-id: ef9a3cadcf
2020-01-27 02:55:48 -05:00
zhaozhao.zz 58554396d6 incrbyfloat: fix issue #5256 ttl lost after propagate 2019-12-18 15:44:51 +08:00
John Sully 633b7398e1 Fix issue #107, active replicas do their own expires
Former-commit-id: 8e4f323439
2019-11-20 19:44:31 -05:00
John Sully df8a20a744 Signals can happen on any thread, so look for the signal handler not the command on the callstack
Former-commit-id: f1d2b29450
2019-10-24 23:30:08 -04:00