summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Redis 2.6.17.2.6.17antirez2013-12-112-1/+14
|
* Merge pull request #847 from yossigo/repldboff-fixSalvatore Sanfilippo2013-12-111-1/+1
|\ | | | | Fix wrong repldboff type which causes dropped replication in rare cases.
| * Fix wrong repldboff type which causes dropped replication in rare cases.Yossi Gottlieb2012-12-241-1/+1
| |
* | Only run the fast active expire cycle if master & enabled.antirez2013-12-101-2/+4
| |
* | Log to what master a slave is going to connect to.antirez2013-11-111-1/+2
| |
* | Fix broken rdbWriteRaw() return value check in rdb.c.antirez2013-11-071-1/+1
| | | | | | | | Thanks to @PhoneLi for reporting.
* | Merge pull request #1366 from yaauie/deprecate-redis-copy-script-in-2.6Salvatore Sanfilippo2013-11-061-55/+12
|\ \ | | | | | | 2.6 branch backport of #1365
| * | Deprecate utils/redis-copy.rb in favor of redis-copy gemRyan Biesemeyer2013-11-061-55/+12
|/ /
* | redis-benchmark: update help for new __rand_int__ form.antirez2013-10-281-6/+5
| |
* | 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.
* | Redis 2.6.16.2.6.16antirez2013-08-282-1/+17
| |
* | fix lua_cmsgpack pack map as arrayyihuang2013-08-271-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
| |
* | Redis 2.6.152.6.15antirez2013-08-212-1/+17
| |
* | 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
| |
* | Revert "Fixed type in dict.c comment: 265 -> 256."antirez2013-08-191-1/+1
| | | | | | | | This reverts commit 19de8e46bf36e77ca61a966a777fbf63b9afcc45.
* | 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.
* | Fix sdsempty() prototype in sds.h.antirez2013-08-121-1/+1
| |
* | 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
| |
* | redis-benchmark: max pipeline length hardcoded limit removed.antirez2013-08-071-7/+15
| |
* | redis-benchmark: fix db selection when :rand: feature is used.antirez2013-08-071-0/+6
| |
* | redis-benchmark: ability to SELECT a specifid db number.antirez2013-08-071-3/+43
| |
* | Add per-db average TTL information in INFO output.antirez2013-08-072-4/+30
| | | | | | | | | | | | | | | | | | | | | | | | Example: db0:keys=221913,expires=221913,avg_ttl=655 The algorithm uses a running average with only two samples (current and previous). Keys found to be expired are considered at TTL zero even if the actual TTL can be negative. The TTL is reported in milliseconds.
* | activeExpireCycle(): fix about fast cycle early start.antirez2013-08-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't want to repeat a fast cycle too soon, the previous code was broken, we need to wait two times the period *since* the start of the previous cycle in order to avoid there is an even space between cycles: .-> start .-> second start | | +-------------+-------------+--------------+ | first cycle | pause | second cycle | +-------------+-------------+--------------+ The second and first start must be PERIOD*2 useconds apart hence the *2 in the new code.
* | Some activeExpireCycle() refactoring.antirez2013-08-072-21/+32
| |
* | Remove dead code and fix comments for new expire code.antirez2013-08-071-56/+10
| |
* | Darft #2 for key collection algo: more improvements.antirez2013-08-071-2/+14
| | | | | | | | | | | | | | This commit makes the fast collection cycle time configurable, at the same time it does not allow to run a new fast collection cycle for the same amount of time as the max duration of the fast collection cycle.
* | Draft #1 of a new expired keys collection algorithm.antirez2013-08-072-19/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main idea here is that when we are no longer to expire keys at the rate the are created, we can't block more in the normal expire cycle as this would result in too big latency spikes. For this reason the commit introduces a "fast" expire cycle that does not run for more than 1 millisecond but is called in the beforeSleep() hook of the event loop, so much more often, and with a frequency bound to the frequency of executed commnads. The fast expire cycle is only called when the standard expiration algorithm runs out of time, that is, consumed more than REDIS_EXPIRELOOKUPS_TIME_PERC of CPU in a given cycle without being able to take the number of already expired keys that are yet not collected to a number smaller than 25% of the number of keys. You can test this commit with different loads, but a simple way is to use the following: Extreme load with pipelining: redis-benchmark -r 100000000 -n 100000000 \ -P 32 set ele:rand:000000000000 foo ex 2 Remove the -P32 in order to avoid the pipelining for a more real-world load. In another terminal tab you can monitor the Redis behavior with: redis-cli -i 0.1 -r -1 info keyspace and redis-cli --latency-history Note: this commit will make Redis printing a lot of debug messages, it is not a good idea to use it in production.
* | Fixed typo in 2.6.14 changelog. verison -> version.antirez2013-06-201-1/+1
| |
* | Redis 2.6.142.6.14antirez2013-06-202-1/+12
| |
* | Sentinel: parse new INFO replication output correctly.antirez2013-06-201-8/+21
| | | | | | | | | | | | | | | | Sentinel was not able to detect slaves when connected to a very recent version of Redis master since a previos non-backward compatible change to INFO broken the parsing of the slaves ip:port INFO output. This fixes issue #1164
* | Test: regression test for #1163.antirez2013-06-191-0/+17
| |
* | Allow writes from scripts called by AOF loading in read-only slaves.antirez2013-06-191-0/+1
| | | | | | | | This fixes issue #1163