summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Redis 2.7.105 (2.8 Release Candidate 5).2.8.0-rc5antirez2013-10-092-1/+14
|
* Replication: install the write handler when reusing a cached master.antirez2013-10-041-0/+10
| | | | | | | | | | | | | | | Sometimes when we resurrect a cached master after a successful partial resynchronization attempt, there is pending data in the output buffers of the client structure representing the master (likely REPLCONF ACK commands). If we don't reinstall the write handler, it will never be installed again by addReply*() family functions as they'll assume that if there is already data pending, the write handler is already installed. This bug caused some slaves after a successful partial sync to never send REPLCONF ACK, and continuously being detected as timing out by the master, with a disconnection / reconnection loop.
* Replication: fix master timeout.antirez2013-10-041-1/+7
| | | | | | | | | | | Since we started sending REPLCONF ACK from slaves to masters, the lastinteraction field of the client structure is always refreshed as soon as there is room in the socket output buffer, so masters in timeout are detected with too much delay (the socket buffer takes a lot of time to be filled by small REPLCONF ACK <number> entries). This commit only counts data received as interactions with a master, solving the issue.
* PSYNC: safer handling of PSYNC requests.antirez2013-10-041-1/+5
| | | | | | | | | There was a bug that over-esteemed the amount of backlog available, however this could only happen when a slave was asking for an offset that was in the "future" compared to the master replication backlog. Now this case is handled well and logged as an incident in the master log file.
* Add REWRITE to CONFIG subcommands help message.antirez2013-10-041-1/+1
|
* Document the redis-cli --csv option.Michel Martens2013-09-261-0/+1
|
* Allow AUTH / PING when disconnected from slave and serve-stale-data is no.antirez2013-09-171-2/+2
|
* redis-cli: fix big keys search when the key no longer exist.antirez2013-09-041-1/+0
| | | | | | The code freed a reply object that was never created, resulting in a segfault every time randomkey returned a key that was deleted before we queried it for size.
* mistype fixedMaxim Zakharov2013-09-031-1/+1
|
* A mistype fixedMaxim Zakharov2013-09-031-1/+1
|
* Redis 2.7.104 (2.8 Release Candidate 4).2.8.0-rc4antirez2013-08-302-1/+14
|
* Test: Lua stack leak regression test added.antirez2013-08-301-0/+15
|
* Test: added a memory efficiency test.antirez2013-08-302-0/+33
|
* Fixed critical memory leak from EVAL.antirez2013-08-291-4/+9
| | | | | | | | | | | | | | | | Multiple missing calls to lua_pop prevented the error handler function pushed on the stack for lua_pcall() to be popped before returning, causing a memory leak in almost all the code paths of EVAL (both successful calls and calls returning errors). This caused two issues: Lua leaking memory (and this was very visible from INFO memory output, as the 'used_memory_lua' field reported an always increasing amount of memory used), and as a result slower and slower GC cycles resulting in all the CPU being used. Thanks to Tanguy Le Barzic for noticing something was wrong with his 2.8 slave, and for creating a testing EC2 environment where I was able to investigate the issue.
* Merge pull request #1244 from yihuang/2.8Salvatore Sanfilippo2013-08-271-1/+1
|\ | | | | fix lua_cmsgpack pack map as array
| * fix lua_cmsgpack pack map as arrayyihuang2013-08-131-1/+1
| |
* | Fix an hypothetical issue in processMultibulkBuffer().antirez2013-08-271-1/+5
| |
* | tryObjectEncoding(): optimize sds strings if possible.antirez2013-08-271-1/+20
| | | | | | | | | | | | When no encoding is possible, at least try to reallocate the sds string with one that does not waste memory (with free space at the end of the buffer) when the string is large enough.
* | tryObjectEncoding(): don't call stringl2() for too big strings.antirez2013-08-271-1/+3
| | | | | | | | | | | | | | We are sure that a string that is longer than 21 chars cannot be represented by a 64 bit signed integer, as -(2^64) is 21 chars: strlen(-18446744073709551616) => 21
* | Fix DEBUG SDSLEN after 2.8 back port.antirez2013-08-271-1/+1
| |
* | Don't over-allocate the sds string for large bulk requests.antirez2013-08-271-2/+2
| | | | | | | | | | The call to sdsMakeRoomFor() did not accounted for the amount of data already present in the query buffer, resulting into over-allocation.
* | DEBUG SDSLEN added.antirez2013-08-271-0/+23
| | | | | | | | | | This command is only useful for low-level debugging of memory issues due to sds wasting memory as empty buffer at the end of the string.
* | Update server.lastbgsave_status when fork() fails.antirez2013-08-271-0/+1
| |
* | Only run the fast active expire cycle if master & enabled.antirez2013-08-271-2/+4
| |
* | Opening TCP listening ports refactored into a function.antirez2013-08-221-38/+58
| |
* | Print error message when can't bind * on any address.antirez2013-08-221-3/+5
| |
* | Fix for issue #1214 simplified.antirez2013-08-211-14/+12
| |
* | fixed initServer fail while having no IPv6 nor IPv4Allan2013-08-211-1/+1
| |
* | fixed initServer failed if no IPV4 or no IPV6Allan2013-08-211-4/+11
| |
* | fixed bug issue of #1213Allan2013-08-211-3/+6
| |
* | Use printf %zu specifier to print private_dirty.antirez2013-08-202-2/+2
| |
* | dictFingerprint(): cast pointers to integer of same size.antirez2013-08-201-2/+2
| |
* | Redis 2.7.103 (2.8 Release Candidate 3).2.8.0-rc3antirez2013-08-192-1/+17
| |
* | Revert "Fixed type in dict.c comment: 265 -> 256."antirez2013-08-191-1/+1
| | | | | | | | This reverts commit 009515f9140fc1330c14af994040a8885056986c.
* | Fixed type in dict.c comment: 265 -> 256.antirez2013-08-191-1/+1
| |
* | assert.h replaced with redisassert.h when appropriate.antirez2013-08-195-5/+5
| | | | | | | | | | Also a warning was suppressed by including unistd.h in redisassert.h (needed for _exit()).
* | Added redisassert.h as drop in replacement for assert.h.antirez2013-08-191-0/+45
| | | | | | | | | | By using redisassert.h version of assert() you get stack traces in the log instead of a process disappearing on assertions.
* | dictFingerprint() fingerprinting made more robust.antirez2013-08-191-9/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous hashing used the trivial algorithm of xoring the integers together. This is not optimal as it is very likely that different hash table setups will hash the same, for instance an hash table at the start of the rehashing process, and at the end, will have the same fingerprint. Now we hash N integers in a smarter way, by summing every integer to the previous hash, and taking the integer hashing again (see the code for further details). This way it is a lot less likely that we get a collision. Moreover this way of hashing explicitly protects from the same set of integers in a different order to hash to the same number. This commit is related to issue #1240.
* | Fix comments for correctness in zunionInterGenericCommand().antirez2013-08-191-3/+5
| | | | | | | | Related to issue #1240.
* | Properly init/release iterators in zunionInterGenericCommand().antirez2013-08-191-19/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit does mainly two things: 1) It fixes zunionInterGenericCommand() by removing mass-initialization of all the iterators used, so that we don't violate the unsafe iterator API of dictionaries. This fixes issue #1240. 2) Since the zui* APIs required the allocator to be initialized in the zsetopsrc structure in order to use non-iterator related APIs, this commit fixes this strict requirement by accessing objects directly via the op->subject->ptr pointer we have to the object.
* | dict.c iterator API misuse protection.antirez2013-08-192-4/+31
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dict.c allows the user to create unsafe iterators, that are iterators that will not touch the dictionary data structure in any way, preventing copy on write, but at the same time are limited in their usage. The limitation is that when itearting with an unsafe iterator, no call to other dictionary functions must be done inside the iteration loop, otherwise the dictionary may be incrementally rehashed resulting into missing elements in the set of the elements returned by the iterator. However after introducing this kind of iterators a number of bugs were found due to misuses of the API, and we are still finding bugs about this issue. The bugs are not trivial to track because the effect is just missing elements during the iteartion. This commit introduces auto-detection of the API misuse. The idea is that an unsafe iterator has a contract: from initialization to the release of the iterator the dictionary should not change. So we take a fingerprint of the dictionary state, xoring a few important dict properties when the unsafe iteartor is initialized. We later check when the iterator is released if the fingerprint is still the same. If it is not, we found a misuse of the iterator, as not allowed API calls changed the internal state of the dictionary. This code was checked against a real bug, issue #1240. This is what Redis prints (aborting) when a misuse is detected: Assertion failed: (iter->fingerprint == dictFingerprint(iter->d)), function dictReleaseIterator, file dict.c, line 587.
* Use precomptued objects for bulk and mbulk prefixes.antirez2013-08-121-2/+9
|
* replicationFeedSlaves() func name typo: feedReplicationBacklogWithObject -> ↵antirez2013-08-121-1/+1
| | | | feedReplicationBacklog.
* replicationFeedSlave() reworked for correctness and speed.antirez2013-08-121-97/+42
| | | | | | | | | | | | | | The previous code using a static buffer as an optimization was lame: 1) Premature optimization, actually it was *slower* than naive code because resulted into the creation / destruction of the object encapsulating the output buffer. 2) The code was very hard to test, since it was needed to have specific tests for command lines exceeding the size of the static buffer. 3) As a result of "2" the code was bugged as the current tests were not able to stress specific corner cases. It was replaced with easy to understand code that is safer and faster.
* Fix a PSYNC bug caused by a variable name typo.antirez2013-08-121-1/+1
|
* Fix sdsempty() prototype in sds.h.antirez2013-08-122-2/+2
|
* redis-benchmark: changes to random arguments substitution.antirez2013-08-081-28/+80
| | | | | | | | | | | | | | | | | | | | | Before this commit redis-benchmark supported random argumetns in the form of :rand:000000000000. In every string of that form, the zeros were replaced with a random number of 12 digits at every command invocation. However this was far from perfect as did not allowed to generate simply random numbers as arguments, there was always the :rand: prefix. Now instead every argument in the form __rand_int__ is replaced with a 12 digits number. Note that "__rand_int__" is 12 characters itself. In order to implement the new semantic, it was needed to change a few thigns in the internals of redis-benchmark, as new clients are created cloning old clients, so without a stable prefix such as ":rand:" the old way of cloning the client was no longer able to understand, from the old command line, what was the position of the random strings to substitute. Now instead a client structure is passed as a reference for cloning, so that we can directly clone the offsets inside the command line.
* redis-benchmark: replace snprintf()+memcpy with faster code.antirez2013-08-081-5/+10
| | | | | This change was profiler-driven, but the actual effect is hard to measure in real-world redis benchmark runs.
* Little typoJan-Erik Rediger2013-08-071-1/+1
|
* redis-benchmark: fix memory leak introduced by 346256fantirez2013-08-071-0/+1
|