Commit Graph

606 Commits

Author SHA1 Message Date
antirez 89e689c592 while loading the rdb file don't add the key to the dictionary at all if it's already expired, instead of removing it just after the insertion. 2010-05-10 15:26:01 +02:00
antirez 585af7e21c minor changes to improve code readability 2010-05-08 03:04:00 +02:00
antirez 242a64f3d6 swap objects out directly while loading an RDB file if we detect we can't stay in the vm max memory limits anyway 2010-05-08 02:38:59 +02:00
antirez 59305dc7a9 DEBUG POPULATE command for fast creation of test databases 2010-05-07 16:33:47 +02:00
Pieter Noordhuis 0a6f3f0f8a swap arguments in blockClientOnSwappedKeys to be consistent 2010-05-07 14:33:34 +02:00
Pieter Noordhuis 3805e04f78 added function that preloads all keys needed to execute a MULTI/EXEC block 2010-05-07 14:22:21 +02:00
Pieter Noordhuis 739ba0d211 add sanity check to zunionInterBlockClientOnSwappedKeys, as the number of keys used is provided as argument to the function 2010-05-07 12:59:34 +02:00
Pieter Noordhuis ca1788b560 make prototype of custom function to preload keys from the vm match the prototype of waitForMultipleSwappedKeys 2010-05-07 12:58:44 +02:00
Pieter Noordhuis 6f07874621 extract preloading of multiple keys according to the command prototype to a separate function 2010-05-07 12:45:27 +02:00
Pieter Noordhuis f3b52411db make append only filename configurable 2010-05-07 11:55:12 +02:00
Pieter Noordhuis f4f06efccc don't load value from VM for EXISTS 2010-05-07 11:40:26 +02:00
antirez a0e7e5f516 swap file name pid expansion removed. Not suited for mission critical software... 2010-05-07 09:36:37 +02:00
antirez 8b5bb414f1 Swap file is now locked 2010-05-07 09:32:26 +02:00
antirez f424d5f398 Merge branch 'master' into aof-speedup 2010-05-06 23:19:46 +02:00
Pieter Noordhuis 4132ad8d49 log error and quit when the AOF contains an unfinished MULTI 2010-05-06 22:14:07 +02:00
Pieter Noordhuis 946342c190 hincrby should report an error when called against a hash key that doesn't contain an integer 2010-05-06 20:38:50 +02:00
antirez 28ed1f33ee AOF writes are now accumulated into a buffer and flushed into disk just before re-entering the event loop. A lot less writes but still this guarantees that AOF is written before the client gets a positive reply about a write operation, as no reply is trasnmitted before re-entering into the event loop. 2010-05-06 20:16:14 +02:00
antirez 10ce12761a On Linux now fdatasync() is used insetad of fsync() in order to flush the AOF file kernel buffers 2010-05-02 15:05:34 +02:00
antirez dd142b9cd7 New MONITOR output format with timestamp, every command in a single line, string representations 2010-04-29 18:43:51 +02:00
antirez 8f63ddca00 AOF is now rewritten on slave after SYNC with master. Thanks to @_km for finding this bug and any others' 2010-04-27 16:58:08 +02:00
antirez 526d00a572 SETEX implemented 2010-04-23 19:07:33 +02:00
antirez c8d0ea0ef1 Pub/Sub API change: now messages received via pattern matching have a different message type and an additional field representing the original pattern the message matched 2010-04-23 15:36:00 +02:00
antirez 723240057a new units for bytes specification 2010-04-22 15:09:07 +02:00
antirez 2b61932933 Now in redis.conf it is possible to specify units where appropriate instead of amounts of bytes, like 2Gi or 4M and so forth 2010-04-22 12:05:51 +02:00
antirez dc4be23ec8 binary safe keys ready implementation of RANDOMKEYS 2010-04-21 11:31:29 +02:00
antirez 24df76987e Now that's the right 1.3.10 2010-04-21 10:31:48 +02:00
antirez 3bb225d66b Revert "fsync always now uses O_DIRECT on Linux"
This reverts commit 566c3c7a22.
2010-04-21 10:31:16 +02:00
antirez d6fb4d5396 Revert "define __USE_GNU to get O_DIRECT"
This reverts commit 122c049834.
2010-04-21 10:31:08 +02:00
antirez 122c049834 define __USE_GNU to get O_DIRECT 2010-04-20 18:29:06 +02:00
antirez 566c3c7a22 fsync always now uses O_DIRECT on Linux 2010-04-20 18:25:30 +02:00
antirez 66c8853f9c Fix for MULTI/EXEC and Replication/AOF: now the block is correctly sent as MULTI/..writing operations../EXEC. Ok for slaves but more work needed for the AOF as it should be a write-all-or-nothing business 2010-04-19 18:30:11 +02:00
antirez 7ccd2d0a5f running the test using tcl8.5 directly instead of tclsh that too often it's a symlink to 8.4 2010-04-19 16:11:13 +02:00
antirez 08ee9b570f Fix for a SORT bug introduced with commit 16fa22f1, regression test added 2010-04-18 17:51:15 +02:00
antirez 177727542c Guru mediation -> meditation 2010-04-18 00:03:49 +02:00
Pieter Noordhuis 682c73e87e check eptr inline 2010-04-17 13:06:49 +02:00
Pieter Noordhuis bd79a6bda0 refactor code that retrieves value from object or replies to client 2010-04-17 13:06:49 +02:00
antirez 4e8dbaf463 Merge branch 'hash' of git://github.com/pietern/redis 2010-04-17 12:54:49 +02:00
antirez f83c6cb5eb redisAssert(0) => redisPanic("something meaningful") 2010-04-17 12:54:40 +02:00
Pieter Noordhuis 3f973463a7 make sure that the resulting value in hincrby is encoded when possible 2010-04-17 12:46:23 +02:00
Pieter Noordhuis edc2f63ad9 increment dirty counter after hmset 2010-04-17 12:35:22 +02:00
Pieter Noordhuis 97224de7f9 strip tryObjectEncoding from hashSet, to enable the arguments being encoded in-place 2010-04-17 12:33:43 +02:00
antirez c651fd9ee3 Added support for Guru Mediation, and raising a guru mediation if refCount <= 0 but decrRefCount is called against such an object 2010-04-17 11:35:05 +02:00
Pieter Noordhuis 55017f9da0 fix small error and memory leaks in SORT 2010-04-16 18:11:57 +02:00
antirez b4eb9ccdcb Merge branch 'hash-refactor' of git://github.com/pietern/redis 2010-04-16 15:53:44 +02:00
Pieter Noordhuis b6f07345c9 check object type in lookupKeyByPattern 2010-04-16 13:37:40 +02:00
Pieter Noordhuis 705dad386d make sortCommand aware that lookupKeyByPattern always increased the refcount of the returned value 2010-04-16 13:31:17 +02:00
Pieter Noordhuis a3f3af860b revert 0c390a to stop using tricks with o->refcount 2010-04-16 13:20:12 +02:00
Pieter Noordhuis c44d3b56df store the hash iterator on the heap instead of the stack 2010-04-16 12:48:48 +02:00
Pieter Noordhuis c811bb381d drop inline directive 2010-04-16 12:13:41 +02:00
Pieter Noordhuis feb8d7e6a6 rename hashReplace to hashSet 2010-04-16 12:12:50 +02:00
Konstantin Merenkov d4dd6556c3 Don't set expire to keys with ttl=0, remove them immediately. 2010-04-15 21:29:46 +02:00
Pieter Noordhuis 16fa22f12b make sure that cmpobj is in decoded form when sorting by ALPHA (this solves edge case from previous commit where (!sortby && alpha) == 1) 2010-04-15 20:55:34 +02:00
Pieter Noordhuis 6d7d1370c3 enable hash dereference in SORT on BY and GET 2010-04-15 19:16:39 +02:00
Pieter Noordhuis 6e9e463f80 use shared replies for hset 2010-04-15 19:16:39 +02:00
Pieter Noordhuis 0c390abc69 set refcount of string objects retrieved from zipmaps to 0, so we don't have to touch the refcount of the objects inside dicts 2010-04-15 19:16:39 +02:00
Pieter Noordhuis 1f1c769518 added HSETNX 2010-04-15 19:16:39 +02:00
Pieter Noordhuis 7fb16bacae refactor of hash commands to use specialized api that abstracts zipmap and dict apis 2010-04-15 19:16:39 +02:00
Pieter Noordhuis a71f072f73 move retrieval of long up to prevent an empty hash from being created 2010-04-15 19:16:38 +02:00
antirez 8ca3e9d10b Active rehashing 2010-04-15 18:07:57 +02:00
antirez 5413c40da7 Incrementally rehahsing hash table! Thanks to Derek Collison and Pieter Noordhuis for feedbacks/help 2010-04-15 11:59:13 +02:00
antirez e6cca5dba6 Does not allow commands other than Pub/Sub commands when there is at least one pattern 2010-04-14 12:12:25 +02:00
Alex McHale 9a22de8270 Fixed a tiny memory leak when loading the configuration file. 2010-04-13 11:48:33 -05:00
antirez b60bace9f9 Merge branch 'hmget' of git://github.com/pietern/redis 2010-04-13 18:30:55 +02:00
Alex McHale bbe025e04b Validate numeric inputs. 2010-04-13 10:23:10 -05:00
Alex McHale e0a62c7fdb Remove trailing whitespace. 2010-04-13 10:21:39 -05:00
antirez 4e27f26863 Now all the commands returning a multi bulk reply against non existing keys will return an empty multi bulk, not a nil one 2010-04-12 16:03:41 +02:00
Pieter Noordhuis 09aeb5790f implemented HMGET 2010-04-12 14:57:38 +02:00
Pieter Noordhuis d33278d160 implemented HMSET 2010-04-12 12:29:37 +02:00
antirez 05df762175 Sharing of small integer objects: may save a lot of memory with datasets having many of this 2010-04-12 11:38:08 +02:00
antirez 10d91d7fb3 removed a no longer true assert in the VM code 2010-04-09 18:35:24 +02:00
antirez bdcb92f273 shareobjects feautres killed - no gains most of the time, but VM complexities 2010-04-09 17:13:39 +02:00
antirez 78ebe4c88f use directly the real key object in VM I/O jobs to match by pointer, and to handle different keys with the same name living in different DBs, but being at the same moment in the IO job queues 2010-04-09 17:02:56 +02:00
antirez 884d4b39d4 Prevent hash table resize while there are active child processes in order to play well with copy on write 2010-04-08 20:08:51 +02:00
antirez 5727b9aa94 Merge branch 'issue_218' of git://github.com/pietern/redis 2010-04-08 16:07:26 +02:00
antirez 10c2baa50a -1 not needed... 2010-04-08 16:07:18 +02:00
antirez 6fcb180039 Skiplist theoretical fix 2010-04-08 15:56:21 +02:00
antirez 454eea7c44 Now when a child is terminated by a signal, the signal number is logged as well 2010-04-07 17:36:44 +02:00
Pieter Noordhuis aa7c29340f use long long reply type for HINCRBY 2010-04-05 16:51:48 +02:00
Pieter Noordhuis 5e26ae88b8 last argument is never encoded for HINCRBY 2010-04-05 16:51:34 +02:00
antirez 4005fef124 Now PUBLISH commands are replicated to slaves 2010-04-02 16:42:15 +02:00
Pieter Noordhuis 8bca8773b4 use the right object when cleaning up after zunion/zinter (fixes issue 216) 2010-04-01 22:07:50 +02:00
antirez 14ae26d89d Merge branch 'zipmap' of git://github.com/pietern/redis 2010-04-01 18:48:14 +02:00
Pieter Noordhuis e9484a8502 reduce code complexity because zipmapLen now is O(1) 2010-04-01 14:31:13 +02:00
antirez ffc6b7f864 Pub/Sub pattern matching capabilities 2010-04-01 13:13:29 +02:00
antirez 958cd5f394 Deny EXEC under out of memory 2010-03-31 19:49:12 +02:00
antirez d6cc8867b7 No timeouts nor other commands for clients in a Pub/Sub context 2010-03-29 17:48:13 +02:00
antirez ff767a7580 free hash table entries about no longer active classes, so that PUBSUB can be abused with millions of different classes 2010-03-29 12:33:41 +02:00
antirez 201037f562 Fixed a refcount stuff leading to PUBSUB crashes 2010-03-29 12:23:02 +02:00
antirez fc46bb71ae First pubsub fix 2010-03-29 12:13:35 +02:00
antirez befec3cd91 PUBSUB implemented 2010-03-29 11:47:58 +02:00
antirez cac154c580 Redis version is now 1.3.8 2010-03-29 08:38:23 +02:00
antirez 570e43c828 Merge branch 'hincrby' of git://github.com/pietern/redis 2010-03-26 17:08:47 +01:00
Pieter Noordhuis 53476b82a1 removed unnecessary refcount increase that caused the HINCRBY memleak 2010-03-26 16:45:41 +01:00
Pieter Noordhuis 01426b054c implements HINCRBY and tests (todo: find and fix small memleak) 2010-03-26 16:03:19 +01:00
antirez 168ac5c6e3 Removed a useless if spotted by Pieter Noordhuis 2010-03-26 11:21:11 +01:00
antirez 248ea31003 Fixed a critical replication bug: binary values issued with the multi bulk protocol caused a protocol desync with slaves. 2010-03-26 10:56:27 +01:00
antirez b61a28fe35 Fixed the reply about denied write commands under maxmemory reached condition: now the error will no longer lead to a client-server protocol desync 2010-03-24 21:58:34 +01:00
antirez 500ece7c17 CONFIG command implemened -- just a start but already useful 2010-03-24 21:46:51 +01:00
antirez e940927314 with --help states that you can use - as config file name to feed config via stdin 2010-03-23 20:04:55 +01:00
antirez 2a6a2ed102 New INFO field: expired_keys 2010-03-23 19:40:13 +01:00
antirez 1763929f23 the Cron timer function is now called 10 times per second instead of 1 time per second to make Redis more responsibe to BGSAVE and to delete expired keys more incrementally 2010-03-23 19:15:02 +01:00
antirez d36c4e97e5 key deletion on empty value fix + some refactoring 2010-03-23 12:29:35 +01:00
antirez 3ea27d37d1 Empty value trigger key removal in all the operations 2010-03-23 12:15:44 +01:00
antirez 44efe66ef2 Merged gnrfan patches fixing issues 191, 193, 194 2010-03-22 17:31:46 +01:00
antirez 7bf90179a3 Merge branch 'issue_193' of git://github.com/gnrfan/redis 2010-03-22 17:29:20 +01:00
antirez 5e2022bb48 Merge branch 'issue_191' of git://github.com/gnrfan/redis 2010-03-22 17:29:09 +01:00
antirez a9c723ea1e Redis master version is now 1.3.7 2010-03-22 17:08:29 +01:00
Jeremy Zawodny b3f83f1272 support for include directive in config parser 2010-03-19 22:24:17 -07:00
antirez aa42c9a791 Removed a stupid overriding of config values due to a wrong cut&paste 2010-03-19 19:02:24 +01:00
antirez a97b906092 VM hash type swappability implemented. Handling of failed pthread_create() call. 2010-03-19 18:02:37 +01:00
Antonio Ognio 42ab0172ab Solving issue #191 on Google Code: -v and --version should print the version of Redis 2010-03-19 04:19:42 -05:00
Antonio Ognio 723fb69b9e Solves issue #194 on Google Code: --help parameter to redis-srver prints the usage message 2010-03-19 01:49:09 -05:00
Antonio Ognio 6bccf64a5e Fixing issue 193 2010-03-19 01:01:08 -05:00
antirez c77169b7e9 increment server.dirty on HDEL 2010-03-18 18:56:07 +01:00
antirez 7b7f987e91 Redis 1.3.6 2010-03-18 16:55:49 +01:00
antirez db5946fc27 Optimization fixed and re-activated 2010-03-18 03:06:08 +01:00
antirez bf0da6174c reverted an optimization that makes Redis not stable 2010-03-18 02:59:28 +01:00
antirez 2a1198b4c4 HDEL fix, an optimization for comparison of objects in hash table lookups when they are integer encoding 2010-03-17 19:26:53 +01:00
antirez a4c507866c Version is now 1.3.5 2010-03-17 18:30:15 +01:00
antirez 4583c4f0ea Merged Pietern patch for VM key args helper function. Fixed an obvious bug in the redis-cli passwd auth stuff 2010-03-17 17:14:07 +01:00
antirez 17d68f9c99 Merge branch 'aggregates' of git://github.com/pietern/redis 2010-03-17 16:59:29 +01:00
antirez a86f14b190 HEXISTS and tests implemented 2010-03-17 13:34:27 +01:00
antirez 2069d06a0b Fixed a bug in HSET, a memory leak, and a theoretical bug in dict.c 2010-03-17 02:00:03 +01:00
Pieter Noordhuis 76583ea455 added preloading keys from VM when using ZINTER or ZUNION 2010-03-16 20:43:49 +01:00
Pieter Noordhuis d2764cd692 added explicit AGGREGATE [SUM|MIN|MAX] option to ZUNION/ZINTER 2010-03-16 20:34:45 +01:00
antirez 164ee59564 HGET fix for integer encoded field against zipmap encoded hash 2010-03-16 18:44:37 +01:00
antirez 78409a0f84 HKEYS / HVALS / HGETALL 2010-03-16 16:09:58 +01:00
antirez 6d4fb107b2 Solved a memory leak with Hashes 2010-03-16 01:11:23 +01:00
antirez dd88747b78 pretty big refactoring 2010-03-15 23:59:40 +01:00
antirez 92b27fe946 An interesting refactoring + more expressive internal API 2010-03-15 22:46:20 +01:00
antirez 653c9240b7 Fixed the same problem in ZREVRANK 2010-03-15 19:33:26 +01:00
antirez cc3b01c30a Fixed a ZRANK bug 2010-03-15 19:33:01 +01:00
antirez bae2c7ec6b zipmap to hash conversion in HSET 2010-03-15 18:28:12 +01:00
antirez 55a8298fcf max zipmap entries and max zipmap value parameters added into INFO output 2010-03-14 13:58:28 +01:00
antirez 07efaf7467 HDEL and some improvement in DEBUG OBJECT command 2010-03-14 13:54:31 +01:00
antirez 9c8e3cee26 Append only file support for hashes 2010-03-14 13:40:41 +01:00
antirez 5de9ad7c85 A minor fix and a few debug messages removed 2010-03-12 23:46:27 +01:00
antirez 8c5abee892 Applied the replication bug patch provided by Jeremy Zawodny, removing temp file collision after the slave got the dump.rdb file in the SYNC stage 2010-03-12 11:38:53 +01:00
antirez bcd1190644 Fix for HGET against non Hash type, debug messages used to understand a bit better a corrupted rdb file 2010-03-11 16:10:36 +01:00
Pieter Noordhuis b9eed483ae fix: use zmalloc instead of malloc 2010-03-09 17:32:24 +01:00
antirez c1d57a1063 Merged zsetops branch from Pietern 2010-03-09 16:25:55 +01:00
antirez ee5cfe3853 Merged ZREMBYRANK from Pietern 2010-03-09 16:22:50 +01:00
antirez e3f46030fc Merged ZREVRANK from Pietern 2010-03-09 16:19:33 +01:00
Pieter Noordhuis 8f92e76831 use a struct to store both a dict and its weight for ZUNION and ZINTER, so qsort can be applied 2010-03-09 16:12:34 +01:00
antirez ada386b218 Hash auto conversion from zipmap to hash table, type fixed for hashes, hash loading from disk 2010-03-09 13:18:49 +01:00
Pieter Noordhuis 2830ca539b replaced ZMERGE by ZUNION and ZINTER. note: key preloading by the VM does not yet work 2010-03-09 12:38:50 +01:00
antirez b1befe6a8e Hashes saving / fixes 2010-03-08 21:33:07 +01:00
Pieter Noordhuis b287c9bb2b use ZMERGE as starting point 2010-03-08 21:27:26 +01:00
antirez cbba7dd7c9 HSET fixes, now the new pointer is stored back in the object pointer field 2010-03-07 23:41:48 +01:00
Pieter Noordhuis 798d9e5531 added ZREVRANK 2010-03-07 20:35:53 +01:00