1. 24 Mar, 2021 5 commits
  2. 23 Mar, 2021 2 commits
  3. 22 Mar, 2021 7 commits
  4. 17 Mar, 2021 4 commits
    • Meir Shpilraien (Spielrein)'s avatar
      Fix script kill to work also on scripts that use pcall (#8661) · 9ae4f5c7
      Meir Shpilraien (Spielrein) authored
      pcall function runs another LUA function in protected mode, this means
      that any error will be caught by this function and will not stop the LUA
      execution. The script kill mechanism uses error to stop the running script.
      Scripts that uses pcall can catch the error raise by the script kill mechanism,
      this will cause a script like this to be unkillable:
      
      local f = function()
              while 1 do
                      redis.call('ping')
              end
      end
      while 1 do
              pcall(f)
      end
      
      The fix is, when we want to kill the script, we set the hook function to be invoked 
      after each line. This will promise that the execution will get another
      error before it is able to enter the pcall function again.
      9ae4f5c7
    • Theo Buehler's avatar
      Fixes for systems with 64-bit time (#8662) · 169be042
      Theo Buehler authored
      Some operating systems (e.g., NetBSD and OpenBSD) have switched to
      using a 64-bit integer for time_t on all platforms. This results in currently
      harmless compiler warnings due to potential truncation.
      These changes fix these minor portability concerns.
      
      * Fix format string for systems with 64 bit time
      * use llabs to avoid truncation with 64 bit time
      169be042
    • Wen Hui's avatar
      fix wrong comment for data_age unit (#8665) · 6097d14d
      Wen Hui authored
      fix typo
      6097d14d
    • Yossi Gottlieb's avatar
      Cleanup: remove dead code from anet. (#8660) · f657315e
      Yossi Gottlieb authored
      In the long term we may want to move away from anet completely and have
      everything implemented natively in connection.c, instead of having an
      extra layer.
      
      For now, just get rid of unused code.
      f657315e
  5. 16 Mar, 2021 9 commits
    • Huang Zhw's avatar
      When tests exit normally, some processes may still be alive (#8647) · a19c4058
      Huang Zhw authored
      In certain scenario start_server may think it failed to start a redis server
      although it started successfully. in these cases, it'll not terminate it, and
      it'll remain running when the test is over.
      
      In start_server if config doesn't have bind (the minimal.conf in introspection.tcl),
      it will try to bind ipv4 and ipv6. One may success while other fails. It will
      output "Could not create server TCP listening socket".
      wait_server_started uses this message to check whether instance started
      successfully. So it will consider that it failed even though redis started successfully.
      
      Additionally, in some cases it wasn't clear to users why the server exited,
      since the warning message printed to the log, could in some cases be harmless,
      and in some cases fatal.
      
      This PR adds makes a clear distinction between a warning log message and
      a fatal one, and changes the test suite to look for the fatal message.
      a19c4058
    • Saravjeet 'Aman' Singh's avatar
      Update README.md (#3543) · ec34806c
      Saravjeet 'Aman' Singh authored
      prettify
      ec34806c
    • Garen Chan's avatar
      f141329f
    • Ikko Ashimine's avatar
      Fix typo in t_stream.c (#8592) · 6da2bc96
      Ikko Ashimine authored
      arguements -> arguments
      6da2bc96
    • Meir Shpilraien (Spielrein)'s avatar
      Fix issue where error replies are not counted on stats (#8659) · 95360c2e
      Meir Shpilraien (Spielrein) authored
      lookupKeyReadOrReply and lookupKeyWriteOrReply might decide to reply to the user
      with the given robj reply. This reply might be an error reply and if so addReply
      function is used instead of addReplyErrorObject which will cause the error reply not
      to be counted on stats. The fix checks the first char in the reply and if its '-' (error)
      it uses addReplyErrorObject.
      95360c2e
    • Wen Hui's avatar
    • Oran Agra's avatar
      set module eviction context flag only in masters (#8631) · 40d555db
      Oran Agra authored
      REDISMODULE_CTX_FLAGS_EVICT and REDISMODULE_CTX_FLAGS_MAXMEMORY
      shouldn't be set when the module is run inside a replica that doesn't do eviction.
      
      one may argue that the database is under eviction (the master does eviction and sends DELs to the replica).
      but on the other hand, we don't really know the master's configuration.
      all that matters is if the current instance does evictions or not.
      40d555db
    • Yossi Gottlieb's avatar
      Server won't start on alpine/libmusl without IPv6. (#8655) · df5f543b
      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.
      df5f543b
    • Madelyn Olson's avatar
      Redact slowlog entries for config with sensitive data. (#8584) · e1d98bca
      Madelyn Olson authored
      Redact config set requirepass/masterauth/masteruser from slowlog in addition to showing ACL commands without sensitive values. 
      e1d98bca
  6. 15 Mar, 2021 1 commit
    • guybe7's avatar
      Missing EXEC on modules propagation after failed EVAL execution (#8654) · dba33a94
      guybe7 authored
      1. moduleReplicateMultiIfNeeded should use server.in_eval like
         moduleHandlePropagationAfterCommandCallback
      2. server.in_eval could have been set to 1 and not reset back
         to 0 (a lot of missed early-exits after in_eval is already 1)
      
      Note: The new assertions in processCommand cover (2) and I added
      two module tests to cover (1)
      
      Implications:
      If an EVAL that failed (and thus left server.in_eval=1) runs before a module
      command that replicates, the replication stream will contain MULTI (because
      moduleReplicateMultiIfNeeded used to check server.lua_caller which is NULL
      at this point) but not EXEC (because server.in_eval==1)
      This only affects modules as module.c the only user of server.in_eval.
      
      Affects versions 6.2.0, 6.2.1
      dba33a94
  7. 14 Mar, 2021 2 commits
    • Huang Zhw's avatar
      Fix typo and outdated comments. (#8640) · 84d056d0
      Huang Zhw authored
      84d056d0
    • Guillem Jover's avatar
      Send the readiness notification when we are ready to accept connections (#8409) · 3a5905fa
      Guillem Jover authored
      On a replica we do accept connections, even though commands accessing
      the database will operate in read-only mode. But the server is still
      already operational and processing commands.
      
      Not sending the readiness notification means that on a HA setup where
      the nodes all start as replicas (with replicaof in the config) with
      a replica that cannot connect to the master server and which might not
      come back in a predictable amount of time or at all, the service
      supervisor will end up timing out the service and terminating it, with
      no option to promote it to be the main instance. This seems counter to
      what the readiness notification is supposed to be signaling.
      
      Instead send the readiness notification when we start accepting
      commands, and then send the various server status changes as that.
      
      Fixes: commit 641c64ad
      Fixes: commit dfb598cf
      3a5905fa
  8. 12 Mar, 2021 1 commit
  9. 11 Mar, 2021 4 commits
  10. 10 Mar, 2021 5 commits
    • cheese1's avatar
      Changes http to https in texts (#8495) · c945e112
      cheese1 authored
      c945e112
    • guybe7's avatar
      Fix some issues with modules and MULTI/EXEC (#8617) · 3d0b427c
      guybe7 authored
      Bug 1:
      When a module ctx is freed moduleHandlePropagationAfterCommandCallback
      is called and handles propagation. We want to prevent it from propagating
      commands that were not replicated by the same context. Example:
      1. module1.foo does: RM_Replicate(cmd1); RM_Call(cmd2); RM_Replicate(cmd3)
      2. RM_Replicate(cmd1) propagates MULTI and adds cmd1 to also_propagagte
      3. RM_Call(cmd2) create a new ctx, calls call() and destroys the ctx.
      4. moduleHandlePropagationAfterCommandCallback is called, calling
         alsoPropagates EXEC (Note: EXEC is still not written to socket),
         setting server.in_trnsaction = 0
      5. RM_Replicate(cmd3) is called, propagagting yet another MULTI (now
         we have nested MULTI calls, which is no good) and then cmd3
      
      We must prevent RM_Call(cmd2) from resetting server.in_transaction.
      REDISMODULE_CTX_MULTI_EMITTED was revived for that purpose.
      
      Bug 2:
      Fix issues with nested RM_Call where some have '!' and some don't.
      Example:
      1. module1.foo does RM_Call of module2.bar without replication (i.e. no '!')
      2. module2.bar internally calls RM_Call of INCR with '!'
      3. at the end of module1.foo we call RM_ReplicateVerbatim
      
      We want the replica/AOF to see only module1.foo and not the INCR from module2.bar
      
      Introduced a global replication_allowed flag inside RM_Call to determine
      whether we need to replicate or not (even if '!' was specified)
      
      Other changes:
      Split beforePropagateMultiOrExec to beforePropagateMulti afterPropagateExec
      just for better readability
      3d0b427c
    • Itamar Haber's avatar
    • guybe7's avatar
      Cleanup ZADD_* flags (#8559) · 61a73de6
      guybe7 authored
      Have a clear separation between in and out flags
      
      Other changes:
      
      delete dead code in RM_ZsetIncrby: if zsetAdd returned error (happens only if
      the result of the operation is NAN or if score is NAN) we return immediately so
      there is no way that zsetAdd succeeded and returned NAN in the out-flags
      61a73de6
    • Oran Agra's avatar
      strip % sign from current_fork_perc info field (#8628) · 7778f1b4
      Oran Agra authored
      `master_sync_perc` and `loading_loaded_perc` don't have that sign,
      and i think the info field should be a raw floating point number (the name suggests its units).
      
      we already have `used_memory_peak_perc` and `used_memory_dataset_perc` which do add the `%` sign, but:
      1) i think it was a mistake but maybe too late to fix now, and maybe not too late to fix for `current_fork_perc`
      2) it is more important to be consistent with the two other "progress" "prec" metrics, and not with the "utilization" metric.
      7778f1b4