1. 10 Jun, 2021 1 commit
    • Binbin's avatar
      Fixed some typos, add a spell check ci and others minor fix (#8890) · 0bfccc55
      Binbin authored
      This PR adds a spell checker CI action that will fail future PRs if they introduce typos and spelling mistakes.
      This spell checker is based on blacklist of common spelling mistakes, so it will not catch everything,
      but at least it is also unlikely to cause false positives.
      
      Besides that, the PR also fixes many spelling mistakes and types, not all are a result of the spell checker we use.
      
      Here's a summary of other changes:
      1. Scanned the entire source code and fixes all sorts of typos and spelling mistakes (including missing or extra spaces).
      2. Outdated function / variable / argument names in comments
      3. Fix outdated keyspace masks error log when we check `config.notify-keyspace-events` in loadServerConfigFromString.
      4. Trim the white space at the end of line in `module.c`. Check: https://github.com/redis/redis/pull/7751
      5. Some outdated https link URLs.
      6. Fix some outdated comment. Such as:
          - In README: about the rdb, we used to said create a `thread`, change to `process`
          - dbRandomKey function coment (about the dictGetRandomKey, change to dictGetFairRandomKey)
          - notifyKeyspaceEvent fucntion comment (add type arg)
          - Some others minor fix in comment (Most of them are incorrectly quoted by variable names)
      7. Modified the error log so that users can easily distinguish between TCP and TLS in `changeBindAddr`
      0bfccc55
  2. 09 Jun, 2021 1 commit
    • Yossi Gottlieb's avatar
      Improve test suite to handle external servers better. (#9033) · 8a86bca5
      Yossi Gottlieb authored
      This commit revives the improves the ability to run the test suite against
      external servers, instead of launching and managing `redis-server` processes as
      part of the test fixture.
      
      This capability existed in the past, using the `--host` and `--port` options.
      However, it was quite limited and mostly useful when running a specific tests.
      Attempting to run larger chunks of the test suite experienced many issues:
      
      * Many tests depend on being able to start and control `redis-server` themselves,
      and there's no clear distinction between external server compatible and other
      tests.
      * Cluster mode is not supported (resulting with `CROSSSLOT` errors).
      
      This PR cleans up many things and makes it possible to run the entire test suite
      against an external server. It also provides more fine grained controls to
      handle cases where the external server supports a subset of the Redis commands,
      limited number of databases, cluster mode, etc.
      
      The tests directory now contains a `README.md` file that describes how this
      works.
      
      This commit also includes additional cleanups and fixes:
      
      * Tests can now be tagged.
      * Tag-based selection is now unified across `start_server`, `tags` and `test`.
      * More information is provided about skipped or ignored tests.
      * Repeated patterns in tests have been extracted to common procedures, both at a
        global level and on a per-test file basis.
      * Cleaned up some cases where test setup was based on a previous test executing
        (a major anti-pattern that repeats itself in many places).
      * Cleaned up some cases where test teardown was not part of a test (in the
        future we should have dedicated teardown code that executes even when tests
        fail).
      * Fixed some tests that were flaky running on external servers.
      8a86bca5
  3. 08 Jun, 2021 5 commits
    • Wang Yuan's avatar
      Mem efficiency, make full use of client struct memory for reply buffers (#8968) · c396fd91
      Wang Yuan authored
      When we allocate a client struct with 16k reply buffer, the allocator we may give us 20K,
      This commit makes use of that extra space.
      Additionally, it tries to store whatever it can from the reply into the static 'buf' before
      allocating a new node for the reply list.
      c396fd91
    • Yang Bodong's avatar
      Verbose log enhancement: print client info when client exit (#9053) · 119121c7
      Yang Bodong authored
      It could be useful for debugging to know which client got disconnected.
      119121c7
    • guybe7's avatar
      Module API for current command name (#8792) · e16d3eb9
      guybe7 authored
      sometimes you can be very deep in the call stack, without access to argv.
      once you're there you may want your reply/log to contain the command name.
      e16d3eb9
    • ikeberlein's avatar
      Make redis-cli grep friendly in pubsub mode (#9013) · 77d44bb7
      ikeberlein authored
      redis-cli is grep friendly for all commands but SUBSCRIBE/PSUBSCRIBE.
      it is unable to process output from these commands line by line piped
      to another program because of output buffering. to overcome this
      situation I propose to flush stdout each time when it is written with
      reply from these commands the same way it is already done for all other
      commands.
      77d44bb7
    • Huang Zhw's avatar
      Fix some minor bugs in redis-cli (#8982) · 1df8c129
      Huang Zhw authored
      * clusterManagerAddSlots check argv_idx error.
      
      * clusterManagerLoadInfoFromNode remove unused param opts.
      
      * redis-cli node->ip may be an sds or a c string. Using %s to format
      is always right, %S may be wrong.
      
      * In clusterManagerFixOpenSlot clusterManagerBumpEpoch call is redundant,
      because it is already called in clusterManagerSetSlotOwner.
      
      * redis-cli cluster help add more commands in help messages.
      1df8c129
  4. 07 Jun, 2021 4 commits
  5. 06 Jun, 2021 3 commits
    • Oran Agra's avatar
      tests: prevent name clash in variables leading to wrong test name (#8995) · 3e39ea0b
      Oran Agra authored
      running the "geo" unit would have shown that it completed a unit named
      "north". this was because the variable `$name` was overwritten.
      This commit isn't perfect, but it slightly reduces the chance for
      variable name clash.
      
      ```
      $ ./runtest --single unit/geo
      .......
      Testing unit/geo
      .......
      [1/1 done]: north (15 seconds)
      ```
      3e39ea0b
    • Huang Zhw's avatar
      XTRIM call streamParseAddOrTrimArgsOrReply use wrong arg xadd. (#9047) · 91f3689b
      Huang Zhw authored
      xtrimCommand call streamParseAddOrTrimArgsOrReply should use xadd==0.
      
      When the syntax is valid, it does not cause any bugs because the params of XADD is superset of XTRIM.
      Just XTRIM will not respond with error on invalid syntax. The syntax of XADD will also be accpeted by XTRIM.
      91f3689b
    • Binbin's avatar
      Add missing zuiClearIterator in zrandmemberWithCountCommand. (#8979) · bb671d90
      Binbin authored
      Also the bug that currently does not cause memory leaks.
      Because op->type = OBJ_ZSET, in zuiClearIterator, we will do nothing.
      Just a cleanup that zuiInitIterator and zuiClearIterator should appear in pairs.
      bb671d90
  6. 04 Jun, 2021 1 commit
  7. 03 Jun, 2021 2 commits
  8. 02 Jun, 2021 2 commits
  9. 01 Jun, 2021 6 commits
  10. 30 May, 2021 3 commits
    • Binbin's avatar
      Extend freeSlotsToKeysMapAsync and freeTrackingRadixTreeAsync to check LAZYFREE_THRESHOLD. (#8969) · 01495c67
      Binbin authored
      Without this fix, FLUSHALL ASYNC would have freed these in a background thread,
      even if they didn't contain many elements (unlike how it works with other structures), which could be inefficient.
      01495c67
    • Wang Yuan's avatar
      Make full use of aofrwblock's buf (#8975) · 58a03eca
      Wang Yuan authored
      Make aof rewrite buffer memory size more accurate, before, there may be 20%
      deviation with its real memory usage.
      
      The implication are both lower memory usage, and also a more accurate INFO.
      58a03eca
    • ny0312's avatar
      Always replicate time-to-live(TTL) as absolute timestamps in milliseconds (#8474) · 53d1acd5
      ny0312 authored
      Till now, on replica full-sync we used to transfer absolute time for TTL,
      however when a command arrived (EXPIRE or EXPIREAT),
      we used to propagate it as is to replicas (possibly with relative time),
      but always translate it to EXPIREAT (absolute time) to AOF.
      
      This commit changes that and will always use absolute time for propagation.
      see discussion in #8433
      
      Furthermore, we Introduce new commands: `EXPIRETIME/PEXPIRETIME`
      that allow extracting the absolute TTL time from a key.
      53d1acd5
  11. 26 May, 2021 1 commit
    • YaacovHazan's avatar
      unregister AE_READABLE from the read pipe in backgroundSaveDoneHandlerSocket (#8991) · 501d7755
      YaacovHazan authored
      In diskless replication, we create a read pipe for the RDB, between the child and the parent.
      When we close this pipe (fd), the read handler also needs to be removed from the event loop (if it still registered).
      Otherwise, next time we will use the same fd, the registration will be fail (panic), because
      we will use EPOLL_CTL_MOD (the fd still register in the event loop), on fd that already removed from epoll_ctl
      501d7755
  12. 24 May, 2021 1 commit
  13. 23 May, 2021 1 commit
  14. 22 May, 2021 1 commit
  15. 20 May, 2021 3 commits
    • YaacovHazan's avatar
      stabilize tests that involved with load handlers (#8967) · 32a2584e
      YaacovHazan authored
      When test stop 'load handler' by killing the process that generating the load,
      some commands that already in the input buffer, still might be processed by the server.
      This may cause some instability in tests, that count on that no more commands
      processed after we stop the `load handler'
      
      In this commit, new proc 'wait_load_handlers_disconnected' added, to verify that no more
      cammands from any 'load handler' prossesed, by checking that the clients who
      genreate the load is disconnceted.
      
      Also, replacing check of dbsize with wait_for_ofs_sync before comparing debug digest, as
      it would fail in case the last key the workload wrote was an overridden key (not a new one).
      
      Affected tests
      Race fix:
      - failover command to specific replica works
      - Connect multiple replicas at the same time (issue #141), master diskless=$mdl, replica diskless=$sdl
      - AOF rewrite during write load: RDB preamble=$rdbpre
      
      Cleanup and speedup:
      - Test replication with blocking lists and sorted sets operations
      - Test replication with parallel clients writing in different DBs
      - Test replication partial resync: $descr (diskless: $mdl, $sdl, reconnect: $reconnect
      32a2584e
    • Wang Yuan's avatar
      Make aof buf alloc size more accurate in overhead (#8970) · 8627751e
      Wang Yuan authored
      
      
      In theory we should have used zmalloc_usable_size, but it may be slower,
      and now after #7875, there's no actual difference.
      So this change isn't making a dramatic change.
      Co-authored-by: default avatarOran Agra <oran@redislabs.com>
      8627751e
    • Wang Yuan's avatar
      Make full use of replication backlog memory (#8966) · 0b2d0be3
      Wang Yuan authored
      According jemalloc size classes, we may allocate much more memory
      than our setting of repl_backlog_size, but we don't make full use of it.
      0b2d0be3
  16. 19 May, 2021 5 commits