1. 23 Feb, 2020 1 commit
    • Oran Agra's avatar
      Fix latency sensitivity of new defrag test · 62adabd0
      Oran Agra authored
      I saw that the new defag test for list was failing in CI recently, so i
      reduce it's threshold from 12 to 60.
      
      besides that, i add / improve the latency test for that other two defrag
      tests (add a sensitive latency and digest / save checks)
      
      and fix bad usage of debug populate (can't overrides existing keys).
      this was the original intention, which creates higher fragmentation.
      62adabd0
  2. 19 Feb, 2020 1 commit
  3. 18 Feb, 2020 1 commit
    • Oran Agra's avatar
      Defrag big lists in portions to avoid latency and freeze · 485425ce
      Oran Agra authored
      When active defrag kicks in and finds a big list, it will create a bookmark to
      a node so that it is able to resume iteration from that node later.
      
      The quicklist manages that bookmark, and updates it in case that node is deleted.
      
      This will increase memory usage only on lists of over 1000 (see
      active-defrag-max-scan-fields) quicklist nodes (1000 ziplists, not 1000 items)
      by 16 bytes.
      
      In 32 bit build, this change reduces the maximum effective config of
      list-compress-depth and list-max-ziplist-size (from 32767 to 8191)
      485425ce
  4. 14 Feb, 2020 1 commit
  5. 04 Feb, 2020 3 commits
  6. 30 Jan, 2020 2 commits
    • Guy Benoish's avatar
      ld2string should fail if string contains \0 in the middle · 2deb5551
      Guy Benoish authored
      This bug affected RM_StringToLongDouble and HINCRBYFLOAT.
      I added tests for both cases.
      
      Main changes:
      1. Fixed string2ld to fail if string contains \0 in the middle
      2. Use string2ld in getLongDoubleFromObject - No point of
         having duplicated code here
      
      The two changes above broke RM_SaveLongDouble/RM_LoadLongDouble
      because the long double string was saved with length+1 (An innocent
      mistake, but it's actually a bug - The length passed to
      RM_SaveLongDouble should not include the last \0).
      2deb5551
    • antirez's avatar
      ACL LOG: implement a few basic tests. · b189a219
      antirez authored
      b189a219
  7. 30 Dec, 2019 2 commits
    • Guy Benoish's avatar
      Modules: Fix blocked-client-related memory leak · d7d13721
      Guy Benoish authored
      If a blocked module client times-out (or disconnects, unblocked
      by CLIENT command, etc.) we need to call moduleUnblockClient
      in order to free memory allocated by the module sub-system
      and blocked-client private data
      
      Other changes:
      Made blockedonkeys.tcl tests a bit more aggressive in order
      to smoke-out potential memory leaks
      d7d13721
    • Guy Benoish's avatar
      Blocking XREAD[GROUP] should always reply with valid data (or timeout) · a351e74f
      Guy Benoish authored
      This commit solves the following bug:
      127.0.0.1:6379> XGROUP CREATE x grp $ MKSTREAM
      OK
      127.0.0.1:6379> XADD x 666 f v
      "666-0"
      127.0.0.1:6379> XREADGROUP GROUP grp Alice BLOCK 0 STREAMS x >
      1) 1) "x"
         2) 1) 1) "666-0"
               2) 1) "f"
                  2) "v"
      127.0.0.1:6379> XADD x 667 f v
      "667-0"
      127.0.0.1:6379> XDEL x 667
      (integer) 1
      127.0.0.1:6379> XREADGROUP GROUP grp Alice BLOCK 0 STREAMS x >
      1) 1) "x"
         2) (empty array)
      
      The root cause is that we use s->last_id in streamCompareID
      while we should use the last *valid* ID
      a351e74f
  8. 26 Dec, 2019 2 commits
    • Oran Agra's avatar
      config.c adjust config limits and mutable · 0c3fe52e
      Oran Agra authored
      - make lua-replicate-commands mutable (it never was, but i don't see why)
      - make tcp-backlog immutable (fix a recent refactory mistake)
      - increase the max limit of a few configs to match what they were before
      the recent refactory
      0c3fe52e
    • Guy Benoish's avatar
      Stream: Handle streamID-related edge cases · 1f75ce30
      Guy Benoish authored
      This commit solves several edge cases that are related to
      exhausting the streamID limits: We should correctly calculate
      the succeeding streamID instead of blindly incrementing 'seq'
      This affects both XREAD and XADD.
      
      Other (unrelated) changes:
      Reply with a better error message when trying to add an entry
      to a stream that has exhausted last_id
      1f75ce30
  9. 18 Dec, 2019 2 commits
  10. 17 Dec, 2019 1 commit
  11. 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
  12. 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
  13. 20 Nov, 2019 1 commit
  14. 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
  15. 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
  16. 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
  17. 10 Nov, 2019 1 commit
    • 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
  18. 04 Nov, 2019 7 commits
  19. 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
  20. 29 Oct, 2019 1 commit
    • 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
  21. 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
  22. 24 Oct, 2019 3 commits
  23. 10 Oct, 2019 1 commit
  24. 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