Commit Graph

9432 Commits

Author SHA1 Message Date
Oran Agra 9bbf768d3c
change references to the github repo location (#7479) 2020-07-10 08:25:26 +03:00
zhaozhao.zz 1978f996d8
BITOP: propagate only when it really SET or DEL targetkey (#5783)
For example:
    BITOP not targetkey sourcekey

If targetkey and sourcekey doesn't exist, BITOP has no effect,
we do not propagate it, thus can save aof and replica flow.
2020-07-10 08:20:27 +03:00
antirez ad0a9df77a Update comment to clarify change in #7398. 2020-06-25 12:58:21 +02:00
Salvatore Sanfilippo 760021e677
Merge pull request #7398 from caiyuxinggg/work
cluster.c remove "if (nodeIsMaster(myself))" judgement before clusterSendFail in markNodeAsFailingIfNeeded, avoiding slave failover requires twice vote requests
2020-06-25 12:56:26 +02:00
Salvatore Sanfilippo b2c86acd0a
Merge pull request #7426 from dnielsen/patch-1
updated copyright year to 2020
2020-06-25 12:36:37 +02:00
antirez 959cdb358b Merge branch 'unstable' of github.com:/antirez/redis into unstable 2020-06-24 09:09:59 +02:00
antirez a5a3a7bbc6 LPOS: option FIRST renamed RANK. 2020-06-24 09:09:43 +02:00
Dave Nielsen 2d6d9f7552
updated copyright year
Changed "2015" to "2020"
2020-06-23 09:51:12 -07:00
Salvatore Sanfilippo 6bbbdd26f4
Merge pull request #7390 from oranagra/exec_fails_abort
EXEC always fails with EXECABORT and multi-state is cleared
2020-06-23 13:12:52 +02:00
Oran Agra 65a3307bc9 EXEC always fails with EXECABORT and multi-state is cleared
In order to support the use of multi-exec in pipeline, it is important that
MULTI and EXEC are never rejected and it is easy for the client to know if the
connection is still in multi state.

It was easy to make sure MULTI and DISCARD never fail (done by previous
commits) since these only change the client state and don't do any actual
change in the server, but EXEC is a different story.

Since in the past, it was possible for clients to handle some EXEC errors and
retry the EXEC, we now can't affort to return any error on EXEC other than
EXECABORT, which now carries with it the real reason for the abort too.

Other fixes in this commit:
- Some checks that where performed at the time of queuing need to be re-
  validated when EXEC runs, for instance if the transaction contains writes
  commands, it needs to be aborted. there was one check that was already done
  in execCommand (-READONLY), but other checks where missing: -OOM, -MISCONF,
  -NOREPLICAS, -MASTERDOWN
- When a command is rejected by processCommand it was rejected with addReply,
  which was not recognized as an error in case the bad command came from the
  master. this will enable to count or MONITOR these errors in the future.
- make it easier for tests to create additional (non deferred) clients.
- add tests for the fixes of this commit.
2020-06-23 12:01:33 +03:00
antirez 21f62c3346 Include cluster.h for getClusterConnectionsCount(). 2020-06-22 11:44:11 +02:00
antirez 746297314f Fix BITFIELD i64 type handling, see #7417. 2020-06-22 11:41:19 +02:00
antirez 59fd178014 Clarify maxclients and cluster in conf. Remove myself too. 2020-06-22 11:21:21 +02:00
Salvatore Sanfilippo 42fd522c63
Merge pull request #7421 from hwware/sentinel_leak_fix
fix memory leak in sentinel connection sharing
2020-06-22 11:06:50 +02:00
hwware 1bfa2d27a6 fix memory leak in sentinel connection sharing 2020-06-21 23:04:28 -04:00
Salvatore Sanfilippo 5e46e0800b
Merge pull request #7402 from chenhui0212/unstable
Fix comments in listpack.c
2020-06-18 11:29:06 +02:00
chenhui0212 f800b52172 Fix comments in function raxLowWalk of listpack.c 2020-06-18 17:28:26 +08:00
Salvatore Sanfilippo ab4cc1e11b
Merge pull request #7411 from tporadowski/inconsitent-sentinel-nosave
Inconsistent RDB saving when in Sentinel mode
2020-06-18 11:26:53 +02:00
Tomasz Poradowski 4ee011adb5 ensure SHUTDOWN_NOSAVE in Sentinel mode
- enforcing of SHUTDOWN_NOSAVE flag in one place to make it consitent
  when running in Sentinel mode
2020-06-17 22:22:49 +02:00
chenhui0212 71fafd761a fix comments in listpack.c 2020-06-16 17:50:38 +08:00
antirez 4b8d8826af Use cluster connections too, to limit maxclients.
See #7401.
2020-06-16 11:45:11 +02:00
antirez 62fc7f4f24 Merge branch 'unstable' of github.com:/antirez/redis into unstable 2020-06-16 11:11:01 +02:00
antirez 784479939d Tracking: fix enableBcastTrackingForPrefix() invalid sdslen() call.
Related to #7387.
2020-06-16 11:09:48 +02:00
Salvatore Sanfilippo 6ce2ed870d
Merge pull request #7396 from MeirShpilraien/fix_dict_scan_module_api
Fix RM_ScanKey module api not to return int encoded strings
2020-06-15 10:43:33 +02:00
root c92464db69 cluster.c remove if of clusterSendFail in markNodeAsFailingIfNeeded 2020-06-15 10:18:14 +08:00
meir@redislabs.com a89bf734a9 Fix RM_ScanKey module api not to return int encoded strings
The scan key module API provides the scan callback with the current
field name and value (if it exists). Those arguments are RedisModuleString*
which means it supposes to point to robj which is encoded as a string.
Using createStringObjectFromLongLong function might return robj that
points to an integer and so break a module that tries for example to
use RedisModule_StringPtrLen on the given field/value.

The PR introduces a fix that uses the createObject function and sdsfromlonglong function.
Using those function promise that the field and value pass to the to the
scan callback will be Strings.

The PR also changes the Scan test module to use RedisModule_StringPtrLen
to catch the issue. without this, the issue is hidden because
RedisModule_ReplyWithString knows to handle integer encoding of the
given robj (RedisModuleString).

The PR also introduces a new test to verify the issue is solved.
2020-06-14 11:20:15 +03:00
antirez 1055398849 Fix LCS object type checking. Related to #7379. 2020-06-12 12:43:40 +02:00
Salvatore Sanfilippo a66298e6f1
Merge pull request #7375 from hwware/lcs_crash_fix
Fix Server Crash in LCS Command
2020-06-12 12:31:15 +02:00
antirez ca58198a76 help.h updated. 2020-06-12 12:16:19 +02:00
hwware 7008a0ba66 fix memory leak 2020-06-11 09:56:52 -04:00
antirez 0091125cae LPOS: tests + crash fix. 2020-06-11 12:39:06 +02:00
antirez 89ca2afd6b LPOS: update to latest proposal.
See https://gist.github.com/antirez/3591c5096bc79cad8b5a992e08304f48
2020-06-11 11:18:20 +02:00
antirez e63a5ba122 LPOS: implement the final design. 2020-06-10 12:49:15 +02:00
Paul Spooren a7936ef96d 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 2ebcd63d6a Adapt EVAL+busy script test to new behavior. 2020-06-09 12:19:14 +02:00
antirez cdad0e6485 Temporary fix for #7353 issue about EVAL during -BUSY. 2020-06-09 11:52:33 +02:00
hwware 2a05fa0d48 fix server crash in STRALGO command 2020-06-08 23:36:01 -04:00
Salvatore Sanfilippo 48b2915c18
Merge pull request #7363 from xhebox/unstable
return the correct proto version
2020-06-08 12:54:15 +02:00
Salvatore Sanfilippo 254f06c131
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 8183a4ca7f
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 265a7e7ec7
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 cfffda83fb
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 74a203a050
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 12504105c4 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 2bb297b102 Don't queue commands in an already aborted MULTI state 2020-06-08 09:43:10 +03:00
Oran Agra 2fa077b0e9 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 7eba5c308a 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 44b76a75d2 Merge branch 'unstable' of github.com:/antirez/redis into unstable 2020-06-06 11:44:05 +02:00
antirez 61074b43a6 Revert "Implements sendfile for redis."
This reverts commit 9cf500a3f6.
2020-06-06 11:42:45 +02:00
antirez d1e23e04aa Revert "avoid using sendfile if tls-replication is enabled"
This reverts commit b9abecfc4c.
2020-06-06 11:42:41 +02:00