1. 21 Jul, 2021 18 commits
    • Oran Agra's avatar
      Test infra, handle RESP3 attributes and big-numbers and bools (#9235) · 6cd84b64
      Oran Agra authored
      - promote the code in DEBUG PROTOCOL to addReplyBigNum
      - DEBUG PROTOCOL ATTRIB skips the attribute when client is RESP2
      - networking.c addReply for push and attributes generate assertion when
        called on a RESP2 client, anything else would produce a broken
        protocol that clients can't handle.
      
      (cherry picked from commit 6a5bac30)
      6cd84b64
    • Binbin's avatar
      hrandfield and zrandmember with count should return emptyarray when key does not exist. (#9178) · c6b3966d
      Binbin authored
      
      
      due to a copy-paste bug, it used to reply with null response rather than empty array.
      this commit includes new tests that are looking at the RESP response directly in
      order to be able to tell the difference between them.
      Co-authored-by: default avatarOran Agra <oran@redislabs.com>
      (cherry picked from commit a418a2d3)
      c6b3966d
    • Oran Agra's avatar
      Tests: add a way to read raw RESP protocol reponses (#9193) · 432e0566
      Oran Agra authored
      This makes it possible to distinguish between null response and an empty
      array (currently the tests infra translates both to an empty string/list)
      
      (cherry picked from commit 7103367a)
      432e0566
    • Mikhail Fesenko's avatar
      redis-cli --rdb: fix broken fsync/ftruncate for stdout (#9135) · bbb6c2fb
      Mikhail Fesenko authored
      
      
      A change in redis 6.2 caused redis-cli --rdb that's directed to stdout to fail because fsync fails.
      This commit avoids doing ftruncate (fails with a warning) and fsync (fails with an error) when the
      output file is `-`, and adds the missing documentation that `-` means stdout.
      Co-authored-by: default avatarOran Agra <oran@redislabs.com>
      Co-authored-by: default avatarWang Yuan <wangyuancode@163.com>
      (cherry picked from commit 74fe15b3)
      bbb6c2fb
    • Leibale Eidelman's avatar
      fix ZRANGESTORE - should return 0 when src points to an empty key (#9089) · 095a6e59
      Leibale Eidelman authored
      
      
      mistakenly it used to return an empty array rather than 0.
      Co-authored-by: default avatarOran Agra <oran@redislabs.com>
      (cherry picked from commit 95274f1f)
      095a6e59
    • guybe7's avatar
      Include sizeof(struct stream) in objectComputeSize (#9164) · 56020fd8
      guybe7 authored
      Affects MEMORY USAGE
      
      (cherry picked from commit 4434cebb)
      56020fd8
    • Binbin's avatar
      ZRANDMEMBER WITHSCORES with negative COUNT may return bad score (#9162) · 11235c0e
      Binbin authored
      Return a bad score when used with negative count (or count of 1), and non-ziplist encoded zset.
      Also add test to validate the return value and cover the issue.
      
      (cherry picked from commit 4bc5a832)
      11235c0e
    • Evan's avatar
      modules: Add newlen == 0 handling to RM_StringTruncate (#3717) (#3718) · 406caa5f
      Evan authored
      Previously, passing 0 for newlen would not truncate the string at all.
      This adds handling of this case, freeing the old string and creating a new empty string.
      
      Other changes:
      - Move `src/modules/testmodule.c` to `tests/modules/basics.c`
      - Introduce that basic test into the test suite
      - Add tests to cover StringTruncate
      - Add `test-modules` build target for the main makefile
      - Extend `distclean` build target to clean modules too
      
      (cherry picked from commit 1ccf2ca2)
      406caa5f
    • yvette903's avatar
      Fix coredump after Client Unpause command when threaded I/O is enabled (#9041) · 8bd5e391
      yvette903 authored
      Fix crash when using io-threads-do-reads and issuing CLIENT PAUSE and
      CLIENT UNPAUSE.
      This issue was introduced in redis 6.2 together with the FAILOVER command.
      
      (cherry picked from commit 096c5fd5)
      8bd5e391
    • guybe7's avatar
      Module API for current command name (#8792) · c547dff6
      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.
      
      (cherry picked from commit e16d3eb9)
      c547dff6
    • Huang Zhw's avatar
      Fix XTRIM or XADD with LIMIT may delete more entries than Count. (#9048) · e6df2f62
      Huang Zhw authored
      The decision to stop trimming due to LIMIT in XADD and XTRIM was after the limit was reached.
      i.e. the code was deleting **at least** that count of records (from the LIMIT argument's perspective, not the MAXLEN),
      instead of **up to** that count of records.
      see #9046
      
      (cherry picked from commit eaa7a7bb)
      e6df2f62
    • Huang Zhw's avatar
      XTRIM call streamParseAddOrTrimArgsOrReply use wrong arg xadd. (#9047) · 312ccae0
      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.
      
      (cherry picked from commit 91f3689b)
      312ccae0
    • YaacovHazan's avatar
      stabilize tests that involved with load handlers (#8967) · ff272176
      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
      
      (cherry picked from commit 32a2584e)
      ff272176
    • perryitay's avatar
      Fail EXEC command in case a watched key is expired (#9194) · 3f4f9b63
      perryitay authored
      
      
      There are two issues fixed in this commit: 
      1. we want to fail the EXEC command in case there is a watched key that's logically
         expired but not yet deleted by active expire or lazy expire.
      2. we saw that currently cache time is update in every `call()` (including nested calls),
         this time is being also being use for the isKeyExpired comparison, we want to update
         the cache time only in the first call (execCommand)
      Co-authored-by: default avatarOran Agra <oran@redislabs.com>
      (cherry picked from commit ac8b1df8)
      3f4f9b63
    • Huang Zhw's avatar
      Do not install a file event to send data to rewrite child when parent stop... · 5b8e3951
      Huang Zhw authored
      Do not install a file event to send data to rewrite child when parent stop sending diff to child in aof rewrite. (#8767)
      
      In aof rewrite, when parent stop sending data to child, if there is
      new rewrite data, aofChildWriteDiffData write event will be installed.
      Then this event is issued and deletes the file event without do anyting.
      This will happen over and over again until aof rewrite finish.
      
      This bug used to waste a few system calls per excessive wake-up
      (epoll_ctl and epoll_wait) per cycle, each cycle triggered by receiving
      a write command from a client.
      
      (cherry picked from commit cb961d8c)
      5b8e3951
    • Omer Shadmi's avatar
      Avoid exiting to allow diskless loading to recover from RDB short read on module AUX data (#9199) · 9914b676
      Omer Shadmi authored
      Currently a replica is able to recover from a short read (when diskless loading
      is enabled) and avoid crashing/exiting, replying to the master and then the rdb
      could be sent again by the master for another load attempt by the replica.
      There were a few scenarios that were not behaving similarly, such as when
      there is no end-of-file marker, or when module aux data failed to load, which
      should be allowed to occur due to a short read.
      
      (cherry picked from commit f06d782f)
      9914b676
    • Oran Agra's avatar
      Fix race in client side tracking (#9116) · abd44c83
      Oran Agra authored
      The `Tracking gets notification of expired keys` test in tracking.tcl
      used to hung in valgrind CI quite a lot.
      
      It turns out the reason is that with valgrind and a busy machine, the
      server cron active expire cycle could easily run in the same event loop
      as the command that created `mykey`, so that when they key got expired,
      there were two change events to broadcast, one that set the key and one
      that expired it, but since we used raxTryInsert, the client that was
      associated with the "last" change was the one that created the key, so
      the NOLOOP filtered that event.
      
      This commit adds a test that reproduces the problem by using lazy expire
      in a multi-exec which makes sure the key expires in the same event loop
      as the one that added it.
      
      (cherry picked from commit 9b564b52)
      abd44c83
    • Maxim Galushka's avatar
      redis-cli: support for REDIS_REPLY_SET in CSV and RAW output. (#7338) · f70916f8
      Maxim Galushka authored
      Fixes #6792. Added support of REDIS_REPLY_SET in raw and csv output of `./redis-cli`
      
      Test:
      
      run commands to test:
        ./redis-cli -3 --csv COMMAND
        ./redis-cli -3 --raw COMMAND
      
      Now they are returning resuts, were failing with: "Unknown reply type: 10" before the change.
      
      (cherry picked from commit 96bb0785)
      f70916f8
  2. 01 Jun, 2021 12 commits
  3. 03 May, 2021 10 commits