Commit Graph

7296 Commits

Author SHA1 Message Date
2db31fd4bb Few typo fixes 2018-07-30 18:00:32 +02:00
64242757d7 Add year in log.
User: "is there a reason why redis server logs  are missing the year in
the "date time"?"

Me: "I guess I did not imagine it would be stable enough to run for
several years".
2018-07-30 18:00:30 +02:00
50be4a1f5c Document dynamic-hz in the example redis.conf. 2018-07-30 18:00:27 +02:00
9a76472d71 Make dynamic hz actually configurable. 2018-07-30 18:00:24 +02:00
a330d06c82 Control dynamic HZ via server configuration. 2018-07-30 18:00:21 +02:00
d42602ffc8 Dynamic HZ: adapt cron frequency to number of clients. 2018-07-30 18:00:19 +02:00
7b5f0223f8 Dynamic HZ: separate hz from the configured hz.
This way we can remember what the user configured HZ is, but change the
actual HZ dynamically if needed in the dynamic HZ feature
implementation.
2018-07-30 18:00:16 +02:00
037b00dece Remove useless conditional from emptyDb().
Related to #4852.
2018-07-30 17:59:52 +02:00
0e97ae79b0 Make emptyDb() change introduced in #4852 simpler to read. 2018-07-30 17:59:49 +02:00
f7740fafbd optimize flushdb, avoid useless loops 2018-07-30 17:59:46 +02:00
0c00837669 Streams: fix xdel memory leak 2018-07-30 17:59:43 +02:00
dc600a25cd Example the magic +1 in migrateCommand().
Related to #5154.
2018-07-30 17:59:40 +02:00
d6827ab638 Make changes of PR #5154 hopefully simpler. 2018-07-30 17:59:37 +02:00
89ec14531b Do not migrate already expired keys. 2018-07-30 17:59:35 +02:00
cd25ed17b9 INFO CPU: higher precision of reported values
Closes: #5033
2018-07-25 21:50:24 +07:00
6bfb4745fa Streams: refactoring of next entry seek in the iterator.
After #5161 the code could be made a bit more obvious for newcomers.
2018-07-24 11:16:25 +02:00
4724548e07 Streams: skip master fileds only when we are going forward in streamIteratorGetID 2018-07-24 11:16:21 +02:00
4b79fdf1d6 fix slave buffer test suite false positives
it looks like on slow machines we're getting:
[err]: slave buffer are counted correctly in tests/unit/maxmemory.tcl
Expected condition '$slave_buf > 2*1024*1024' to be true (16914 > 2*1024*1024)

this is a result of the slave waking up too early and eating the
slave buffer before the traffic and the test ends.
2018-07-24 11:16:15 +02:00
a1e081f719 string2ll(): better commenting. 2018-07-24 11:16:11 +02:00
8b4fe752ec removing redundant check 2018-07-24 11:16:07 +02:00
9e5bf0471a Restore string2ll() to original version.
See PR #5157.
2018-07-24 11:16:05 +02:00
c2ecdcde98 fix recursion typo in zmalloc_usable 2018-07-24 11:16:00 +02:00
4f742bd6bf string2ll(): remove duplicated check for special case.
Related to #5157. The PR author correctly indentified that the check was
duplicated, but removing the second one introduces a bug that was fixed
in the past (hence the duplication). Instead we can remove the first
instance of the check without issues.
2018-07-24 11:15:57 +02:00
a4efac0067 string2ll(): test for NULL pointer in all the cases. 2018-07-24 11:15:54 +02:00
2c07c107cb Change 42 to 1000 as warning level for cached scripts.
Related to #4883.
2018-07-23 18:46:12 +02:00
270903d6b2 Adds Lua overheads to MEMORY STATS, smartens the MEMORY DOCTOR 2018-07-23 18:46:12 +02:00
faf3dbfcf9 Adds memory information about the script's cache to INFO
Implementation notes: as INFO is "already broken", I didn't want to break it further. Instead of computing the server.lua_script dict size on every call, I'm keeping a running sum of the body's length and dict overheads.

This implementation is naive as it **does not** take into consideration dict rehashing, but that inaccuracy pays off in speed ;)

Demo time:

```bash
$ redis-cli info memory | grep "script"
used_memory_scripts:96
used_memory_scripts_human:96B
number_of_cached_scripts:0
$ redis-cli eval "" 0 ; redis-cli info memory | grep "script"
(nil)
used_memory_scripts:120
used_memory_scripts_human:120B
number_of_cached_scripts:1
$ redis-cli script flush ; redis-cli info memory | grep "script"
OK
used_memory_scripts:96
used_memory_scripts_human:96B
number_of_cached_scripts:0
$ redis-cli eval "return('Hello, Script Cache :)')" 0 ; redis-cli info memory | grep "script"
"Hello, Script Cache :)"
used_memory_scripts:152
used_memory_scripts_human:152B
number_of_cached_scripts:1
$ redis-cli eval "return redis.sha1hex(\"return('Hello, Script Cache :)')\")" 0 ; redis-cli info memory | grep "script"
"1be72729d43da5114929c1260a749073732dc822"
used_memory_scripts:232
used_memory_scripts_human:232B
number_of_cached_scripts:2
✔ 19:03:54 redis [lua_scripts-in-info-memory L ✚…⚑] $ redis-cli evalsha 1be72729d43da5114929c1260a749073732dc822 0
"Hello, Script Cache :)"
```
2018-07-23 18:46:12 +02:00
49841a54db Fix merge errors.
For some reason I made a merge fiasco between 5.0 and unstable.
This fixes the error introduced by merging unstable.
2018-07-23 18:36:54 +02:00
77a7ec7200 Merge branch 'unstable' into 5.0 branch 2018-07-23 18:29:33 +02:00
4ff47a0b9b Top comment clientsCron(). 2018-07-20 09:46:18 +02:00
aba6855282 Clarify that clientsCronTrackExpansiveClients() indexes may jump ahead. 2018-07-20 09:36:48 +02:00
be88c0b16a Rename INFO CLIENT max buffers field names for correctness.
They are actually delayed a few seconds, so let's call them "recent".
2018-07-19 17:38:20 +02:00
0cf3794e6e Fix wrong array index variable in getExpansiveClientsInfo(). 2018-07-19 17:34:15 +02:00
ea3a20c5d0 Change INFO CLIENTS sections to report pre-computed max/min client buffers. 2018-07-19 17:16:19 +02:00
8f7e496ba5 Rename var in clientsCronTrackExpansiveClients() for clarity. 2018-07-19 13:59:13 +02:00
8d617596f1 Implement a function to retrieve the expansive clients mem usage. 2018-07-19 13:58:04 +02:00
85a1b4f807 clientsCronTrackExpansiveClients() actual implementation. 2018-07-19 13:54:20 +02:00
d4c5fc57db clientsCronTrackExpansiveClients() skeleton and ideas. 2018-07-19 13:49:00 +02:00
1c95c07596 Make vars used only by INFO CLIENTS local to the block.
Related to #4727.
2018-07-19 12:23:05 +02:00
16b8d364cc Merge pull request #4727 from kingpeterpaule/redis-fix-info-cli
move getClientsMaxBuffers func into  info clients command
2018-07-19 12:21:35 +02:00
0aca977c47 Merge branch 'unstable' of github.com:/antirez/redis into unstable 2018-07-18 17:41:37 +02:00
313b2240ae In addReplyErrorLength() only panic when replying to slave.
See #5135 for more context.
2018-07-18 17:41:16 +02:00
6183f0590d Refine comment in addReplyErrorLength() about replying to masters/slaves.
See #5135 for some context.
2018-07-18 17:40:07 +02:00
22e9321c3e Merge pull request #5138 from oranagra/improve_defrag_test
make active defrag test more stable
2018-07-18 11:05:03 +02:00
f89c93c8ad make active defrag test more stable
on slower machines, the active defrag test tended to fail.
although the fragmentation ratio was below the treshold, the defragger was
still in the middle of a scan cycle.

this commit changes:
- the defragger uses the current fragmentation state, rather than the cache one
  that is updated by server cron every 100ms. this actually fixes a bug of
  starting one excess scan cycle
- the test lets the defragger use more CPU cycles, in hope that the defrag
  will be faster, but also give it more time before we give up.
2018-07-18 10:16:33 +03:00
8213f64d64 Merge pull request #5122 from trevor211/allowWritesWhenAofDisabled
Accept write commands if persisting is disabled
2018-07-17 18:08:46 +02:00
46fd927800 Merge pull request #4237 from aspirewit/update-comment
Update the comment
2018-07-17 18:04:55 +02:00
6201f7b4e0 Streams: better error when $ is given with XREADGROUP. 2018-07-17 17:54:10 +02:00
4bff45c7a6 Merge pull request #5136 from 0xtonyxia/fix-xread-id-parse
Fix xreadgroup with '$' ID.
2018-07-17 17:50:31 +02:00
afc7e08a20 Panic when we are sending an error to our master/slave.
Related to #5135, see discussion there.
2018-07-17 17:42:30 +02:00