1. 16 Apr, 2021 1 commit
  2. 15 Apr, 2021 4 commits
  3. 14 Apr, 2021 2 commits
  4. 13 Apr, 2021 8 commits
    • Viktor Söderqvist's avatar
      Modules API docs: Sections and links (#8442) · d7920ff9
      Viktor Söderqvist authored
      * Modules API docs: Link API function names to their definitions
      
      Occurrences of API functions are linked to their definition.
      
      A function index with links to all functions is added on the bottom
      of the page.
      
      Comment blocks in module.c starting with a markdown h2 heading are
      used as sections. A table of contents is generated from these
      headings.
      
      The functions names are changed from h2 to h3, since they are now
      rendered as sub-headings within each section.
      
      Existing sections in module.c are used with some minor changes.
      Some documentation text is added or sligtly modified.
      
      The markdown renderer will add IDs which may clash with our
      generated IDs. By prefixing section IDs with "section-" we make
      them different.
      
      Replace double dashes with a unicode long ndash
      d7920ff9
    • Huang Zhw's avatar
    • Viktor Söderqvist's avatar
      Small doc fix for stream module API (#8757) · 4938052f
      Viktor Söderqvist authored
      In a code example, using RedisModule_FreeString instead of
      RedisModule_Free makes it behave correctly regardless of whether
      automatic memory is used or not.
      4938052f
    • Oran Agra's avatar
      Revert "Fix: server will crash if rdbload or rdbsave method is not provided in... · b278e443
      Oran Agra authored
      Revert "Fix: server will crash if rdbload or rdbsave method is not provided in module (#8670)" (#8771)
      
      This reverts commit 808f3004.
      b278e443
    • Oran Agra's avatar
      c07e16fa
    • Wen Hui's avatar
      38da8d07
    • Oran Agra's avatar
      fix access to uninitialized var in checkClientPauseTimeoutAndReturnIfPaused (#8765) · 733daef1
      Oran Agra authored
      server.client_pause_end_time is uninitialized, or actually 0, at startup,
      which means this method would think the timeout was reached
      and go look for paused clients.
      
      This causes no harm since unpauseClients will not find any paused clients.
      733daef1
    • Oran Agra's avatar
      Fix busy loop in ae.c when timer event is about to fire (#8764) · 175a9e31
      Oran Agra authored
      The code used to decide on the next time to wake on a timer with
      microsecond accuracy, but when deciding to go to sleep it used
      milliseconds accuracy (with truncation), this means that it would wake
      up too early, see that there's no timer to process, and go to sleep
      again for 0ms again and again until the right microsecond arrived.
      
      i.e. a timer for 100ms, would sleep for 99ms, but then do a busy loop
      through the kernel in the last millisecond, triggering many calls to
      beforeSleep.
      
      The fix is to change all the logic in ae.c to work with microseconds,
      which is good since most of the ae backends support micro (or even nano)
      seconds. however the epoll backend, doesn't support micro, so to avoid
      this problem it needs to round upwards, rather than truncate.
      
      Issue created by the monotonic timer PR #7644 (redis 6.2)
      Before that, all the timers in ae.c were in milliseconds (using
      mstime), so when it requested the backend to sleep till the next timer
      event, it would have worked ok.
      175a9e31
  5. 12 Apr, 2021 1 commit
    • Yossi Gottlieb's avatar
      Fix failing cluster tests. (#8763) · 5e3a15ae
      Yossi Gottlieb authored
      Disable replica migration to avoid a race condition where the
      migrated-from node turns into a replica.
      
      Long term, this test should probably be improved to handle multiple
      slots and accept such auto migrations but this is a quick fix to
      stabilize the CI without completely dropping this test.
      5e3a15ae
  6. 11 Apr, 2021 1 commit
    • Wang Yuan's avatar
      Fix wrong check for aof fsync and handle aof fsync errno (#8751) · a0e19e3c
      Wang Yuan authored
      The bio aof fsync fd may be closed by main thread (AOFRW done handler)
      and even possibly reused for another socket, pipe, or file.
      This can can an EBADF or EINVAL fsync error, which will lead to -MISCONF errors failing all writes.
      We just ignore these errno because aof fsync did not really fail.
      
      We handle errno when fsyncing aof in bio, so we could know the real reason
      when users get -MISCONF Errors writing to the AOF file error
      
      Issue created with #8419
      a0e19e3c
  7. 10 Apr, 2021 1 commit
  8. 07 Apr, 2021 2 commits
  9. 06 Apr, 2021 4 commits
  10. 05 Apr, 2021 2 commits
    • Huang Zhw's avatar
      Fix "default" and overwritten / reset users will not have pubsub channels... · 3b74b550
      Huang Zhw authored
      Fix "default" and overwritten / reset users will not have pubsub channels permissions by default. (#8723)
      
      Background:
      Redis 6.2 added ACL control for pubsub channels (#7993), which were supposed
      to be permissive by default to retain compatibility with redis 6.0 ACL. 
      But due to a bug, only newly created users got this `acl-pubsub-default` applied,
      while overwritten (updated) users got reset to `resetchannels` (denied).
      
      Since the "default" user exists before loading the config file,
      any ACL change to it, results in an update / overwrite.
      
      So when a "default" user is loaded from config file or include ACL
      file with no channels related rules, the user will not have any
      permissions to any channels. But other users will have default
      permissions to any channels.
      
      When upgraded from 6.0 with config rewrite, this will lead to
      "default" user channels permissions lost.
      When users are loaded from include file, then call "acl load", users
      will also lost channels permissions.
      
      Similarly, the `reset` ACL rule, would have reset the user to be denied
      access to any channels, ignoring `acl-pubsub-default` and breaking
      compatibility with redis 6.0.
      
      The implication of this fix is that it regains compatibility with redis 6.0,
      but breaks compatibility with redis 6.2.0 and 2.0.1. e.g. after the upgrade,
      the default user will regain access to pubsub channels.
      
      Other changes:
      Additionally this commit rename server.acl_pubusub_default to
      server.acl_pubsub_default and fix typo in acl tests.
      3b74b550
    • Huang Zhw's avatar
      redis-cli --bigkeys / memkeys, report detailed error on dbsize failure (#8740) · a3da3e59
      Huang Zhw authored
      When DBSIZE failed (e.g. on AUTH error), the printed error didn't reflect the reason.
      a3da3e59
  11. 04 Apr, 2021 1 commit
    • Sokolov Yura's avatar
      Add cluster-allow-replica-migration option. (#5285) · 1cab9620
      Sokolov Yura authored
      
      
      Previously (and by default after commit) when master loose its last slot
      (due to migration, for example), its replicas will migrate to new last slot
      holder.
      
      There are cases where this is not desired:
      * Consolidation that results with removed nodes (including the replica, eventually).
      * Manually configured cluster topologies, which the admin wishes to preserve.
      
      Needlessly migrating a replica triggers a full synchronization and can have a negative impact, so
      we prefer to be able to avoid it where possible.
      
      This commit adds 'cluster-allow-replica-migration' configuration option that is
      enabled by default to preserve existed behavior. When disabled, replicas will
      not be auto-migrated.
      
      Fixes #4896
      Co-authored-by: default avatarOran Agra <oran@redislabs.com>
      1cab9620
  12. 01 Apr, 2021 8 commits
    • Wang Yuan's avatar
      Handle remaining fsync errors (#8419) · 1eb85249
      Wang Yuan authored
      In `aof.c`, we call fsync when stop aof, and now print a log to let user know that if fail.
      In `cluster.c`, we now return error, the calling function already handles these write errors.
      In `redis-cli.c`, users hope to save rdb, we now print a message if fsync failed.
      In `rio.c`, we now treat fsync errors like we do for write errors. 
      In `server.c`, we try to fsync aof file when shutdown redis, we only can print one log if fail.
      In `bio.c`, if failing to fsync aof file, we will set `aof_bio_fsync_status` to error , and reject writing just like last writing aof error,  moreover also set INFO command field `aof_last_write_status` to error.
      1eb85249
    • Valentino Geron's avatar
      Fix XAUTOCLAIM response to return the next available id as the cursor (#8725) · 44d8b039
      Valentino Geron authored
      This command used to return the last scanned entry id as the cursor,
      instead of the next one to be scanned.
      so in the next call, the user could / should have sent `(cursor` and not
      just `cursor` if he wanted to avoid scanning the same record twice.
      
      Scanning the record twice would look odd if someone is checking what
      exactly was scanned, but it also has a side effect of incrementing the
      delivery count twice.
      44d8b039
    • Oran Agra's avatar
      Solve sentinel test issue in TLS due to recent tests change. (#8728) · 370ab4c4
      Oran Agra authored
      5629dbe7 added a change that configures the tcp (plaintext) port
      alongside the tls port, this causes the INFO command for tcp_port
      to return that instead of the tls port when running in tls, and that broke
      the sentinel tests that query it.
      
      the fix is to add a method that gets the right port from CONFIG instead
      of relying on the tcp_port info field.
      370ab4c4
    • guybe7's avatar
      zsetAdd: Fix wrong reply in case of INCR and GT/LT (#8717) · 843f769b
      guybe7 authored
      If GT/LT fails the operation we need to reply with
      nill (like failure due to NX).
      
      Other changes:
      Add the missing $encoding suffix to many zset tests
      
      Note: there's a behavior change just in case of INCR + GT/LT that fails.
      The old code was replying with the wrong (rejected) score, and now it'll reply with nil.
      
      Note that that's anyway a corner case so this "behavior change" shouldn't have too much affect.
      Using GT/LT with INCR has a predictable result even before we run the command
      (INCR GT will only only / always fail if the increment is negative).
      843f769b
    • Wen Hui's avatar
      generalize config file check for sentinel (#8730) · d5935bb0
      Wen Hui authored
      The implications of this change is just that in the past when a config file was missing,
      in some cases it was exiting before printing the sever startup prints and sometimes after,
      and now it'll always exit before printing them.
      d5935bb0
    • wuYin's avatar
      reuse existing range comparators in the zset (#8714) · e5d50b23
      wuYin authored
      There are 2 common range comparators for skiplist: zslValueGteMin and
      zslValueLteMax, but they're not being reused in zslDeleteRangeByScore
      
      This is a small change to make code cleaner.
      e5d50b23
    • Dvir Volk's avatar
      Added macros for RM_log logging levels (#4246) · 07f39ae4
      Dvir Volk authored
       Added macros for RM_log logging levels, to avoid typos and the need
      to memorize the level strings by heart
      07f39ae4
    • sundb's avatar
      Use chi-square for random distributivity verification in test (#8709) · 569a3f45
      sundb authored
      Problem:
      Currently, when performing random distribution verification, we determine
      the probability of each element occurring in the sum, but the probability is
      only an estimate, these tests had rare sporadic failures, and we cannot verify
      what the probability of failure will be.
      
      Solution:
      Using the chi-square distribution instead of the original random distribution
      validation makes the test more reasonable and easier to find problems.
      569a3f45
  13. 31 Mar, 2021 2 commits
  14. 30 Mar, 2021 3 commits
    • guybe7's avatar
      XAUTOCLAIM: JUSTID should prevent incrementing delivery_count (#8724) · 2c120af6
      guybe7 authored
      To align with XCLAIM and the XAUTOCLAIM docs
      2c120af6
    • Jérôme Loyet's avatar
      Add replica-announced config option (#8653) · 91f4f416
      Jérôme Loyet authored
      The 'sentinel replicas <master>' command will ignore replicas with
      `replica-announced` set to no.
      
      The goal of disabling the config setting replica-announced is to allow ghost
      replicas. The replica is in the cluster, synchronize with its master, can be
      promoted to master and is not exposed to sentinel clients. This way, it is
      acting as a live backup or living ghost.
      
      In addition, to prevent the replica to be promoted as master, set
      replica-priority to 0.
      91f4f416
    • Yossi Gottlieb's avatar
      Cluster migration test cleanup. (#8726) · 6a052af8
      Yossi Gottlieb authored
      * Dump more output on error (always, cluster tests currently have no
      verbose flag).
      * Slow down redis-cli check iteration.
      6a052af8