summaryrefslogtreecommitdiff
path: root/src/debug.c
Commit message (Collapse)AuthorAgeFilesLines
* Use const in Redis Module API where possible.Yossi Gottlieb2016-06-201-7/+7
|
* DEBUG command self documentation.antirez2016-05-041-1/+48
|
* add DEBUG JEMALLC PURGE and JEMALLOC INFO cleanupOran Agra2016-04-251-1/+16
|
* Hopefully better memory test on crash.antirez2015-12-161-47/+46
| | | | | | | | | | | | | | | The old test, designed to do a transformation on the bits that was invertible, in order to avoid touching the original memory content, was not effective as it was redis-server --test-memory. The former often reported OK while the latter was able to spot the error. So the test was substituted with one that may perform better, however the new one must backup the memory tested, so it tests memory in small pieces. This limits the effectiveness because of the CPU caches. However some attempt is made in order to trash the CPU cache between the fill and the check stages, but not for the addressing test unfortunately. We'll see if this test will be able to find errors where the old failed.
* Suppress harmless warnings.antirez2015-12-161-2/+2
|
* Crash report format improvements.antirez2015-12-161-24/+35
|
* Log address causing SIGSEGV.antirez2015-12-151-0/+4
|
* fix sprintf and snprintf format stringantirez2015-11-281-1/+1
| | | | | | | There are some cases of printing unsigned integer with %d conversion specificator and vice versa (signed integer with %u specificator). Patch by Sergey Polovko. Backported to Redis from Disque.
* More reliable DEBUG loadaof.antirez2015-10-301-0/+1
| | | | | Make sure to flush the AOF output buffers before reloading. Result: less false timing related false positives on AOF tests.
* Scripting: ability to turn on Lua commands style replication globally.antirez2015-10-301-0/+5
| | | | | | Currently this feature is only accessible via DEBUG for testing, since otherwise depending on the instance configuration a given script works or is broken, which is against the Redis philosophy.
* DEBUG RESTART/CRASH-AND-RECOVER [delay] implemented.antirez2015-10-131-0/+14
|
* Lazyfree: ability to free whole DBs in background.antirez2015-10-011-2/+2
|
* Lazyfree: Hash converted to use plain SDS WIP 4.antirez2015-10-011-10/+8
|
* DEBUG DIGEST Set type memory leak fixed.antirez2015-10-011-0/+1
|
* Lazyfree: Sorted sets convereted to plain SDS. (several commits squashed)antirez2015-10-011-6/+3
|
* Lazyfree: Convert Sets to use plains SDS (several commits squashed).antirez2015-10-011-1/+3
|
* RDMF: More consistent define names.antirez2015-07-271-62/+62
|
* RDMF: REDIS_OK REDIS_ERR -> C_OK C_ERR.antirez2015-07-261-6/+6
|
* RDMF: redisAssert -> serverAssert.antirez2015-07-261-11/+11
|
* RDMF: OBJ_ macros for object related stuff.antirez2015-07-261-18/+18
|
* RDMF: use client instead of redisClient, like Disque.antirez2015-07-261-4/+4
|
* RDMF: redisLog -> serverLog.antirez2015-07-261-60/+60
|
* RDMF (Redis/Disque merge friendlyness) refactoring WIP 1.antirez2015-07-261-1/+1
|
* Add sdshdr5 to DEBUG structsize.antirez2015-07-161-0/+1
|
* Fix DEBUG structsize output.antirez2015-07-141-7/+7
|
* sds size classes - memory optimizationOran Agra2015-07-141-1/+4
|
* DEBUG HTSTATS <dbid> added.antirez2015-07-141-0/+21
| | | | | | | | The command reports information about the hash table internal state representing the specified database ID. This can be used in order to investigate rehashings, memory usage issues and for other debugging purposes.
* Merge pull request #2301 from mattsta/fix/lengthsSalvatore Sanfilippo2015-02-241-2/+2
|\ | | | | Improve type correctness
| * Improve RDB type correctnessMatt Stancliff2015-01-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's possible large objects could be larger than 'int', so let's upgrade all size counters to ssize_t. This also fixes rdbSaveObject serialized bytes calculation. Since entire serializations of data structures can be large, so we don't want to limit their calculated size to a 32 bit signed max. This commit increases object size calculation and cascades the change back up to serializedlength printing. Before: 127.0.0.1:6379> debug object hihihi ... encoding:quicklist serializedlength:-2147483559 ... After: 127.0.0.1:6379> debug object hihihi ... encoding:quicklist serializedlength:2147483737 ...
* | DEBUG structsizeantirez2015-01-231-0/+7
|/ | | | Show sizes of a few important data structures in Redis. More missing.
* Revert "Use REDIS_SUPERVISED_NONE instead of 0."antirez2015-01-121-2/+1
| | | | | | This reverts commit 2c925b0c302ad8612cc4ac6261549482d3c69846. Nevermind.
* Use REDIS_SUPERVISED_NONE instead of 0.antirez2015-01-121-1/+2
|
* Add more quicklist info to DEBUG OBJECTMatt Stancliff2015-01-021-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | Adds: ql_compressed (boolean, 1 if compression enabled for list, 0 otherwise) Adds: ql_uncompressed_size (actual uncompressed size of all quicklistNodes) Adds: ql_ziplist_max (quicklist max ziplist fill factor) Compression ratio of the list is then ql_uncompressed_size / serializedlength We report ql_uncompressed_size for all quicklists because serializedlength is a _compressed_ representation anyway. Sample output from a large list: 127.0.0.1:6379> llen abc (integer) 38370061 127.0.0.1:6379> debug object abc Value at:0x7ff97b51d140 refcount:1 encoding:quicklist serializedlength:19878335 lru:9718164 lru_seconds_idle:5 ql_nodes:21945 ql_avg_node:1748.46 ql_ziplist_max:-2 ql_compressed:0 ql_uncompressed_size:1643187761 (1.36s) The 1.36s result time is because rdbSavedObjectLen() is serializing the object, not because of any new stats reporting. If we run DEBUG OBJECT on a compressed list, DEBUG OBJECT takes almost *zero* time because rdbSavedObjectLen() reuses already-compressed ziplists: 127.0.0.1:6379> debug object abc Value at:0x7fe5c5800040 refcount:1 encoding:quicklist serializedlength:19878335 lru:9718109 lru_seconds_idle:5 ql_nodes:21945 ql_avg_node:1748.46 ql_ziplist_max:-2 ql_compressed:1 ql_uncompressed_size:1643187761
* Allow compression of interior quicklist nodesMatt Stancliff2015-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let user set how many nodes to *not* compress. We can specify a compression "depth" of how many nodes to leave uncompressed on each end of the quicklist. Depth 0 = disable compression. Depth 1 = only leave head/tail uncompressed. - (read as: "skip 1 node on each end of the list before compressing") Depth 2 = leave head, head->next, tail->prev, tail uncompressed. - ("skip 2 nodes on each end of the list before compressing") Depth 3 = Depth 2 + head->next->next + tail->prev->prev - ("skip 3 nodes...") etc. This also: - updates RDB storage to use native quicklist compression (if node is already compressed) instead of uncompressing, generating the RDB string, then re-compressing the quicklist node. - internalizes the "fill" parameter for the quicklist so we don't need to pass it to _every_ function. Now it's just a property of the list. - allows a runtime-configurable compression option, so we can expose a compresion parameter in the configuration file if people want to trade slight request-per-second performance for up to 90%+ memory savings in some situations. - updates the quicklist tests to do multiple passes: 200k+ tests now.
* Add quicklist info to DEBUG OBJECTMatt Stancliff2015-01-021-2/+14
| | | | | | | | | | | | | Added field 'ql_nodes' and 'ql_avg_per_node'. ql_nodes is the number of quicklist nodes in the quicklist. ql_avg_node is the average fill level in each quicklist node. (LLEN / QL_NODES) Sample output: 127.0.0.1:6379> DEBUG object b Value at:0x7fa42bf2fed0 refcount:1 encoding:quicklist serializedlength:18489 lru:8983768 lru_seconds_idle:3 ql_nodes:430 ql_avg_per_node:511.73 127.0.0.1:6379> llen b (integer) 220044
* Add DEBUG JEMALLOC INFOMatt Stancliff2014-12-231-0/+18
| | | | | Uses jemalloc function malloc_stats_print() to return stats about what jemalloc has allocated internally.
* Merge pull request #2134 from pyr/feature/supervised-initSalvatore Sanfilippo2014-12-111-1/+1
|\ | | | | Support daemon supervision by upstart or systemd
| * Support daemon supervision by upstart or systemdPierre-Yves Ritschard2014-11-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both upstart and systemd provide a way for daemons to be supervised, as well as a mechanism for them to signal their readyness status. This patch provides compatibility with this functionality while not interfering with other methods. With this, it will be possible to use `expect stop` with upstart and `Type=notify` with systemd. A more detailed explanation of the mechanism can be found here: http://spootnik.org/entries/2014/11/09_pid-tracking-in-modern-init-systems.html
* | Better read-only behavior for expired keys in slaves.antirez2014-12-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Slaves key expire is orchestrated by the master. Sometimes the master will send the synthesized DEL to expire keys on the slave with a non trivial delay (when the key is not accessed, only the incremental expiry algorithm will expire it in background). During that time, a key is logically expired, but slaves still return the key if you GET (or whatever) it. This is a bad behavior. However we can't simply trust the slave view of the key, since we need the master to be able to send write commands to update the slave data set, and DELs should only happen when the key is expired in the master in order to ensure consistency. However 99.99% of the issues with this behavior is when a client which is not a master sends a read only command. In this case we are safe and can consider the key as non existing. This commit does a few changes in order to make this sane: 1. lookupKeyRead() is modified in order to return NULL if the above conditions are met. 2. Calls to lookupKeyRead() in commands actually writing to the data set are repliaced with calls to lookupKeyWrite(). There are redundand checks, so for example, if in "2" something was overlooked, we should be still safe, since anyway, when the master writes the behavior is to don't care about what expireIfneeded() returns. This commit is related to #1768, #1770, #2131.
* | Fix DEBUG OBJECT lru field to report seconds.antirez2014-11-261-1/+1
|/ | | | | | | | Because of (not so) recent Redis changes, now the LRU internally reported unit is milliseconds, not seconds, but the DEBUG OBJECT output was still claiming seconds while providing milliseconds. However OBJECT IDLETIME was working as expected, which is the correct API to use.
* Fix DEBUG POPULATE warning for lack of casting.antirez2014-10-091-1/+1
|
* Add missing 'by'Matt Stancliff2014-09-291-1/+1
|
* DEBUG POPULATE two args form implemented.antirez2014-09-251-2/+4
| | | | | | | | | | | | | | | | | | | The old DEBUG POPULATE form for automatic creation of test keys is: DEBUG POPULATE <count> Now an additional form is available: DEBUG POPULATE <count> <prefix> When prefix is not specified, it defaults to "key", so the keys are named incrementally from key:0 to key:<count-1>. Otherwise the specified prefix is used instead of "key". The command is useful in order to populate different Redis instances with key names guaranteed to don't collide. There are other debugging uses, for example it is possible to add additional N keys using a count of N and a random prefix at every call.
* DEBUG CMDKEYS moved to COMMAND GETKEYS.antirez2014-06-271-18/+0
|
* Merge pull request #1743 from mattsta/cygwin-compile-fixSalvatore Sanfilippo2014-06-091-0/+6
|\ | | | | Cygwin compile fix
| * Fix lack of SA_ONSTACK under CygwinMatt Stancliff2014-05-121-0/+6
| | | | | | | | Fixes #232
* | Small typo fixedJan-Erik Rediger2014-05-281-1/+1
| |
* | Disable recursive watchdog signal handlerMatt Stancliff2014-05-261-1/+1
|/ | | | | | | | If we are in the signal handler, we don't want to handle the signal again. In extreme cases, this can cause a stack overflow and segfault Redis. Fixes #1771
* DEBUG POPULATE: call dictExpand() to avoid useless rehashing.antirez2014-05-091-0/+1
|
* CLIENT LIST speedup via peerid caching + smart allocation.antirez2014-04-281-1/+1
| | | | | | | | This commit adds peer ID caching in the client structure plus an API change and the use of sdsMakeRoomFor() in order to improve the reallocation pattern to generate the CLIENT LIST output. Both the changes account for a very significant speedup.