Commit Graph

2425 Commits

Author SHA1 Message Date
51864fcdd7 Diskless replication: parent-child pipe and a few TODOs. 2014-10-29 14:33:49 +01:00
1b4cadb664 Diskless replication: RDB -> slaves transfer draft implementation. 2014-10-29 14:33:49 +01:00
38dee9dc51 rio.c: draft implementation of fdset target implemented. 2014-10-29 14:33:49 +01:00
5d295fea12 rio.c refactoring before adding a new target. 2014-10-29 14:33:49 +01:00
aef4c60c78 Add some comments in syncCommand() to clarify RDB target. 2014-10-29 14:33:49 +01:00
81abd1e178 Define different types of RDB childs.
We need to remember what is the saving strategy of the current RDB child
process, since the configuration may be modified at runtime via CONFIG
SET and still we'll need to understand, when the child exists, what to
do and for what goal the process was initiated: to create an RDB file
on disk or to write stuff directly to slave's sockets.
2014-10-29 14:33:49 +01:00
1e633f21c5 RDB file creation refactored to target non-disk target. 2014-10-29 14:33:49 +01:00
ff8a3baaf7 Replication: better way to send a preamble before RDB payload.
During the replication full resynchronization process, the RDB file is
transfered from the master to the slave. However there is a short
preamble to send, that is currently just the bulk payload length of the
file in the usual Redis form $..length..<CR><LF>.

This preamble used to be sent with a direct write call, assuming that
there was alway room in the socket output buffer to hold the few bytes
needed, however this does not scale in case we'll need to send more
stuff, and is not very robust code in general.

This commit introduces a more general mechanism to send a preamble up to
2GB in size (the max length of an sds string) in a non blocking way.
2014-10-29 14:33:30 +01:00
09fc0fbbe4 Fix typo
Closes #2029
2014-10-06 10:02:08 +02:00
03b36eef72 Fix typos in comments
Closes #2002
2014-10-06 10:01:36 +02:00
e1ccd7243f Add missing 'by' 2014-10-06 10:01:36 +02:00
364aeed96d Fix typo in scripting.c comment
Closes #1960
2014-10-06 10:01:36 +02:00
a7a2f69bdb Fix typo radis -> redis
Closes #1938
2014-10-06 10:01:36 +02:00
1adc4a7888 Cleanup wording of dictScan() comment
Some language in the comment was difficult
to understand, so this commit: clarifies wording, removes
unnecessary words, and relocates some dependent clauses
closer to what they actually describe.

I also tried to break up longer chains of thought
(if X, then Y, and Q, and also F, so obviously M)
into more manageable chunks for ease of understanding.
2014-10-06 10:01:36 +02:00
8a1d16fe5c Fix comment inconsistencies in ziplist.c
Closes #1523
2014-10-06 10:00:48 +02:00
e0ffc863c6 Clean up text throughout project
- Remove trailing newlines from redis.conf
  - Fix comment misspelling
  - Clarifies zipEncodeLength usage and a C API mention (#1243, #1242)
  - Fix cluster typos (inspired by @papanikge #1507)
  - Fix rewite -> rewrite in a few places (inspired by #682)

Closes #1243, #1242, #1507
2014-10-06 10:00:43 +02:00
3101760937 Fix typos
Closes #1513
2014-10-06 09:59:02 +02:00
3c99e429cf Fix typo in redis.h
Closes #1386
2014-10-06 09:58:18 +02:00
55597bbd67 Fix on-place -> in-place
Closes #1373
2014-10-06 09:58:18 +02:00
a5044c254d Fix hash table size in comment for dictScan
Closes #1351
2014-10-06 09:58:18 +02:00
33daf8e9a9 Fix many small typos
Closes #1871
2014-10-06 09:58:11 +02:00
b72422e100 Fix incorrect comments
error != success; and 0 != number of bytes written

Closes #1806
2014-10-06 09:57:01 +02:00
6b64fa49f8 Fix typo
Closes #1682
2014-10-06 09:57:01 +02:00
575e293ddd Fix typo: ad -> and
Closes #1537
2014-10-06 09:57:01 +02:00
904bd0400c Remove surplus double quotes
Closes #1877
2014-10-06 09:57:01 +02:00
ade6c5e782 Redis 2.8.17 2014-09-19 17:49:16 +02:00
a69534967b Redis 2.8.16. 2014-09-16 15:15:56 +02:00
01f7db608d Seek at the end of AOF after truncate call.
It is not clear if files open in append only mode will automatically fix
their offset after a truncate(2) operation. This commit makes sure that
we reposition the AOF file descriptor offset at the end of the file
after a truncated AOF is loaded and trimmed to the last valid command.
2014-09-16 11:05:50 +02:00
9faeff0215 On AOF end of file, truncate the AOF to last valid command.
Recently we introduced the ability to load truncated AOFs, but
unfortuantely the support was broken since the server, after loading the
truncated AOF, continues appending to the file that is corrupted at the
end. The problem is fixed only in the next AOF rewrite.

This commit fixes the issue by truncating the AOF to the last valid
opcode, and aborting if it is not possible to truncate the file
correctly.
2014-09-16 10:41:15 +02:00
fbd9dc6039 Don't propagate SAVE.
This is a general fix (check that dirty delta is positive) but actually
should have as the only effect fixing the SAVE propagation to
AOF and slaves.
2014-09-16 10:41:15 +02:00
551ffc486c version.h updated to 2.8.15. 2014-09-12 16:16:58 +02:00
a6695e341b Sentinel sentinelGetLeader() top comment improved. 2014-09-11 19:28:10 +02:00
9fe4429a09 Sentinel: fix computation of total number of votes.
The code to check the number of voters was never updated to follow the new
Sentinel specification, so the number of voters was computed using only
the set of Sentinels that provided a vote.

This means that there is a changing majority on partitions, even if
usually the issue is not triggered because of the configured quorum
check (what was broken was the other implicit check that requires anyway
half of the known sentinels to agree in order to start a failover).
2014-09-11 19:28:09 +02:00
6fbcb19275 luaRedisGenericCommand() cached argv handling simplified.
As discussed in issue #1945.
2014-09-10 15:47:02 +02:00
8375a6d0aa Limit the *SCAN command dictScan iterations
*SCAN will cause redis server to hang for seconds
after millions of keys was deleted by SCAN/DEL pairs
2014-09-10 09:58:20 +02:00
55024e9a9a Sentinel: don't set announce-ip if is empty. 2014-09-10 09:26:29 +02:00
8c3507aa8f Sentinel: announce ip/port changes + rewrite.
The original implementation was modified in order to allow to
selectively announce a different IP or port, and to rewrite the two
options in the config file after a rewrite.
2014-09-10 09:26:29 +02:00
9f3abf436b sentinel: Decouple bind address from address sent to other sentinels
There are instances such as EC2 where the bind address is private
(behind a NAT) and cannot be accessible from WAN.

https://groups.google.com/d/msg/redis-db/PVVvjO4nMd0/P3oWC036v3cJ
2014-09-10 09:26:29 +02:00
670084b724 Make aof-load-truncated option actually configurable. 2014-09-08 10:58:00 +02:00
03a5c0ecb5 Correct cleanup when aborting AOF loading.
Because of the new ability to start with a truncated AOF, we need
to correctly release all the memory on EOF error. Otherwise there is a
small leak, that is not really a problem, but causes a false positive in
the tests that detect memory leaks.
2014-09-08 10:58:00 +02:00
683cf5b872 AOF ability to load truncated files. 2014-09-08 10:57:57 +02:00
537f3053fa AOF loading: split handling of format errors from unexpected EOF. 2014-09-08 10:57:10 +02:00
667e2991dc Return empty string if GETRANGE of empty string
Previously, GETRANGE of a key containing nothing ("")
would allocate a large (size_t)-1 return value causing
crashes on 32bit builds when it tried to allocate the
4 GB return string.
2014-09-04 11:47:21 +02:00
4284b07220 Increase size of range request in getrange
32 bit builds don't have a big enough long to capture
the same range as a 64 bit build.  If we use "long long"
we get proper size limits everywhere.

Also updates size of unsigned comparison to fit new size of `end`.

Fixes #1981
2014-09-04 11:46:57 +02:00
db6e874a25 Redis 2.8.14. 2014-09-01 17:00:38 +02:00
dd36f18c76 Sentinel: Abort Hello quicker if not connected
We can save a little work by aborting when we enter the function
if we're disconnected.
2014-09-01 16:35:04 +02:00
59ad68ca4f Store the length of the static argv when first allocated. 2014-09-01 10:40:04 +02:00
8fb8a474fd Fix dictRehash assert casting type.
Also related to #1929.
2014-08-27 10:31:52 +02:00
85b3db4065 Cast to right type in dictNext().
This closes issue #1929, the other part was fixed in the context of issue
2014-08-27 10:31:48 +02:00
3a706ba792 Use long for rehash and iterator index in dict.h.
This allows to support datasets with more than 2 billion of keys
(possible in very large memory instances, this bug was actually
reported).

Closes issue #1814.
2014-08-27 10:31:44 +02:00