7532 Commits

Author SHA1 Message Date
yongman
1f43bf29a3 Fix choose a random master node for slot assignment 2018-12-11 17:58:19 +01:00
Weiliang Li
69f0c6788f fix comment typo in util.c
fix comment typo in util.c
2018-12-11 17:58:19 +01:00
Chris Lamb
bc53a3abb9 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-12-11 17:58:19 +01:00
Chris Lamb
fefe546068 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-12-11 17:58:19 +01:00
David Carlier
a8862972b6 OpenBSD support.
Special treatment here as backtrace support is optional,
cannot be found via pkg-config and similar neither.
2018-12-11 17:58:19 +01:00
David Carlier
5e86daf947 Backtrace/register dump on BSD.
FreeBSD/DragonFlyBSD does have backtrace only it does not
belong to libc.
2018-12-11 17:58:19 +01:00
Guy Benoish
7c8cf5acdd Don't call sdscmp() with shared.maxstring or shared.minstring 2018-12-11 17:58:19 +01:00
Qu Chen
39e9eda377 Add unit test for stream XCLAIM command. 2018-12-11 17:57:54 +01:00
antirez
62485232e8 Abort instead of crashing when loading bad stream master key.
See #5612.
2018-12-11 17:57:50 +01:00
Madelyn Olson
a54873092e Fixed a serverPanic when sending an invalid command to a monitor client 2018-12-04 18:10:22 +01:00
antirez
1637522f00 Redis 5.0.2. 5.0.2 2018-11-22 11:26:38 +01:00
David Carlier
e8b4291a0f DragonFlyBSD little build fix 2018-11-22 11:21:47 +01:00
yongman
8fcfd374d7 skip slave nodes when sending cluster setslot command 2018-11-22 11:21:47 +01:00
yongman
d7089ddddc Fix pointer access and memory leak in redis-cli. 2018-11-22 11:21:47 +01:00
antirez
17b4cd83f4 Test: regression test for #5570. 2018-11-20 08:32:50 +01:00
antirez
45123169bc Stream: fix XREADGROUP history reading of deleted messages.
This commit fixes #5570. It is a similar bug to one fixed a few weeks
ago and is due to the range API to be called with NULL as "end ID"
parameter instead of repeating again the start ID, to be sure that we
selectively issue the entry with a given ID, or we get zero returned
(and we know we should emit a NULL reply).
2018-11-20 08:32:47 +01:00
David Carlier
5ad588f0f4 only FreeBSD change/little warning addressing 2018-11-20 08:32:41 +01:00
David Carlier
11801e1a78 tweak form feedback 2018-11-20 08:32:31 +01:00
David Carlier
c1f13575d7 allow flavors 2018-11-20 08:32:31 +01:00
David Carlier
275a2d49cc Fix clang build.
Some math functions require c11 standard.
2018-11-20 08:32:31 +01:00
antirez
44ad514185 Test: regression test for #5577. 2018-11-20 08:32:31 +01:00
antirez
c7951f4304 Streams: fix XREADGROUP history reading when CG last_id is low.
This fixes the issue reported in #5570.
This was fixed the hard way, that is, propagating more information to
the lower level API about this being a request to read just the history,
so that the code is simpler and less likely to regress.
2018-11-20 08:32:31 +01:00
antirez
a69bc5befe t_stream.c comment resized to 80 cols. 2018-11-20 08:32:31 +01:00
antirez
5314099d04 Redis 5 changelog: don't expect Lua replies to be ordered.
Related to #5538.
2018-11-07 17:00:13 +01:00
antirez
c595050012 Redis 5.0.1. 5.0.1 2018-11-07 13:23:06 +01:00
antirez
c801283fd2 Fix cluster-replica-no-failover option name.
Thanks to @NicolasLM, see issue #5537.
2018-11-07 13:08:05 +01:00
antirez
4c4f50e1c1 MEMORY command: make strcasecmp() conditional like the following. 2018-11-07 13:08:02 +01:00
Itamar Haber
a7b46e0e64 Uppercases subcommands in MEMORY HELP 2018-11-07 13:05:49 +01:00
Itamar Haber
80e129d93e Standardizes MEMORY HELP subcommand 2018-11-07 13:05:49 +01:00
valentino
88805cbb3e 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-07 13:05:49 +01:00
Itamar Haber
6b402733e1 Adds HELP to LATENCY
Signed-off-by: Itamar Haber <itamar@redislabs.com>
2018-11-07 13:05:49 +01:00
yongman
1c637de98c fix malloc in clusterManagerComputeReshardTable 2018-11-07 13:05:49 +01:00
artix
90b52fde57 Cluster Manager: removed unused var. 2018-11-07 13:05:49 +01:00
artix
89cbb5df06 Cluster Manager: further improvements to "fix":
- clusterManagerFixOpenSlot: ensure that the
  slot is unassigned before ADDSLOTS
- clusterManagerFixSlotsCoverage: after cold
  migration, the slot configuration
  is now updated on all the nodes.
2018-11-07 13:05:49 +01:00
artix
175515c944 Cluster Manager: fixed string parsing issue in clusterManagerGetConfigSignature 2018-11-07 13:05:29 +01:00
artix
3997dd6eaa Cluster Manager: better fix subcommand. 2018-11-07 13:05:29 +01:00
artix
bd80291c36 Cluster Manager: fixed typos in comments. 2018-11-07 13:05:29 +01:00
artix
4369cbce08 Cluster Manager: fixed 'DELSLOT' subcommand typo. 2018-11-07 13:05:29 +01:00
antirez
1ed821e28d Fix XCLAIM missing entry bug.
This bug had a double effect:

1. Sometimes entries may not be emitted, producing broken protocol where
the array length was greater than the emitted entires, blocking the
client waiting for more data.

2. Some other time the right entry was claimed, but a wrong entry was
returned to the client.

This fix should correct both the instances.
2018-11-05 17:12:37 +01:00
michael-grunder
b49bcd01d0 Use typedef'd mstime_t instead of time_t
This fixes an overflow on 32-bit systems.
2018-11-05 17:12:37 +01:00
antirez
09d1849ed5 Improve streamReplyWithRange() top comment. 2018-11-05 17:12:37 +01:00
antirez
bdf6306f29 Add support for Sentinel authentication.
So far it was not possible to setup Sentinel with authentication
enabled. This commit introduces this feature: every Sentinel will try to
authenticate with other sentinels using the same password it is
configured to accept clients with.

So for instance if a Sentinel has a "requirepass" configuration
statemnet set to "foo", it will use the "foo" password to authenticate
with every other Sentinel it connects to. So basically to add the
"requirepass" to all the Sentinels configurations is enough in order to
make sure that:

1) Clients will require the password to access the Sentinels instances.
2) Each Sentinel will use the same password to connect and authenticate
   with every other Sentinel in the group.

Related to #3279 and #3329.
2018-11-05 17:12:37 +01:00
antirez
50222af5f4 Disable protected mode in Sentinel mode.
Sentinel must be exposed, so protected mode is just an issue for users
in case Redis was started in Sentinel mode.

Related to #3279 and #3329.
2018-11-05 17:12:37 +01:00
antirez
643ee6e38c When replica kills a pending RDB save during SYNC, log it.
This logs what happens in the context of the fix in PR #5367.
2018-11-05 17:12:37 +01:00
Andrey Bugaevskiy
8b609c9986 Move child termination to readSyncBulkPayload 2018-11-05 17:12:37 +01:00
Andrey Bugaevskiy
2710260594 Prevent RDB autosave from overwriting full resync results
During the full database resync we may still have unsaved changes
on the receiving side. This causes a race condition between
synced data rename/load and the rename of rdbSave tempfile.
2018-11-05 17:12:37 +01:00
antirez
a677923d7c asyncCloseClientOnOutputBufferLimitReached(): don't free fake clients.
Fake clients are used in special situations and are not linked to the
normal clients list, freeing them will always result in Redis crashing
in one way or the other.

It's not common to send replies to fake clients, but we have one usage
in the modules API. When a client is blocked, we associate to the
blocked client object (that is safe to manipulate in a thread), a fake
client that accumulates replies. So because of this bug there was
the problem described in issue #5443.

The fix was verified to work with the provided example module. To write
a regression is very hard and unlikely to be triggered in the future.
2018-11-05 17:12:37 +01:00
David Carlier
427e440a58 needs it for the global 2018-11-05 17:12:37 +01:00
David Carlier
28f9ca4e1d 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-11-05 17:12:37 +01:00
zhaozhao.zz
4bf9efe20f MULTI: OOM err if cannot free enough memory in MULTI/EXEC context 2018-11-05 17:12:37 +01:00