1. 03 May, 2021 4 commits
    • Madelyn Olson's avatar
      Skip unecessary check for pong recieved (#8585) · 8bcca06c
      Madelyn Olson authored
      
      (cherry picked from commit 98d2e001)
      8bcca06c
    • Oran Agra's avatar
      Fix crash report killed by message (#8683) · aae2d6e3
      Oran Agra authored
      We sometimes see the crash report saying we were killed by a random
      process even in cases where the crash was spontanius in redis.
      for instance, crashes found by the corrupt-dump test.
      
      It looks like this si_pid is sometimes left uninitialized, and a good
      way to tell if the crash originated in redis or trigged by outside is to
      look at si_code, real signal codes are always > 0, and ones generated by
      kill are have si_code of 0 or below.
      
      (cherry picked from commit b45b0d81)
      aae2d6e3
    • Yossi Gottlieb's avatar
      Server won't start on alpine/libmusl without IPv6. (#8655) · 94694010
      Yossi Gottlieb authored
      listenToPort attempts to gracefully handle and ignore certain errors but does not store errno prior to logging, which in turn calls several libc functions that may overwrite errno.
      
      This has been discovered due to libmusl strftime() always returning with errno set to EINVAL, which resulted with docker-library/redis#273.
      
      (cherry picked from commit df5f543b)
      94694010
    • guybe7's avatar
      Fix edge-case when a module client is unblocked (#8618) · 1b03a0d7
      guybe7 authored
      Scenario:
      1. A module client is blocked on keys with a timeout
      2. Shortly before the timeout expires, the key is being populated and signaled
         as ready
      3. Redis calls moduleTryServeClientBlockedOnKey (which replies to client) and
         then moduleUnblockClient
      4. moduleUnblockClient doesn't really unblock the client, it writes to
         server.module_blocked_pipe and only marks the BC as unblocked.
      5. beforeSleep kics in, by this time the client still exists and techincally
         timed-out. beforeSleep replies to the timeout client (double reply) and
         only then moduleHandleBlockedClients is called, reading from module_blocked_pipe
         and calling unblockClient
      
      The solution is similar to what was done in moduleTryServeClientBlockedOnKey: we
      should avoid re-processing an already-unblocked client
      
      (cherry picked from commit e58118cd)
      1b03a0d7
  2. 02 Mar, 2021 4 commits
  3. 22 Feb, 2021 12 commits
    • Oran Agra's avatar
      Redis 6.0.11 · 91ffe99e
      Oran Agra authored
      91ffe99e
    • Yossi Gottlieb's avatar
      Fix integer overflow (CVE-2021-21309). (#8522) · c9928576
      Yossi Gottlieb authored
      On 32-bit systems, setting the proto-max-bulk-len config parameter to a high value may result with integer overflow and a subsequent heap overflow when parsing an input bulk (CVE-2021-21309).
      
      This fix has two parts:
      
      Set a reasonable limit to the config parameter.
      Add additional checks to prevent the problem in other potential but unknown code paths.
      
      (cherry picked from commit d32f2e99)
      c9928576
    • Oran Agra's avatar
      Update CI on Ubuntu to tcl8.6 (since 20.04 is now used) (#8460) · 4bba84f0
      Oran Agra authored
      Github started shifting some repositoreis to use ubuntu 20.04 by default
      tcl8.5 is missing in these, but 8.6 exists in both 20.04 and 18.04
      
      (cherry picked from commit 018f7b73)
      4bba84f0
    • Viktor Söderqvist's avatar
      RM_ZsetRem: Delete key if empty (#8453) · 17c3ac89
      Viktor Söderqvist authored
      Without this fix, RM_ZsetRem can leave empty sorted sets which are
      not allowed to exist.
      
      Removing from a sorted set while iterating seems to work (while
      inserting causes failed assetions). RM_ZsetRangeEndReached is
      modified to return 1 if the key doesn't exist, to terminate
      iteration when the last element has been removed.
      
      (cherry picked from commit aea6e71e)
      17c3ac89
    • Greg Femec's avatar
      Fix random element selection for large hash tables. (#8133) · cde69883
      Greg Femec authored
      
      
      When a database on a 64 bit build grows past 2^31 keys, the underlying hash table expands to 2^32 buckets. After this point, the algorithms for selecting random elements only return elements from half of the available buckets because they use random() which has a range of 0 to 2^31 - 1. This causes problems for eviction policies which use dictGetSomeKeys or dictGetRandomKey. Over time they cause the hash table to become unbalanced because, while new keys are spread out evenly across all buckets, evictions come from only half of the available buckets. Eventually this half of the table starts to run out of keys and it takes longer and longer to find candidates for eviction. This continues until no more evictions can happen.
      
      This solution addresses this by using a 64 bit PRNG instead of libc random().
      Co-authored-by: default avatarGreg Femec <gfemec@google.com>
      (cherry picked from commit 266949c7)
      cde69883
    • Huang Zw's avatar
      Client tracking tracking-redir-broken push len is 2 not 3 (#8456) · e6a94aa5
      Huang Zw authored
      When redis responds with tracking-redir-broken push message (RESP3),
      it was responding with a broken protocol: an array of 3 elements, but only
      pushes 2 elements.
      
      (cherry picked from commit f687ac0c)
      e6a94aa5
    • filipe oliveira's avatar
      redis-benchmark: Fix broken protocol when used with -a or --dbnum (#8486) · 840b393c
      filipe oliveira authored
      Fix the pointers to the slot hash tags in the case of prefixed commands usage
      i.e. AUTH / SELECT
      
      It adjusts the pointers to the slot hash tags in the case of prefixed commands
      usage as soon as we get the 1st reply (same like we already did for the random
      strings within the command )
      
      (cherry picked from commit efccd635)
      840b393c
    • zhaozhao.zz's avatar
      XINFO should use lookupKeyReadOrReply (#8436) · 56ef0aa7
      zhaozhao.zz authored
      This bug would have let users observe logically expired keys on replicas and
      during CLIENT PAUSE WRITE.
      
      (cherry picked from commit f2a5fe36)
      56ef0aa7
    • Yossi Gottlieb's avatar
      Avoid assertions when testing arm64 cow bug. (#8405) · dcf409f8
      Yossi Gottlieb authored
      At least in one case the arm64 cow kernel bug test triggers an assert, which is a problem because it cannot be ignored like cases where the bug is found.
      
      On older systems (Linux <4.5) madvise fails because MADV_FREE is not supported. We treat these failures as an indication the system is not affected.
      
      Fixes #8351, #8406
      
      (cherry picked from commit 3a504904)
      dcf409f8
    • Yossi Gottlieb's avatar
      CONFIG REWRITE should honor umask settings. (#8371) · 1237cce6
      Yossi Gottlieb authored
      Fixes a regression introduced due to a new (safer) way of rewriting configuration files. In the past the file was simply overwritten (same inode), but now Redis creates a new temporary file and later renames it over the old one.
      
      The temp file typically gets created with 0600 permissions so we later fchmod it to fix that. Unlike open with O_CREAT, fchmod doesn't consider umask so we have to do that explicitly.
      
      Fixes #8369
      
      (cherry picked from commit b548ffab)
      1237cce6
    • guybe7's avatar
      Fix firstkey,lastkey,step in COMMAND command for some commands (#8367) · d182820f
      guybe7 authored
      The output for COMMAND command was wrong for some commands.
      clients can use firstkey,lastkey,step to find (some) key name arguments, and the
      "movablekeys" flag to know that they can't know all (or any) of the key name arguments.
      
      These commands had the wrong output:
      1. GEORADIUS*_RO used to have "movablekeys" (which it doesn't really need)
      2. XREAD and XREADGROUP used to have (1,1,1). but that's completely wrong.
      3. Z*STORE used to have (0,0,0) but it can at lest give the index of the dstkey (1,1,1)
      
      (cherry picked from commit baf92f3f)
      d182820f
    • Madelyn Olson's avatar
      Remove race condition and consistency issues with client pause and threaded IO (#8520) · 0c653428
      Madelyn Olson authored
      clientsArePaused isn't thread safe because it has a side effect of attempting to unpause,
      which may cause multiple threads concurrently updating the unblocked_clients global list.
      This change resolves this issue by no longer postponing client for threaded reads when
      clients are paused and then skipping the check for client paused for threaded reads,
      in case one is postponed and then clients are paused. (I don't think this is strictly possible,
      but being defensive seems better here)
      0c653428
  4. 12 Jan, 2021 20 commits