1. 03 Nov, 2019 1 commit
    • Oran Agra's avatar
      Add module api for looking into INFO fields · 4d580438
      Oran Agra authored
      - Add RM_GetServerInfo and friends
      - Add auto memory for new opaque struct
      - Add tests for new APIs
      
      other minor fixes:
      - add const in various char pointers
      - requested_section in modulesCollectInfo was actually not sds but char*
      - extract new string2d out of getDoubleFromObject for code reuse
      
      Add module API for
      4d580438
  2. 28 Oct, 2019 1 commit
    • zhaozhao.zz's avatar
      Modules: make unloading module more safe · c74398e1
      zhaozhao.zz authored
      As we know if a module exports module-side data types,
      unload it is not allowed. This rule is the same with
      blocked clients in module, because we use background
      threads to implement module blocked clients, and it's
      not safe to unload a module if there are background
      threads running. So it's necessary to check if any
      blocked clients running in this module when unload it.
      
      Moreover, after that we can ensure that if no modules,
      then no module blocked clients even module unloaded.
      So, we can call moduleHandleBlockedClients only when
      we have installed modules.
      c74398e1
  3. 24 Oct, 2019 1 commit
  4. 15 Oct, 2019 1 commit
  5. 10 Oct, 2019 1 commit
    • antirez's avatar
      Cluster: fix memory leak of cached master. · 747be463
      antirez authored
      This is what happened:
      
      1. Instance starts, is a slave in the cluster configuration, but
      actually server.masterhost is not set, so technically the instance
      is acting like a master.
      
      2. loadDataFromDisk() calls replicationCacheMasterUsingMyself() even if
      the instance is a master, in the case it is logically a slave and the
      cluster is enabled. So now we have a cached master even if the instance
      is practically configured as a master (from the POV of
      server.masterhost value and so forth).
      
      3. clusterCron() sees that the instance requires to replicate from its
      master, because logically it is a slave, so it calls
      replicationSetMaster() that will in turn call
      replicationCacheMasterUsingMyself(): before this commit, this call would
      overwrite the old cached master, creating a memory leak.
      747be463
  6. 09 Oct, 2019 1 commit
  7. 07 Oct, 2019 5 commits
    • Yossi Gottlieb's avatar
      TLS: Configuration options. · 61733ded
      Yossi Gottlieb authored
      Add configuration options for TLS protocol versions, ciphers/cipher
      suites selection, etc.
      61733ded
    • Oran Agra's avatar
      TLS: Implement support for write barrier. · 6b629480
      Oran Agra authored
      6b629480
    • Oran Agra's avatar
      diskless replication rdb transfer uses pipe, and writes to sockets form the parent process. · 5a477946
      Oran Agra authored
      misc:
      - handle SSL_has_pending by iterating though these in beforeSleep, and setting timeout of 0 to aeProcessEvents
      - fix issue with epoll signaling EPOLLHUP and EPOLLERR only to the write handlers. (needed to detect the rdb pipe was closed)
      - add key-load-delay config for testing
      - trim connShutdown which is no longer needed
      - rioFdsetWrite -> rioFdWrite - simplified since there's no longer need to write to multiple FDs
      - don't detect rdb child exited (don't call wait3) until we detect the pipe is closed
      - Cleanup bad optimization from rio.c, add another one
      5a477946
    • Yossi Gottlieb's avatar
      TLS: Connections refactoring and TLS support. · b087dd1d
      Yossi Gottlieb authored
      * Introduce a connection abstraction layer for all socket operations and
      integrate it across the code base.
      * Provide an optional TLS connections implementation based on OpenSSL.
      * Pull a newer version of hiredis with TLS support.
      * Tests, redis-cli updates for TLS support.
      b087dd1d
    • Oran Agra's avatar
      fix issues found by a static analyzer · d1a005ab
      Oran Agra authored
      cluster.c - stack buffer memory alignment
          The pointer 'buf' is cast to a more strictly aligned pointer type
      evict.c - lazyfree_lazy_eviction, lazyfree_lazy_eviction always called
      defrag.c - bug in dead code
      server.c - casting was missing parenthesis
      rax.c - indentation / newline suggested an 'else if' was intended
      d1a005ab
  8. 02 Oct, 2019 2 commits
    • Oran Agra's avatar
      RED-31295 - redis: avoid race between dlopen and thread creation · 2e19b941
      Oran Agra authored
      It seeems that since I added the creation of the jemalloc thread redis
      sometimes fails to start with the following error:
      
      Inconsistency detected by ld.so: dl-tls.c: 493: _dl_allocate_tls_init: Assertion `listp->slotinfo[cnt].gen <= GL(dl_tls_generation)' failed!
      
      This seems to be due to a race bug in ld.so, in which TLS creation on the
      thread, collide with dlopen.
      
      Move the creation of BIO and jemalloc threads to after modules are loaded.
      
      plus small bugfix when trying to disable the jemalloc thread at runtime
      2e19b941
    • antirez's avatar
      Speedup INFO server section. · 758b39be
      antirez authored
      758b39be
  9. 30 Sep, 2019 2 commits
  10. 27 Sep, 2019 3 commits
  11. 26 Sep, 2019 1 commit
  12. 25 Sep, 2019 2 commits
  13. 23 Sep, 2019 1 commit
    • Mike A. Owens's avatar
      Seed SipHash with 128-bit key · 0a4d2bbd
      Mike A. Owens authored
      SipHash expects a 128-bit key, and we were indeed generating 128-bits,
      but restricting them to hex characters 0-9a-f, effectively giving us
      only 4 bits-per-byte of key material, and 64 bits overall.
      
      Now, we skip the hex conversion and supply 128 bits of unfiltered
      random data.
      0a4d2bbd
  14. 22 Sep, 2019 1 commit
  15. 18 Sep, 2019 1 commit
  16. 02 Sep, 2019 1 commit
  17. 25 Aug, 2019 1 commit
  18. 31 Jul, 2019 1 commit
  19. 24 Jul, 2019 2 commits
  20. 23 Jul, 2019 3 commits
  21. 22 Jul, 2019 1 commit
  22. 17 Jul, 2019 1 commit
    • Oran Agra's avatar
      Module API for Forking · 56258c6b
      Oran Agra authored
      * create module API for forking child processes.
      * refactor duplicate code around creating and tracking forks by AOF and RDB.
      * child processes listen to SIGUSR1 and dies exitFromChild in order to
        eliminate a valgrind warning of unhandled signal.
      * note that BGSAVE error reply has changed.
      
      valgrind error is:
        Process terminating with default action of signal 10 (SIGUSR1)
      56258c6b
  23. 10 Jul, 2019 1 commit
  24. 08 Jul, 2019 1 commit
    • Oran Agra's avatar
      diskless replication on slave side (don't store rdb to file), plus some other related fixes · 2de544cf
      Oran Agra authored
      The implementation of the diskless replication was currently diskless only on the master side.
      The slave side was still storing the received rdb file to the disk before loading it back in and parsing it.
      
      This commit adds two modes to load rdb directly from socket:
      1) when-empty
      2) using "swapdb"
      the third mode of using diskless slave by flushdb is risky and currently not included.
      
      other changes:
      --------------
      distinguish between aof configuration and state so that we can re-enable aof only when sync eventually
      succeeds (and not when exiting from readSyncBulkPayload after a failed attempt)
      also a CONFIG GET and INFO during rdb loading would have lied
      
      When loading rdb from the network, don't kill the server on short read (that can be a network error)
      
      Fix rdb check when performed on preamble AOF
      
      tests:
      run replication tests for diskless slave too
      make replication test a bit more aggressive
      Add test for diskless load swapdb
      2de544cf
  25. 03 Jul, 2019 1 commit
  26. 07 Jun, 2019 1 commit
  27. 02 Jun, 2019 1 commit
    • Oran Agra's avatar
      make redis purge jemalloc after flush, and enable background purging thread · 09f99c2a
      Oran Agra authored
      jemalloc 5 doesn't immediately release memory back to the OS, instead there's a decaying
      mechanism, which doesn't work when there's no traffic (no allocations).
      this is most evident if there's no traffic after flushdb, the RSS will remain high.
      
      1) enable jemalloc background purging
      2) explicitly purge in flushdb
      09f99c2a
  28. 06 May, 2019 1 commit