280 Commits

Author SHA1 Message Date
antirez
d266105a45 RESP3: add shared.nullarray for better RESP2 compat. 2019-01-09 17:00:29 +01:00
antirez
7872d57d27 RESP3: most null replies converted. 2019-01-09 17:00:29 +01:00
antirez
8413c6f107 RESP3: addReplyNull() added. 2019-01-09 17:00:29 +01:00
antirez
a039a1bc3c RESP3: remove other pointless shared object. 2019-01-09 17:00:29 +01:00
antirez
ee2564e90e RESP3: remove certain constants to spot places to fix. 2019-01-09 17:00:29 +01:00
antirez
33374b02bf RESP3: Use new deferred len API in server.c. 2019-01-09 17:00:29 +01:00
antirez
b166aff1bf freeMemoryIfNeeded() small refactoring.
Related to issue #5686 and PR #5689.
2018-12-12 11:37:15 +01:00
Salvatore Sanfilippo
d21f7e44ea Merge pull request #5633 from oranagra/frag_bytes_signed
fix #5580, display fragmentation and rss overhead bytes as signed
2018-12-07 17:09:10 +01:00
antirez
50c8580a33 Remove no longer relevant comment in processCommand(). 2018-12-07 17:06:55 +01:00
Oran Agra
1dbdef57cd fix #5580, display fragmentation and rss overhead bytes as signed
these metrics become negative when RSS is smaller than the used_memory.
This can easily happen when the program allocated a lot of memory and haven't
written to it yet, in which case the kernel doesn't allocate any pages to the process
2018-12-02 15:29:20 +02:00
Salvatore Sanfilippo
307ef33b65 Merge pull request #5597 from lamby/clarify-socket-creation-error-message
Clarify the "Creating Server TCP listening socket" error message
2018-11-28 17:06:51 +01:00
Chris Lamb
99c2604541 Don't treat unsupported protocols as fatal errors
If we encounter an unsupported protocol in the "bind" list, don't
ipso-facto consider it a fatal error. We continue to abort startup if
there are no listening sockets at all.

This ensures that the lack of IPv6 support does not prevent Redis from
starting on Debian where we try to bind to the ::1 interface by default
(via "bind 127.0.0.1 ::1"). A machine with IPv6 disabled (such as some
container systems) would simply fail to start Redis after the initiall
call to apt(8).

This is similar to the case for where "bind" is not specified:

  https://github.com/antirez/redis/issues/3894

... and was based on the corresponding PR:

  https://github.com/antirez/redis/pull/4108

... but also adds EADDRNOTAVAIL to the list of errors to catch which I
believe is missing from there.

This issue was raised in Debian as both <https://bugs.debian.org/900284>
& <https://bugs.debian.org/914354>.
2018-11-23 18:01:12 +01:00
Chris Lamb
be459c7e26 Clarify the "Creating Server TCP listening socket" error.
This really helps spot it in the logs, otherwise it does not look like a
warning/error. For example:

  Creating Server TCP listening socket ::1:6379: bind: Cannot assign requested address

... is not nearly as clear as:

  Could not create server TCP listening listening socket ::1:6379: bind: Cannot assign requested address
2018-11-23 17:57:01 +01:00
valentino
dcc2c9babe fix short period of server.hz being uninitialized
server.hz was uninitialized between initServerConfig and initServer.
this can lead to someone (e.g. queued modules) doing createObject,
and accessing an uninitialized variable, that can potentially be 0,
and lead to a crash.
2018-11-05 12:01:26 +02:00
David Carlier
869612a867 Fix non Linux build.
timezone global is a linux-ism whereas it is a function under BSD.
Here a helper to get the timezone value in a more portable manner.
2018-10-26 14:02:09 +00:00
zhaozhao.zz
c0d1b24d27 MULTI: OOM err if cannot free enough memory in MULTI/EXEC context 2018-10-17 16:40:45 +08:00
Salvatore Sanfilippo
707138d5c1 Merge pull request #5333 from soloestoy/stream-commands-flag
Scripting & Streams: some commands need right flags
2018-10-17 07:50:32 +02:00
antirez
2093b42879 Streams: XSTREAM SETID -> XSETID.
Keep vanilla stream commands at toplevel, see #5426.
2018-10-16 13:17:14 +02:00
Salvatore Sanfilippo
060cd5c941 Merge pull request #5426 from soloestoy/feature-xstream
Bugfix data inconsistency after aof rewrite, and add XSTREAM command.
2018-10-16 13:10:36 +02:00
antirez
599e872fba Fix propagation of consumer groups last ID.
Issue #5433.
2018-10-10 12:51:02 +02:00
zhaozhao.zz
0a968cc348 Streams: add a new command XTREAM
XSTREAM CREATE <key> <id or *> -- Create a new empty stream.
XSTREAM SETID <key> <id or $>  -- Set the current stream ID.
2018-10-09 13:11:04 +08:00
antirez
ec656a2071 Fix printf type mismatch in genRedisInfoString(). 2018-10-02 16:26:30 +02:00
Salvatore Sanfilippo
96b51145a3 Merge pull request #5242 from oranagra/script_mem
script cache memory in INFO and MEMORY includes both script code and overheads
2018-10-02 16:03:05 +02:00
Salvatore Sanfilippo
bcb7c04e40 Merge pull request #5398 from bmerry/fix-zrealloc-accounting
Fix incorrect memory usage accounting in zrealloc
2018-10-01 13:28:53 +02:00
Bruce Merry
a2b68c02de Fix incorrect memory usage accounting in zrealloc
When HAVE_MALLOC_SIZE is false, each call to zrealloc causes used_memory
to increase by PREFIX_SIZE more than it should, due to mis-matched
accounting between the original zmalloc (which includes PREFIX size in
its increment) and zrealloc (which misses it from its decrement).

I've also supplied a command-line test to easily demonstrate the
problem. It's not wired into the test framework, because I don't know
TCL so I'm not sure how to automate it.
2018-09-30 11:49:03 +02:00
Oran Agra
e531447d6c fix #5024 - commandstats for multi-exec were logged as EXEC.
this was broken a while back by ba9154d7e7bf959b002533384319a1e90545447b
the purpose of which was to fix commandstats for GEOADD
2018-09-30 12:43:11 +03:00
antirez
f34da2c072 Module cluster flags: add hooks for NO_REDIRECTION flag. 2018-09-19 11:31:22 +02:00
antirez
8aa0a33dbb Module cluster flags: initial vars / defines added. 2018-09-19 11:20:52 +02:00
antirez
0a77ee90ee LOLWUT: wrap it into a proper command. 2018-09-12 11:34:10 +02:00
antirez
2c83618fae Slave removal: server.c logs fixed. 2018-09-11 15:32:28 +02:00
antirez
90d12c7929 Slave removal: SLAVEOF -> REPLICAOF. SLAVEOF is now an alias. 2018-09-11 15:32:28 +02:00
Salvatore Sanfilippo
40191136ba Merge pull request #5322 from youjiali1995/fix-sentinel-randomize
sentinel: fix randomized sentinelTimer.
2018-09-07 12:10:35 +02:00
zhaozhao.zz
0b099fcd3c Scripting & Streams: some commands need right flags
xadd with id * generates random stream id

xadd & xtrim with approximate maxlen count may
trim stream randomly

xinfo may get random radix-tree-keys/nodes

xpending may get random idletime

xclaim: master and slave may have different
idletime in stream
2018-09-06 21:12:46 +08:00
antirez
23a5668d8f Use commands (effects) replication by default in scripts.
See issue #5250 and issue #5292 for more info.
2018-09-05 19:33:56 +02:00
antirez
1ff2179d2e Don't perform eviction when re-entering the event loop.
Related to #5250.
2018-09-05 13:10:07 +02:00
youjiali1995
c64f8bd56a sentinel: fix randomized sentinelTimer. 2018-09-05 10:32:18 +08:00
antirez
23338b9d59 While the slave is busy, just accumulate master input.
Processing command from the master while the slave is in busy state is
not correct, however we cannot, also, just reply -BUSY to the
replication stream commands from the master. The correct solution is to
stop processing data from the master, but just accumulate the stream
into the buffers and resume the processing later.

Related to #5297.
2018-08-31 16:45:02 +02:00
antirez
4add364a4e Allow scripts to timeout on slaves as well.
See reasoning in #5297.
2018-08-31 16:45:01 +02:00
zhaozhao.zz
a286e88109 Supplement to PR #4835, just take info/memory/command as random commands 2018-08-29 18:23:05 +08:00
Salvatore Sanfilippo
572075e879 Merge pull request #4835 from soloestoy/command-script-flag
some commands' flags should be set correctly, issue #4834
2018-08-29 12:13:50 +02:00
zhaozhao.zz
a175581eb6 some commands' flags should be set correctly, issue #4834 2018-08-29 18:07:01 +08:00
antirez
b0143d81f3 Introduce repl_slave_ignore_maxmemory flag internally.
Note: this breaks backward compatibility with Redis 4, since now slaves
by default are exact copies of masters and do not try to evict keys
independently.
2018-08-27 12:20:27 +02:00
antirez
f3e6552ce0 Better variable meaning in processCommand(). 2018-08-27 12:17:34 +02:00
zhaozhao.zz
8613125969 block: rewrite BRPOPLPUSH as RPOPLPUSH to propagate 2018-08-14 20:58:58 +08:00
Oran Agra
20718948b7 script cache memory in INFO and MEMORY includes both script code and overheads 2018-08-13 17:36:54 +03:00
shenlongxing
82d4d8020f Fix stream command paras 2018-08-03 19:01:15 +08:00
antirez
2e67ea193d Refactoring: replace low-level checks with writeCommandsDeniedByDiskError(). 2018-07-31 13:16:43 +02:00
antirez
c07f1e0966 Fix writeCommandsDeniedByDiskError() inverted return value. 2018-07-31 13:14:24 +02:00
antirez
e8bf6c0a94 Better top comment for writeCommandsDeniedByDiskError(). 2018-07-31 13:10:37 +02:00
antirez
ca20e19104 Introduce writeCommandsDeniedByDiskError(). 2018-07-31 13:09:38 +02:00