- 06 Jul, 2021 2 commits
-
-
zhaozhao.zz authored
touch keys only if the key is in one of the dbs, in case rewind the list when the key doesn't exist.
-
Omer Shadmi authored
Currently a replica is able to recover from a short read (when diskless loading is enabled) and avoid crashing/exiting, replying to the master and then the rdb could be sent again by the master for another load attempt by the replica. There were a few scenarios that were not behaving similarly, such as when there is no end-of-file marker, or when module aux data failed to load, which should be allowed to occur due to a short read.
-
- 05 Jul, 2021 7 commits
-
-
Oran Agra authored
-
uriyage authored
-
Binbin authored
due to a copy-paste bug, it used to reply with null response rather than empty array. this commit includes new tests that are looking at the RESP response directly in order to be able to tell the difference between them. Co-authored-by:
Oran Agra <oran@redislabs.com>
-
Oran Agra authored
This reduces system calls on linux when a new connection is made / accepted. Changes: * Add the SOCK_CLOEXEC option to the accept4() call This ensure that a fork/exec call does not leak a file descriptor. * Move anetCloexec and connNonBlock info anetGenericAccept * Moving connNonBlock from accept handlers to anetGenericAccept Moving connNonBlock from createClient, is safe because createClient is used in the following ways: 1. without a connection (fake client) 2. on an accepted connection (see above) 3. creating the master client by using connConnect (see below) The third case, can either use anetTcpNonBlockConnect, or connTLSConnect which is by default non-blocking. Co-authored-by:
Rajiv Kurian <geetasen@gmail.com> Co-authored-by:
Oran Agra <oran@redislabs.com> Co-authored-by:
Yoav Steinberg <yoav@redislabs.com>
-
Oran Agra authored
when tracking the peak, don't reset the peak to 0, reset it to the maximum of the current used, and the planned to be used by the current arg. when shrining, split the two separate conditions. the idle time shrinking will remove all free space. but the peak based shrinking will keep room for the current arg. when we resize due to a peak (rahter than idle time), don't trim all unused space, let the qbuf keep a size that's sufficient for the currently process bulklen, and the current peak. Co-authored-by:
sundb <sundbcn@gmail.com> Co-authored-by:
yoav-steinberg <yoav@monfort.co.il>
-
zhaozhao.zz authored
1. querybuf_peak has not been updated correctly in readQueryFromClient. 2. qbuf shrinking uses sdsalloc instead of sdsAllocSize see more details in issue #4983
-
Oran Agra authored
minor cleanups.
-
- 04 Jul, 2021 2 commits
-
-
Oran Agra authored
This makes it possible to distinguish between null response and an empty array (currently the tests infra translates both to an empty string/list)
-
Oran Agra authored
fixes test issue introduced in #9167 1. invalid reads due to accessing non-retained string (passed as unblock context). 2. leaking module blocked client context, see #6922 for info.
-
- 03 Jul, 2021 1 commit
-
-
Madelyn Olson authored
Update incrDecrCommand to use addReplyLongLong
-
- 01 Jul, 2021 3 commits
-
-
Yossi Gottlieb authored
Modules that use background threads with thread safe contexts are likely to use RM_BlockClient() without a timeout function, because they do not set up a timeout. Before this commit, `CLIENT UNBLOCK` would result with a crash as the `NULL` timeout callback is called. Beyond just crashing, this is also logically wrong as it may throw the module into an unexpected client state. This commits makes `CLIENT UNBLOCK` on such clients behave the same as any other client that is not in a blocked state and therefore cannot be unblocked.
-
Oran Agra authored
For the sdscatfmt function in sds.c, when the parameter fmt ended up with '%', the behavior is undefined. This commit fix this bug. Co-authored-by:
stafuc <stafuc@gmail.com>
-
Wang Yuan authored
Before this commit, redis-server starts in sentinel mode if the first startup argument has the string redis-sentinel, so redis also starts in sentinel mode if the directory it was started from contains the string redis-sentinel. Now we check the executable name instead of directory. Some examples: 1. Execute ./redis-sentinel/redis/src/redis-sentinel, starts in sentinel mode. 2. Execute ./redis-sentinel/redis/src/redis-server, starts in server mode, but before, redis will start in sentinel mode. 3. Execute ./redis-sentinel/redis/src/redis-server --sentinel, of course, like before, starts in sentinel mode.
-
- 30 Jun, 2021 8 commits
-
-
ZhaolongLi authored
This seems to be an unimportant bug that was accidentally generated. If the user does not specify limit in streamParseAddOrTrimArgsOrReply, the initial value of args->limit is 100 * server.stream_node_max_entries, which may lead to out of bounds, and then the default function of limit in xadd becomes invalid (this failure occurs in streamTrim). Additionally, provide sane default for args->limit in case stream_node_max_entries is set to 0. Co-authored-by:
lizhaolong.lzl <lizhaolong.lzl@B-54MPMD6R-0221.local> Co-authored-by:
Oran Agra <oran@redislabs.com> Co-authored-by:
guybe7 <guy.benoish@redislabs.com>
-
Mikhail Fesenko authored
A change in redis 6.2 caused redis-cli --rdb that's directed to stdout to fail because fsync fails. This commit avoids doing ftruncate (fails with a warning) and fsync (fails with an error) when the output file is `-`, and adds the missing documentation that `-` means stdout. Co-authored-by:
Oran Agra <oran@redislabs.com> Co-authored-by:
Wang Yuan <wangyuancode@163.com>
-
Rob Snyder authored
Adds call to intrev16ifbe to ensure ZIPLIST_LENGTH is compared correctly
-
Huang Zhw authored
If user executes redis-cli --help, the content should be output to stdout and exits with 0.
-
Binbin authored
* Add keyname tags to avoid CROSSSLOT errors in external server CI * Use new wait_for_blocked_clients_count in pause.tcl
-
luvine authored
1. Add one key-value pair to myhash, which the length of key and value both less than hash-max-ziplist-value, for example: >hset myhash key value 2. Then execute the following command >hsetnx myhash key value1 (the length greater than hash-max-ziplist-value) 3. This will add nothing, but the code type of "myhash" changed from ziplist to dict even there are only one key-value pair in "myhash", and both of them less than hash-max-ziplist-value.
-
Binbin authored
*** [err]: PSYNC2: total sum of full synchronizations is exactly 4 intests/integration/psync2.tcl Expected 5 == 4 (context: type eval line 8 cmd {assert {$sum == 4}} proc::test) Sometime the test got an unexpected full sync since a replica switch to master, before the new master change propagated the new replid to all replicas, a replica attempted to sync with it using a wrong replid and triggered a full resync. Consider this scenario: 1 slaveof 4 full resync 0 slaveof 4 full resync 2 slaveof 0 full resync 3 slaveof 1 full resync 1 slaveof no one, replid changed 3 reconnect 1, did a partial resyn and got the new replid Before 2 inherits the new replid. 3 slaveof 2 3 try to do a partial resyn with 2. But their replication ids are inconsistent, so a full resync happens. :) A special thank you for oran and helping me in this test case. Co-authored-by:
Oran Agra <oran@redislabs.com>
-
ZhaolongLi authored
In the original version, the operation of traversing the stack only seems to reconstruct the key that does not contain the current node. But in fact We have got the matched length and splitpos in the key in the raxlowwalk, so I think we can simplify the logic of this part. Co-authored-by:
lizhaolong.lzl <lizhaolong.lzl@B-54MPMD6R-0221.local>
-
- 29 Jun, 2021 5 commits
-
-
Yossi Gottlieb authored
-
Leibale Eidelman authored
mistakenly it used to return an empty array rather than 0. Co-authored-by:
Oran Agra <oran@redislabs.com>
-
Tsonglew authored
Co-authored-by:
yoav-steinberg <yoav@monfort.co.il>
-
guybe7 authored
Affects MEMORY USAGE
-
Binbin authored
Return a bad score when used with negative count (or count of 1), and non-ziplist encoded zset. Also add test to validate the return value and cover the issue.
-
- 28 Jun, 2021 1 commit
-
-
Wang Yuan authored
in the past, the reply list was a list of sds objects, so this didn't have any overhead, but now addReplySds just copies the data from the sds and frees it, so there's no need to make a copy of the buffer before copying again. this reduces an excessive allocation and free and a memcpy.
-
- 27 Jun, 2021 1 commit
-
-
Yossi Gottlieb authored
-
- 26 Jun, 2021 1 commit
-
-
Jerry Chan 29 authored
-
- 24 Jun, 2021 5 commits
-
-
Yossi Gottlieb authored
In the past, the first bind address that was explicitly specified was also used to bind outgoing connections. This could result with some problems. For example: on some systems using `bind 127.0.0.1` would result with outgoing connections also binding to `127.0.0.1` and failing to connect to remote addresses. With the recent change to the way `bind` is handled, this presented other issues: * The default first bind address is '*' which is not a valid address. * We make no distinction between user-supplied config that is identical to the default, and the default config. This commit addresses both these issues by introducing an explicit configuration parameter to control the bind address on outgoing connections.
-
Huang Zhw authored
some leftovers from print are visible when the new line is printed.
-
ZhaolongLi authored
The call to raxNext didn't really progress in the rax, since we were already on the last item. instead, all it does is check that it is indeed a valid item, so the new code clearer.
-
Oran Agra authored
The freebsd and macos jobs were still broken. also add a few more skip jobs options.
-
Oran Agra authored
-
- 23 Jun, 2021 2 commits
-
-
Oran Agra authored
-
Oran Agra authored
The daily CI was broken by #9119 seems that for cron scheduled tasks, these ifs aren't evaluated to false. But also it turns out that workflow_dispatch is only able to run CI on branches in the main repo (not on PRs). this is an attempt to overcome that by being able to checkout from any repo we want.
-
- 22 Jun, 2021 2 commits
-
-
Oran Agra authored
Hopefully now we'll be able to manually trigger extensive tests to PR branches without modifying them.
-
Oran Agra authored
- Introduce a new sdssubstr api as a building block for sdsrange. The API of sdsrange is many times hard to work with and also has corner case that cause bugs. sdsrange is easy to work with and also simplifies the implementation of sdsrange. - Revert the fix to RM_StringTruncate and just use sdssubstr instead of sdsrange. - Solve valgrind warnings from the new tests introduced by the previous PR.
-