12492 Commits

Author SHA1 Message Date
yoav-steinberg
80105d7026 Remove cron saving during BGSAVE test. (#8688)
This fixes a race where a bgsave can start during the test after we verified no bgsave is running.
2021-03-24 15:14:47 +02:00
Oran Agra
5653935571 Corrupt stream key access to uninitialized memory (#8681)
the corrupt-dump-fuzzer test found a case where an access to a corrupt
stream would have caused accessing to uninitialized memory.
now it'll panic instead.

The issue was that there was a stream that says it has more than 0
records, but looking for the max ID came back empty handed.

p.s. when sanitize-dump-payload is used, this corruption is detected,
and the RESTORE command is gracefully rejected.
2021-03-24 11:33:49 +02:00
Itamar Haber
c5e9d564d2 Fixes a typo in DEBUG HELP (#8638) 2021-03-24 11:11:38 +02:00
chenyangyang
fa0118532d Add RM_GetAbsExpire/RM_SetAbsExpire for module. (#8564)
Add a check to ensure that the expire parameters in RM_SetExpire and RM_SetAbsExpire must be positive.
2021-03-24 11:10:15 +02:00
Oran Agra
dd8cefdeea Fix crash report killed by message (#8683)
We sometimes see the crash report saying we were killed by a random
process even in cases where the crash was spontanius in redis.
for instance, crashes found by the corrupt-dump test.

It looks like this si_pid is sometimes left uninitialized, and a good
way to tell if the crash originated in redis or trigged by outside is to
look at si_code, real signal codes are always > 0, and ones generated by
kill are have si_code of 0 or below.
2021-03-24 08:33:24 +02:00
yoav-steinberg
895fb348f4 Avoid evaluating log arguments when log filtered by level. (#8685) 2021-03-24 08:22:12 +02:00
christian
d841598ea0 Merge branch 'rebrand' into 'keydbpro'
Rebrand

See merge request keydb-dev/KeyDB-Pro!14

Former-commit-id: 6840087819f26804302635dd0a75de523e133f8c
2021-03-23 20:01:05 +00:00
benschermel
efa9d4ef98 addressing comments from merge review
Former-commit-id: 955aa69ca16ca7230d5099ad16f6f825402b5dd5
2021-03-23 18:41:59 +00:00
cl1118
a3d72b0274 Update sentinel.c (#8686) 2021-03-23 13:51:53 +02:00
linyi-xq
6e9aabcd27 clusterState->mf_master_offset init offset change to -1 (#8651)
resolve cluster failover timeout when master repl_offset is 0
2021-03-22 20:00:33 -07:00
Wen Hui
6e2eb5692d add missing flags in sentinel instance info (#8682) 2021-03-22 20:13:30 +02:00
Huang Zhw
5c2f3ee8d2 Cleanup: sentinelGetInstanceTypeString is unused. (#8680)
sentinelGetInstanceTypeString is the same as sentinelRedisInstanceTypeStr,
and not referenced by any functions.
2021-03-22 16:13:24 +02:00
Yossi Gottlieb
bd7e2b6e34 Add support for reading encrypted keyfiles. (#8644) 2021-03-22 13:27:46 +02:00
Yossi Gottlieb
0cd485db5e Fix slowdown due to child reporting CoW. (#8645)
Reading CoW from /proc/<pid>/smaps can be slow with large processes on
some platforms.

This measures the time it takes to read CoW info and limits the duty
cycle of future updates to roughly 1/100.

As current_cow_size no longer represnets a current, fixed interval value
there is also a new current_cow_size_age field that provides information
about the age of the size value, in seconds.
2021-03-22 13:25:58 +02:00
Oran Agra
722fd729e6 fix race in diskless load cluster tests (#8674) 2021-03-22 10:51:13 +02:00
Oran Agra
10929ace19 Fix race in replication test (#8679)
Since redis 6.2, redis immediately tries to connect to the master, not
waiting for replication cron.

in the slow freebsd CI, this test failed and master_link_status was
already "up" when INFO was called.
2021-03-22 10:50:39 +02:00
Huang Zhw
5799e2f360 Change the order of start startLoadingFile call in redis-check-rdb. (#8676)
redis_check_rdb in some scenarios only stopLoading is called because
startLoadingFile is called too late.
2021-03-22 09:18:56 +02:00
benschermel
5c145039d4 update enterprise wording for keydb.config lk
Former-commit-id: feb2d31e6544763c94f4abaea69bc98bd1cb8b17
2021-03-21 05:19:28 +00:00
VivekSainiEQ
50884c6a20 Updated jemalloc to version 5.2.1
Former-commit-id: 7fefc7b245bc1795bd67564bcc0a8a38d1ec121c
2021-03-19 20:10:27 +00:00
VivekSainiEQ
f4dbaab531 Removed hasModuleGIL boolean and added fix from PR #292
Former-commit-id: 68d213f4c9c1c3161929a5e20ca4f2b27665c8fd
2021-03-19 20:10:24 +00:00
VivekSainiEQ
932fd2e79a added lock releasing w/ hasModuleGIL, changed module serverTL, and moved module_blocking_pipe to global scope to fix issue #276
Former-commit-id: 7d9a2ce827a2f8d48e4682b3cc95460cc82f9778
2021-03-19 20:08:28 +00:00
benschermel
2fd3097269 update rpm script for centos8
Former-commit-id: c6ef287452cbbe1cf25ec4cccd53fe84259dc8a2
2021-03-18 19:31:54 +00:00
benschermel
2e5ecd9003 minor fixes
Former-commit-id: ad7a27d41fb9e8e47966bbee72b28a4be66bbd8f
2021-03-18 01:16:57 +00:00
christianEQ
0436e62b7a fix old reference to c variable (monkey)
Former-commit-id: 0b9b6413c70d4ba71bbabcd0b22fb004d804958f
2021-03-17 20:22:01 +00:00
christianEQ
4944836478 removed unused stuff from monkey
Former-commit-id: be55daa6f7bcbf137b37269d1ee7a5fcacc14ff0
2021-03-17 20:17:52 +00:00
christianEQ
34d019f483 fixed runtime arg for monkey
Former-commit-id: b3e6e1f13b3d24c92d9f7e8441831232f47ff053
2021-03-17 19:50:28 +00:00
Meir Shpilraien (Spielrein)
af74b0b110 Fix script kill to work also on scripts that use pcall (#8661)
pcall function runs another LUA function in protected mode, this means
that any error will be caught by this function and will not stop the LUA
execution. The script kill mechanism uses error to stop the running script.
Scripts that uses pcall can catch the error raise by the script kill mechanism,
this will cause a script like this to be unkillable:

local f = function()
        while 1 do
                redis.call('ping')
        end
end
while 1 do
        pcall(f)
end

The fix is, when we want to kill the script, we set the hook function to be invoked 
after each line. This will promise that the execution will get another
error before it is able to enter the pcall function again.
2021-03-17 18:52:11 +02:00
christianEQ
ca97f6e454 working blpop test in monkey
Former-commit-id: 21af13c2a38741ad9e036fad42b23ea2454ac33c
2021-03-17 16:10:06 +00:00
christianEQ
a2d8079d49 track each command separately in monkey
Former-commit-id: e3accdaad985fd9f93490a5cc6704d9ecb909604
2021-03-17 16:03:51 +00:00
Theo Buehler
e1ba72817c Fixes for systems with 64-bit time (#8662)
Some operating systems (e.g., NetBSD and OpenBSD) have switched to
using a 64-bit integer for time_t on all platforms. This results in currently
harmless compiler warnings due to potential truncation.
These changes fix these minor portability concerns.

* Fix format string for systems with 64 bit time
* use llabs to avoid truncation with 64 bit time
2021-03-17 15:45:38 +02:00
Wen Hui
4c00cc23a3 fix wrong comment for data_age unit (#8665)
fix typo
2021-03-17 15:41:13 +02:00
Yossi Gottlieb
9942395bb9 Cleanup: remove dead code from anet. (#8660)
In the long term we may want to move away from anet completely and have
everything implemented natively in connection.c, instead of having an
extra layer.

For now, just get rid of unused code.
2021-03-17 12:52:24 +02:00
benschermel
2c6d5c991f fix rpm script for centos8
Former-commit-id: 6790d9b793b1995b2faae7dbfb5d09dce90a878c
2021-03-17 05:11:01 +00:00
benschermel
d1bfe49bc2 update all packaging to support enterprise dist
Former-commit-id: 1fd4f27cd271090fc66dba3b09a3800bf1c33b0e
2021-03-17 02:30:34 +00:00
christianEQ
6119273c5e unblocking test to monkey, works with 1 client
Former-commit-id: 9fbe8cf6a8aeb141d4a502532a456e4256f4daf8
2021-03-17 01:40:38 +00:00
christianEQ
a93234accc parameterized monkey options
Former-commit-id: eda1055689587c25dca3e889dd3a74d3f9c9378f
2021-03-16 23:19:29 +00:00
Huang Zhw
6e15162367 When tests exit normally, some processes may still be alive (#8647)
In certain scenario start_server may think it failed to start a redis server
although it started successfully. in these cases, it'll not terminate it, and
it'll remain running when the test is over.

In start_server if config doesn't have bind (the minimal.conf in introspection.tcl),
it will try to bind ipv4 and ipv6. One may success while other fails. It will
output "Could not create server TCP listening socket".
wait_server_started uses this message to check whether instance started
successfully. So it will consider that it failed even though redis started successfully.

Additionally, in some cases it wasn't clear to users why the server exited,
since the warning message printed to the log, could in some cases be harmless,
and in some cases fatal.

This PR adds makes a clear distinction between a warning log message and
a fatal one, and changes the test suite to look for the fatal message.
2021-03-16 17:25:30 +02:00
Saravjeet 'Aman' Singh
e39f505256 Update README.md (#3543)
prettify
2021-03-16 16:43:53 +02:00
Garen Chan
ad52d9b145 Fix incorrect presentation in README.md (#5697) 2021-03-16 16:43:03 +02:00
Ikko Ashimine
2f652fbbfc Fix typo in t_stream.c (#8592)
arguements -> arguments
2021-03-16 16:41:45 +02:00
Meir Shpilraien (Spielrein)
7da64eecaf Fix issue where error replies are not counted on stats (#8659)
lookupKeyReadOrReply and lookupKeyWriteOrReply might decide to reply to the user
with the given robj reply. This reply might be an error reply and if so addReply
function is used instead of addReplyErrorObject which will cause the error reply not
to be counted on stats. The fix checks the first char in the reply and if its '-' (error)
it uses addReplyErrorObject.
2021-03-16 14:49:59 +02:00
Wen Hui
5d732bf2d9 Sentinel: fix potential NULL ptr issue for sentinel instance connection (#8627) 2021-03-16 12:23:19 +02:00
Oran Agra
ebe6faf4d4 set module eviction context flag only in masters (#8631)
REDISMODULE_CTX_FLAGS_EVICT and REDISMODULE_CTX_FLAGS_MAXMEMORY
shouldn't be set when the module is run inside a replica that doesn't do eviction.

one may argue that the database is under eviction (the master does eviction and sends DELs to the replica).
but on the other hand, we don't really know the master's configuration.
all that matters is if the current instance does evictions or not.
2021-03-16 12:17:14 +02:00
Yossi Gottlieb
54063aa6a3 Server won't start on alpine/libmusl without IPv6. (#8655)
listenToPort attempts to gracefully handle and ignore certain errors but does not store errno prior to logging, which in turn calls several libc functions that may overwrite errno.

This has been discovered due to libmusl strftime() always returning with errno set to EINVAL, which resulted with docker-library/redis#273.
2021-03-16 11:20:03 +02:00
Madelyn Olson
139181e9eb Redact slowlog entries for config with sensitive data. (#8584)
Redact config set requirepass/masterauth/masteruser from slowlog in addition to showing ACL commands without sensitive values.
2021-03-15 22:00:29 -07:00
John Sully
44603c8227 Make async rehash behave with snapshots (thread safety issues)
Former-commit-id: 372adf39a80252b8035e3c948fcaf7d5ef6f928f
2021-03-16 02:38:41 +00:00
John Sully
61d548079c Remove snapshot consolidation because its not properly thread safe
Former-commit-id: dcb86d2b92e3ecdb9f914b6f5de9e184cdd23036
2021-03-16 02:37:49 +00:00
John Sully
15e1ee620f Fix TSAN errors in tests
Former-commit-id: 30207d2ab34f175b94f430f97581191343d23f1e
2021-03-16 02:29:24 +00:00
benschermel
e40fe53395 re-label keydb-pro-server to keydb-server
Former-commit-id: eb6f61ad372f0f4e573b9b731eac6c7f2ada0d9f
2021-03-16 01:57:26 +00:00
John Sully
dc658ba47b Support deletes in the monkey
Former-commit-id: 84101aaa1bd0c89fbaffc11a264788cd75458c48
2021-03-15 19:41:38 +00:00