1. 17 Dec, 2019 3 commits
  2. 12 Dec, 2019 1 commit
    • Yossi Gottlieb's avatar
      Improve RM_ModuleTypeReplaceValue() API. · 0283db58
      Yossi Gottlieb authored
      With the previous API, a NULL return value was ambiguous and could
      represent either an old value of NULL or an error condition. The new API
      returns a status code and allows the old value to be returned
      by-reference.
      
      This commit also includes test coverage based on
      tests/modules/datatype.c which did not exist at the time of the original
      commit.
      0283db58
  3. 02 Dec, 2019 1 commit
  4. 01 Dec, 2019 1 commit
  5. 28 Nov, 2019 1 commit
    • Oran Agra's avatar
      Converting more configs to use generic infra, and moving defaults to config.c · 18e72c5c
      Oran Agra authored
      Changes in behavior:
      - Change server.stream_node_max_entries from int64_t to long long, so that it can be used by the generic infra
      - standard error reply instead of "repl-backlog-size must be 1 or greater" and such
      - tls-port and a few TLS booleans were readable (config get) even when USE_OPENSSL was off (now they aren't)
      - syslog-enabled, syslog-ident, cluster-enabled, appendfilename, and supervised didn't have a get (now they do)
      - pidfile was initialized to NULL in InitServerConfig but had CONFIG_DEFAULT_PID_FILE in rewriteConfig (so the real default was "", but rewrite would cause it to be set), fixed the rewrite.
      - TLS config in server.h was uninitialized (if no tls config args were provided)
      
      Adding test for sanity and coverage
      18e72c5c
  6. 20 Nov, 2019 1 commit
  7. 19 Nov, 2019 2 commits
    • Oran Agra's avatar
      try to fix an unstable test (module hook for loading progress) · ed226976
      Oran Agra authored
      there were two lssues, one is taht BGREWRITEAOF failed since the initial one was still in progress
      the solution for this one is to enable appendonly from the server startup so there's no initial aofrw.
      
      the other problem was 0 loading progress events, theory is that on some
      platforms a sleep of 1 will cause a much greater delay due to the context
      switch, but on other platform it doesn't. in theory a sleep of 100 micro
      for 1k keys whould take 100ms, and with hz of 500 we should be gettering
      50 events (one every 2ms). in practise it doesn't work like that, so trying
      to find a sleep that would be long enough but still not cause the test to take
      too long.
      ed226976
    • antirez's avatar
      Fix stream test after addition of 0-0 ID test. · 936e01e5
      antirez authored
      936e01e5
  8. 13 Nov, 2019 1 commit
    • Guy Benoish's avatar
      XADD with ID 0-0 stores an empty key · 4a12047c
      Guy Benoish authored
      Calling XADD with 0-0 or 0 would result in creating an
      empty key and storing it in the database.
      Even worse, because XADD will reply with error the action
      will not be replicated, creating a master-replica
      inconsistency
      4a12047c
  9. 11 Nov, 2019 2 commits
    • Oran Agra's avatar
      Add RM_ScanKey to scan hash, set, zset, changes to RM_Scan API · 0f8692b4
      Oran Agra authored
      - Adding RM_ScanKey
      - Adding tests for RM_ScanKey
      - Refactoring RM_Scan API
      
      Changes in RM_Scan
      - cleanup in docs and coding convention
      - Moving out of experimantal Api
      - Adding ctx to scan callback
      - Dont use cursor of -1 as an indication of done (can be a valid cursor)
      - Set errno when returning 0 for various reasons
      - Rename Cursor to ScanCursor
      - Test filters key that are not strings, and opens a key if NULL
      0f8692b4
    • meir@redislabs.com's avatar
      Added scan implementation to module api. · 11c6ce81
      meir@redislabs.com authored
      The implementation expose the following new functions:
      1. RedisModule_CursorCreate - allow to create a new cursor object for
      keys scanning
      2. RedisModule_CursorRestart - restart an existing cursor to restart the
      scan
      3. RedisModule_CursorDestroy - destroy an existing cursor
      4. RedisModule_Scan - scan keys
      
      The RedisModule_Scan function gets a cursor object, a callback and void*
      (used as user private data).
      The callback will be called for each key in the database proving the key
      name and the value as RedisModuleKey.
      11c6ce81
  10. 10 Nov, 2019 2 commits
    • Oran Agra's avatar
      rename RN_SetLRUOrLFU -> RM_SetLRU and RN_SetLFU · 28c20b4e
      Oran Agra authored
      - the API name was odd, separated to two apis one for LRU and one for LFU
      - the LRU idle time was in 1 second resolution, which might be ok for RDB
        and RESTORE, but i think modules may need higher resolution
      - adding tests for LFU and for handling maxmemory policy mismatch
      28c20b4e
    • Oran Agra's avatar
      fix leak in module api rdb test · 02f21113
      Oran Agra authored
      recently added more reads into that function, if a later read fails, i must
      either free what's already allocated, or return the pointer so that the free
      callback will release it.
      02f21113
  11. 04 Nov, 2019 8 commits
  12. 03 Nov, 2019 2 commits
    • Oran Agra's avatar
      Module API for loading and saving long double · 779aebc9
      Oran Agra authored
      looks like each platform implements long double differently (different bit count)
      so we can't save them as binary, and we also want to avoid creating a new RDB
      format version, so we save these are hex strings using "%La".
      
      This commit includes a change in the arguments of ld2string to support this.
      as well as tests for coverage and short reads.
      
      coded by @guybe7
      779aebc9
    • 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
  13. 29 Oct, 2019 2 commits
    • Oran Agra's avatar
      Modules hooks: complete missing hooks for the initial set of hooks · 51c3ff8d
      Oran Agra authored
      * replication hooks: role change, master link status, replica online/offline
      * persistence hooks: saving, loading, loading progress
      * misc hooks: cron loop, shutdown, module loaded/unloaded
      * change the way hooks test work, and add tests for all of the above
      
      startLoading() now gets flag indicating what is loaded.
      stopLoading() now gets an indication of success or failure.
      adding startSaving() and stopSaving() with similar args and role.
      51c3ff8d
    • Oran Agra's avatar
      test infra: improve prints on failed assertions · a0cfd519
      Oran Agra authored
      sometimes we have several assertions with the same condition in the same test
      at different stages, and when these fail (the ones that print the condition
      text) you don't know which one it was. other assertions didn't print the
      condition text (variable names), just the expected and unexpected values.
      
      So now, all assertions print context line, and conditin text.
      
      besides, one of the major differences between 'assert' and 'assert_equal',
      is that the later is able to print the value that doesn't match the expected.
      if there is a rare non-reproducible failure, it is helpful to know what was
      the value the test encountered and how far it was from the threshold.
      
      So now, adding assert_lessthan and assert_range that can be used in some places.
      were we used just 'assert { a > b }' so far.
      a0cfd519
  14. 28 Oct, 2019 1 commit
    • Oran Agra's avatar
      Module api tests for RM_Call · 0399b5a2
      Oran Agra authored
      Adding a test for coverage for RM_Call in a new "misc" unit
      to be used for various short simple tests
      
      also solves compilation warnings in redismodule.h and fork.c
      0399b5a2
  15. 24 Oct, 2019 4 commits
  16. 23 Oct, 2019 1 commit
  17. 10 Oct, 2019 1 commit
  18. 09 Oct, 2019 1 commit
  19. 08 Oct, 2019 1 commit
    • antirez's avatar
      Geo: output 10 chars of geohash, not 11. · 009862ab
      antirez authored
      This does not limit the actual precision, because the last digit bits were
      garbage, and the shift value became even negative in the last iteration.
      009862ab
  20. 07 Oct, 2019 4 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