Compare commits

..
3102 Commits
Author SHA1 Message Date
Malavan Sotheeswaran c6ab8d9f30 remove unnecessary forward declaration 2022-12-09 14:43:52 -08:00
Yossi Gottlieb 68890e6d16 Fix OpenSSL 3.0.x related issues. (#10291)
* Drop obsolete initialization calls.
* Use decoder API for DH parameters.
* Enable auto DH parameters if not explicitly used, which should be the
  preferred configuration going forward.
2022-12-09 13:47:08 -08:00
Paul Chen fad2e877cf rocksdb log using up the diskspace on flash (#519) 2022-12-07 15:13:43 -05:00
Paul Chen 496bc38fda use debug for logging the message instead 2022-11-18 16:17:16 -05:00
Paul Chen 560d8a839c trigger repl_curr_off!= master_repl_offset assert failure when having pending write case 2022-11-18 16:17:16 -05:00
Paul ChenandPaul Chen e8a85cf56d [BUG] Moves key to another DB, the source key was removed if the move failed due to the key exists in the destination db #497 (#498)
Co-authored-by: Paul Chen <mingchen@Mings-MacBook-Pro.local>
2022-10-20 15:34:29 -07:00
John Sully c1be69f272 Remove unneeded gitlab CI file 2022-09-29 22:25:27 +00:00
John Sully ecdefe1529 Merge pull request #112 from Snapchat/MAKE_FLASH_CONFIGURABLE
Make flash configurable
2022-09-29 17:59:45 -04:00
John Sully c16db92d3e Make building flash optional 2022-09-29 21:27:15 +00:00
John Sully 98b40f7729 Remove incorrect assert that fires when the repl backlog is used fully 2022-09-29 19:07:02 +00:00
John Sully 441cbddb9b Merge remote-tracking branch 'public/main' into OSS_RELEASE_SEP29_2022 2022-09-29 18:54:02 +00:00
John Sully 9fd2bf29ab Fix O(n) algorithm in INFO command 2022-09-29 18:44:44 +00:00
John Sully 5556382a18 Merge pull request #69 from Snapchat/vsaini_psync_test_augment
Verify that partial syncs occur in psync2-reg-multimaster
2022-09-29 14:08:19 -04:00
Vivek Saini 72901934de Verify that partial syncs do indeed occur 2022-09-29 17:51:34 +00:00
John Sully e8b0d6e796 Merge pull request #111 from Snapchat/test_reliability
Improve reliability of machamp tests
2022-09-29 13:50:15 -04:00
John Sully 17131697dd Improve reliability of fragmentation tests 2022-09-29 16:51:38 +00:00
John Sully f980bf7531 Improve reliability of async parts of the soft shutdown tests 2022-09-28 21:05:42 +00:00
John Sully c318c5ef14 Workaround bug in snapshot sync - abort don't crash 2022-09-28 19:00:26 +00:00
John Sully f0db60776b Fix Issue #486 2022-09-14 14:48:28 +00:00
Ilya Shipitsin ea3dbde4d9 src\redis-cli.c: fix potential null pointer dereference found by cppcheck
src\redis-cli.c:5488:35: warning: Either the condition
'!table' is redundant or there is possible null pointer dereference:
table. [nullPointerRedundantCheck]
2022-09-14 10:03:08 -04:00
root 4d3d713e42 avoid from instatiating EpochHolder multiple times to improve performance and cpu utilization 2022-09-14 10:02:02 -04:00
root 5bdc65eb15 avoid from instatiating EpochHolder multiple times to improve performance and cpu utilization 2022-09-14 10:02:02 -04:00
Karthick Ariyaratnam (A) 97d0728850 Remove old assertion which is commented out. 2022-09-14 10:01:21 -04:00
Karthick Ariyaratnam (A) 0e7e05483a Fixes a crash where the server assertion failed when the key exists in DB during RDB load 2022-09-14 10:01:21 -04:00
John Sully 9fb0ce4b3b Prevent crash on load in long running KeyDB instances 2022-09-01 15:26:26 +00:00
John Sully b4ca390069 Fix race removing key cache 2022-09-01 15:16:27 +00:00
John Sully 05423f3196 Merge pull request #99 from Snapchat/atlas_fixes
Atlas fixes
2022-08-29 21:22:52 -04:00
John Sully dde698ce73 Fix P99 latency issue for TLS where we leave work for the next event loop
tlsProcessPendingData() needs to be called before we execute queued commands because it may enqueue more commands
2022-08-26 18:05:00 +00:00
John Sully 2a3e0f7cbf Fix integer overflow of the track changes counter 2022-08-26 17:36:23 +00:00
John Sully e6aa2b3067 Merge pull request #96 from Snapchat/repl_asan_fixes
Repl asan fixes
2022-08-23 13:39:25 -04:00
John Sully 36921bae6a Additional fixes 2022-08-23 17:33:14 +00:00
John Sully a1a7a48fea Fix ASAN use after free 2022-08-23 06:37:26 +00:00
John Sully b1ddacb49b Merge pull request #92 from Snapchat/fix_sync_cancel_race
Fix a race when undoConnectWithMaster changes mi->repl_transfer_s but…
2022-08-22 13:35:29 -04:00
John Sully 749e9eaa35 Merge pull request #93 from Snapchat/fix_race_trackchanges
Fix a race in processChanges/trackChanges with rdbLoadRio by acquirin…
2022-08-22 13:35:10 -04:00
John Sully 1be9f0c585 Fix a race in processChanges/trackChanges with rdbLoadRio by acquiring the lock when trackChanges is set 2022-08-22 03:37:32 +00:00
John Sully b8e948e77c Fix a race when undoConnectWithMaster changes mi->repl_transfer_s but the connection is not yet closed and the event handler runs 2022-08-21 22:35:08 +00:00
Malavan Sotheeswaran 2eca7a740f Merge pull request #87 from Snapchat/fix_ftracking_bug
Check tracking on every db in rdbLoadRio
2022-08-17 15:33:09 -04:00
Malavan Sotheeswaran adc03a3b0d fix warnings 2022-08-17 10:31:30 -07:00
Malavan Sotheeswaran cbabf82873 check tracking per db 2022-08-17 09:50:16 -07:00
John Sully 162515d19b Fix crash running INFO command while a disk based backlog is set 2022-08-01 04:53:56 +00:00
John Sully ebc8d63e97 Fix issue #480 2022-08-01 03:14:09 +00:00
John Sully 982323eb54 Merge pull request #78 from Snapchat/cert_leak_fix
Fix certificate leak during connection when tls-allowlists are used
2022-07-14 12:37:53 -04:00
John Sully 0c3734a46e Fix certificate leak during connection when tls-allowlists are used 2022-07-14 04:36:51 +00:00
John Sully 4c5f81fe76 Do not allow commands to run in background when in eval, Issue #452 2022-07-06 04:26:13 +00:00
John Sully c7625f6d32 Fix issue #454 (BSD build break) 2022-07-06 04:04:47 +00:00
guybe7 c58f26fbbc lpGetInteger returns int64_t, avoid overflow (#10068)
Fix #9410

Crucial for the ms and sequence deltas, but I changed all
calls, just in case (e.g. "flags")

Before this commit:
`ms_delta` and `seq_delta` could have overflown, causing `currid` to be wrong,
which in turn would cause `streamTrim` to trim the entire rax node (see new test)
2022-07-06 03:44:24 +00:00
benschermel f261c4844f Merge pull request #438 from Snapchat/update_pkg
Packaging Updates
2022-06-06 22:38:28 -04:00
benschermel 4ed430dcc6 Merge pull request #443 from Snapchat/update_gem_ref
update gem reference
2022-06-06 22:35:11 -04:00
benschermel 0d43a857de update gem reference 2022-06-06 14:55:24 -04:00
John Sully a2a980c079 Merge branch 'main' into keydbpro 2022-06-05 19:33:49 +00:00
John Sully 46b2d22356 Merge pull request #72 from Snapchat/soft_shutdown
Implements the soft shutdown feature
2022-05-25 15:13:54 -04:00
benschermel 79e97ee31e update deb pkg references and changelog 2022-05-25 01:10:56 -04:00
benschermel d0718889c0 update dockerfiles 2022-05-25 01:08:24 -04:00
John Sully d207bc6612 Ensure clean shutdown with multiple threads 2022-05-24 05:10:18 +00:00
John Sully fef21b9c04 Implements the soft shutdown feature to allow clients to cooperatively disconnect preventing disruption during shutdown 2022-05-24 03:04:57 +00:00
John Sully 0073d8d6c6 Merge pull request #71 from Snapchat/oss_merge_back
Merge OSS back into pro
2022-05-23 23:02:13 -04:00
John Sully 54571108f5 Revert ci.yml to unstable branch version 2022-05-23 14:56:45 -04:00
John Sully f3b8bc74fb On Alpine we must have a reasonable stack size 2022-05-20 16:40:20 -04:00
John Sully 519ce3f7f2 Fix crash in expire when a snapshot is in flight. Caused by a perf optimization getting the expire map out of sync with the val 2022-05-20 13:07:26 -04:00
John Sully afc685aff8 Fix O(n^2) algorithm in the GC cleanup logic 2022-05-19 21:46:55 -04:00
John Sully d5d5eddbd6 Fix unmerged files 2022-05-18 01:36:48 +00:00
John Sully fb7aacec46 Merge OSS back into pro 2022-05-18 01:29:15 +00:00
John Sully 2784bd4430 Fix TSAN warnings on the repl backlog 2022-05-17 15:37:22 -04:00
John Sully ef3091db92 Disable async commands by default 2022-05-17 15:37:22 -04:00
John Sully aaa9f061b8 Silence TSAN errors on ustime and mstime. Every CPU we support is atomic on aligned ints, but correctness matters 2022-05-17 15:37:22 -04:00
John Sully b4aa94a12d Add fence barriers for the repl backlog (important for AARCH64 and other weak memory models) 2022-05-17 15:37:22 -04:00
John Sully 0f79207e72 Dictionary use correct acquire/release semantics 2022-05-17 15:37:22 -04:00
John Sully 30514dbe3c Avoid unnecessary rehashing when a rehash is abandoned 2022-05-17 15:37:22 -04:00
John Sully 357591fa8f Prevent us from starting a rehash when one wasn't already in progress. This can cause severe issues for snapshots 2022-05-17 15:37:22 -04:00
John Sully 2a66d6a57e Initialize noshrink, it was dangling 2022-05-17 15:37:22 -04:00
John Sully 121a4370f3 Prevent crash on shutdown by avoiding dtors (they are unnecessary anyways) 2022-05-17 15:37:22 -04:00
John Sully a7b8f4c82b Fix assertion in async rehash 2022-05-17 15:37:22 -04:00
John Sully d1163de3c0 Fix reference counting failure in the dict. This is caused by std::swap also swapping refcounts 2022-05-17 15:37:22 -04:00
jfinity bb249ccabd Fix Readme typo from github org transition
Replace mention of scratch-file-path with db-s3-object
2022-05-12 16:55:14 -04:00
John Sully ec143055b8 Update license 2022-05-12 13:27:46 -04:00
benschermel e3a4c2dcaa update deb master changelog 2022-05-12 13:27:46 -04:00
John Sully 3a52505eca Delete COPYING to replace with BSD license 2022-05-12 13:16:59 -04:00
John Sully c830365ee5 Limit max overage to 20% during RDB save 2022-05-10 18:30:12 +00:00
John Sully 9626ddc655 Merge pull request #70 from Snapchat/update_readme
Update readme & remove Enterprise references
2022-05-10 14:26:36 -04:00
benschermel faa81c9da2 remove Enterprise references 2022-05-10 12:58:59 -04:00
benschermel e5fde00ab7 update readme 2022-05-10 11:30:00 -04:00
benschermel 7d417315f7 update readme 2022-05-10 11:21:55 -04:00
John Sully ad3e9f2b0e Remove unnecessary libs 2022-05-06 17:34:14 +00:00
John Sully 73020fc8a2 Fix musl/Alpine build failures 2022-05-06 17:05:04 +00:00
John Sully 29e0c9321a Fix crash in save of masterinfo 2022-05-06 16:29:27 +00:00
John Sully a9454db457 Disable FLASH 2022-05-06 01:20:06 +00:00
John Sully f25549f4e0 Disable async for hget commands as it is not ready 2022-05-05 20:50:44 +00:00
John Sully d7e1228cbb Merge pull request #68 from Snapchat/psync_mm_fixes
Fix PSYNC test crashes
2022-05-05 10:32:18 -04:00
John Sully 5449202bad Merge pull request #68 from Snapchat/psync_mm_fixes
Fix PSYNC test crashes
2022-05-05 10:32:18 -04:00
John Sully 93fdf0f6b0 Ensure we force moves not copies when ingesting bulk insert files 2022-05-04 16:51:48 +00:00
John Sully 33432efb52 Ensure we force moves not copies when ingesting bulk insert files 2022-05-04 16:51:48 +00:00
John Sully a2f3682e87 Fix PSYNC test crashes 2022-05-04 01:37:40 +00:00
John Sully dec9fac5fa Fix PSYNC test crashes 2022-05-04 01:37:40 +00:00
John Sully f01ba7369f Merge pull request #67 from Snapchat/vsaini_psync_test_additions
Quick fix to make psync tests work
2022-05-02 23:11:56 -04:00
John Sully 3b1b42292f Merge pull request #67 from Snapchat/vsaini_psync_test_additions
Quick fix to make psync tests work
2022-05-02 23:11:56 -04:00
Vivek Saini e3e52fcffd Quick fix to make psync tests work 2022-05-03 00:41:30 +00:00
Vivek Saini b7837feca7 Quick fix to make psync tests work 2022-05-03 00:41:30 +00:00
John Sully 4a9cf5579a Merge pull request #66 from Snapchat/psync_multimaster_fixes
Psync multimaster fixes
2022-05-02 20:24:28 -04:00
John Sully aa141f95ba Merge pull request #66 from Snapchat/psync_multimaster_fixes
Psync multimaster fixes
2022-05-02 20:24:28 -04:00
John Sully 533465c87e active-rep test reliability 2022-05-03 00:02:22 +00:00
John Sully 3348d8107a active-rep test reliability 2022-05-03 00:02:22 +00:00
John Sully e22e1ddf31 Merge branch 'keydbpro' into psync_multimaster_fixes 2022-05-02 22:19:22 +00:00
John Sully 1ed35a2da8 Merge branch 'keydbpro' into psync_multimaster_fixes 2022-05-02 22:19:22 +00:00
John Sully 630741ed99 Merge branch 'psync_multimaster_fixes' of https://github.sc-corp.net/Snapchat/keydb-internal into psync_multimaster_fixes 2022-05-02 22:17:26 +00:00
John Sully 28a31a8396 Merge branch 'psync_multimaster_fixes' of https://github.sc-corp.net/Snapchat/keydb-internal into psync_multimaster_fixes 2022-05-02 22:17:26 +00:00
John Sully 6044c88375 Merge branch 'keydbpro' of https://github.sc-corp.net/Snapchat/keydb-internal into keydbpro 2022-05-02 22:14:31 +00:00
John Sully 4bbd77e699 Merge branch 'keydbpro' of https://github.sc-corp.net/Snapchat/keydb-internal into keydbpro 2022-05-02 22:14:31 +00:00
Vivek Saini 6f95eae64b Merge pull request #60 from Snapchat/merge_os_apr_13
Merge in changes from Open Source.

For the most part, this encompasses two changes:

- Adding partial sync capabilities to multi-master
- Adding ReadWrite locks to prevent global lock issues when forking threads, specifically with regards to the time thread.
2022-05-02 13:26:21 -04:00
Vivek Saini a247fec487 Merge pull request #60 from Snapchat/merge_os_apr_13
Merge in changes from Open Source.

For the most part, this encompasses two changes:

- Adding partial sync capabilities to multi-master
- Adding ReadWrite locks to prevent global lock issues when forking threads, specifically with regards to the time thread.
2022-05-02 13:26:21 -04:00
Vivek Saini c406d884f3 Updated test replica configs so tests make sense 2022-04-28 21:58:35 +00:00
Vivek Saini 7b13942a6e Updated test replica configs so tests make sense 2022-04-28 21:58:35 +00:00
Vivek Saini 94d802c562 Cleanup test suite 2022-04-28 21:36:01 +00:00
Vivek Saini 86cfcf706a Cleanup test suite 2022-04-28 21:36:01 +00:00
Vivek Saini 3cdaef854f Inclusive language fix 2022-04-28 21:34:10 +00:00
Vivek Saini 842471c9bb Inclusive language fix 2022-04-28 21:34:10 +00:00
Vivek Saini 626c4cccf0 Converted some existing PSYNC tests for multimaster 2022-04-28 21:30:40 +00:00
Vivek Saini 0abb3e04f2 Converted some existing PSYNC tests for multimaster 2022-04-28 21:30:40 +00:00
John Sully a09e5b2e25 Ensure recreated tables use the same settings as ones made at boot 2022-04-27 23:38:55 +00:00
John Sully 096fe49cf4 Ensure recreated tables use the same settings as ones made at boot 2022-04-27 23:38:55 +00:00
John Sully 2c51b0e91b Ensure we are responsive during storagecache clears 2022-04-27 17:32:40 +00:00
John Sully 9d16c6bc52 Ensure we are responsive during storagecache clears 2022-04-27 17:32:40 +00:00
John Sully 802dc7b169 Merge branch 'keydbpro' of https://github.sc-corp.net/Snapchat/keydb-internal into keydbpro 2022-04-27 17:00:35 +00:00
John Sully 1d57900256 Merge branch 'keydbpro' of https://github.sc-corp.net/Snapchat/keydb-internal into keydbpro 2022-04-27 17:00:35 +00:00
Zhaozhen Liang 322e49c5ad Merge pull request #64 from Snapchat/setup-machamp-ci
setup Machamp ci
2022-04-26 16:35:39 -06:00
Zhaozhen Liang 62b426e0a5 Merge pull request #64 from Snapchat/setup-machamp-ci
setup Machamp ci
2022-04-26 16:35:39 -06:00
John Sully 930b375309 PSYNC production fixes 2022-04-26 02:07:28 +00:00
John Sully 2e144ab922 PSYNC production fixes 2022-04-26 02:07:28 +00:00
John Sully 7d123fd150 Merge branch 'merge_os_apr_13' of https://github.sc-corp.net/Snapchat/keydb-internal into merge_os_apr_13 2022-04-26 02:06:43 +00:00
John Sully 3f1b415331 Merge branch 'merge_os_apr_13' of https://github.sc-corp.net/Snapchat/keydb-internal into merge_os_apr_13 2022-04-26 02:06:43 +00:00
John Sully 7c7a1cca91 acceptTLS is threadsafe like the non TLS version 2022-04-26 01:55:22 +00:00
John Sully 9e0832f899 acceptTLS is threadsafe like the non TLS version 2022-04-26 01:55:22 +00:00
John Sully 1025e876f3 With TLS throttle accepts if server is under heavy load - do not change non TLS behavior 2022-04-26 01:55:22 +00:00
John Sully 0ba0362721 With TLS throttle accepts if server is under heavy load - do not change non TLS behavior 2022-04-26 01:55:22 +00:00
John Sully d864e299b3 Make active client balancing a configurable option 2022-04-26 01:55:22 +00:00
John Sully 764a140e18 Make active client balancing a configurable option 2022-04-26 01:55:22 +00:00
Vivek Saini 51aefbb677 Removed mergeReplicationId 2022-04-26 01:55:22 +00:00
Vivek Saini 717770a725 Removed mergeReplicationId 2022-04-26 01:55:22 +00:00
Vivek Saini 65c0375e30 call aeThreadOnline() earlier 2022-04-26 01:55:22 +00:00
Vivek Saini 01fe56bbc1 call aeThreadOnline() earlier 2022-04-26 01:55:22 +00:00
Vivek Saini cebf0fcf64 Inclusive language 2022-04-26 01:55:22 +00:00
Vivek Saini 06c1f62d8e Inclusive language 2022-04-26 01:55:22 +00:00
Vivek Saini 1864c0a2cd Remove asserts, RW lock can go below zero in cases of aeAcquireLock 2022-04-26 01:55:22 +00:00
Vivek Saini 5538829e88 Remove asserts, RW lock can go below zero in cases of aeAcquireLock 2022-04-26 01:55:22 +00:00
Vivek Saini ccfdb2251d placement new instead of memcpy 2022-04-26 01:55:22 +00:00
Vivek Saini 9dbd3391c4 placement new instead of memcpy 2022-04-26 01:55:22 +00:00
Christian Legge d18477c9e3 Save and restore master info in rdb to allow active replica partial sync (#371)
* save replid for all masters in rdb

* expanded rdbSaveInfo to hold multiple master structs

* parse repl-masters from rdb

* recover replid info from rdb in active replica mode, attempt partial sync

* save offset from rdb into correct variable

* don't change replid based on master in active rep

* save and load psync info from correct fields
2022-04-26 01:55:22 +00:00
Christian Legge 631c63884c Save and restore master info in rdb to allow active replica partial sync (#371)
* save replid for all masters in rdb

* expanded rdbSaveInfo to hold multiple master structs

* parse repl-masters from rdb

* recover replid info from rdb in active replica mode, attempt partial sync

* save offset from rdb into correct variable

* don't change replid based on master in active rep

* save and load psync info from correct fields
2022-04-26 01:55:22 +00:00
Vivek Saini f98e4b7113 Defensive asserts for RWLock 2022-04-26 01:55:22 +00:00
Vivek Saini d248a6951a Defensive asserts for RWLock 2022-04-26 01:55:22 +00:00
Vivek Saini 42f38bb523 Integrate readwritelock with Pro Code 2022-04-26 01:55:22 +00:00
Vivek Saini 31698786e4 Integrate readwritelock with Pro Code 2022-04-26 01:55:22 +00:00
Malavan Sotheeswaran 97d7ace586 use atomic_load for g_pserver->mstime 2022-04-26 01:55:22 +00:00
Malavan Sotheeswaran ba8ba9abb0 use atomic_load for g_pserver->mstime 2022-04-26 01:55:22 +00:00
Malavan Sotheeswaran f8eb88d920 need to include stdint for uintptr_t 2022-04-26 01:55:22 +00:00
Malavan Sotheeswaran c7a67586f2 need to include stdint for uintptr_t 2022-04-26 01:55:22 +00:00
Malavan Sotheeswaran 3d651c02bf cannot mod a pointer 2022-04-26 01:55:22 +00:00
Malavan Sotheeswaran 2bb9071095 cannot mod a pointer 2022-04-26 01:55:22 +00:00
Malavan Sotheeswaran 7ff10e3058 remove nullptr subtraction 2022-04-26 01:55:22 +00:00
Malavan Sotheeswaran 1acec5c60a remove nullptr subtraction 2022-04-26 01:55:22 +00:00
Malavan Sotheeswaran 0c306d9dcb check ziplist len to avoid crash on empty ziplist convert 2022-04-26 01:55:22 +00:00
Malavan Sotheeswaran d168832e1c check ziplist len to avoid crash on empty ziplist convert 2022-04-26 01:55:22 +00:00
Malavan Sotheeswaran 1d8cb117a9 remove unused var in networking.cpp 2022-04-26 01:55:22 +00:00
Malavan Sotheeswaran 49eb583ec6 remove unused var in networking.cpp 2022-04-26 01:55:22 +00:00
John Sully 1950ce5779 Eliminate firewall dialogs on mac for regular and cluster tests. There are still issues with the sentinel tests but attempting to bind only to localhost causes failures 2022-04-26 01:55:22 +00:00
John Sully d02bc67009 Eliminate firewall dialogs on mac for regular and cluster tests. There are still issues with the sentinel tests but attempting to bind only to localhost causes failures 2022-04-26 01:55:22 +00:00
John Sully b9b3a63ad4 Fix module test break 2022-04-26 01:55:22 +00:00
John Sully a30a0d76f8 Fix module test break 2022-04-26 01:55:22 +00:00
John Sully 105f21635e Fix MALLOC=memkind build issues 2022-04-26 01:55:22 +00:00
John Sully 26071c352d Fix MALLOC=memkind build issues 2022-04-26 01:55:22 +00:00
benschermel 4c52dbc62a update README resource links 2022-04-26 01:55:22 +00:00
benschermel 9fe0e8aa38 update README resource links 2022-04-26 01:55:22 +00:00
Malavan Sotheeswaran 170044cbf3 set thread as offline when waiting for time thread lock 2022-04-26 01:55:22 +00:00
Malavan Sotheeswaran 0e0b83c048 set thread as offline when waiting for time thread lock 2022-04-26 01:55:22 +00:00
Malavan Sotheeswaran 9bc6efd443 time thread lock uses fastlock instead of std::mutex 2022-04-26 01:55:22 +00:00
Malavan Sotheeswaran 59c6db3d0e time thread lock uses fastlock instead of std::mutex 2022-04-26 01:55:22 +00:00
Malavan Sotheeswaran 3e05f17d30 only need to include readwritelock in ae 2022-04-26 01:55:22 +00:00
Malavan Sotheeswaran 2bf0d4e9e8 only need to include readwritelock in ae 2022-04-26 01:55:22 +00:00
Malavan Sotheeswaran 812a671e0d hide forklock object in ae 2022-04-26 01:55:22 +00:00
Malavan Sotheeswaran 88d2f4f0ac hide forklock object in ae 2022-04-26 01:55:22 +00:00
malavan f027c8c761 fork lock for all threads, use fastlock for readwritelock 2022-04-26 01:55:21 +00:00
malavan c3401248d7 fork lock for all threads, use fastlock for readwritelock 2022-04-26 01:55:21 +00:00
John Sully 46d571f45c Update ci.yml
Change min tested version to 18.04
2022-04-26 01:55:21 +00:00
John Sully 6eef90f68b Update ci.yml
Change min tested version to 18.04
2022-04-26 01:55:21 +00:00
Vivek Saini ba087cebb8 Added multimaster test 2022-04-25 20:32:44 +00:00
Vivek Saini 0ee8b01e2a Added multimaster test 2022-04-25 20:32:44 +00:00
zliang 7ede98b5e3 break into tests into steps 2022-04-22 18:03:42 -06:00
zliang dba44cfb58 break into tests into steps 2022-04-22 18:03:42 -06:00
zliang ef645104b8 fix the Machamp build 2022-04-22 16:46:41 -06:00
zliang 24c6b65c6f fix the Machamp build 2022-04-22 16:46:41 -06:00
John Sully bbcf95b346 PSYNC production fixes 2022-04-22 22:43:20 +00:00
John Sully 349acac1dd PSYNC production fixes 2022-04-22 22:43:20 +00:00
zliang d4de960cda make build_test.sh executable 2022-04-22 12:31:13 -06:00
zliang 6b9f8edf62 make build_test.sh executable 2022-04-22 12:31:13 -06:00
zliang 3f06dfa141 setup Machamp ci 2022-04-22 12:08:39 -06:00
zliang 1bd7797a6b setup Machamp ci 2022-04-22 12:08:39 -06:00
John Sully a40b5ed2ca øMerge branch 'keydbpro' into merge_os_apr_13 2022-04-21 19:54:01 +00:00
John Sully 98e317e17d øMerge branch 'keydbpro' into merge_os_apr_13 2022-04-21 19:54:01 +00:00
John Sully 2587e9abd8 acceptTLS is threadsafe like the non TLS version 2022-04-21 19:53:16 +00:00
John Sully 5fe3e26d24 acceptTLS is threadsafe like the non TLS version 2022-04-21 19:53:16 +00:00
Ben Schermel eb973aca17 Merge pull request #63 from Snapchat/pkg_update
Packaging Updates
2022-04-21 13:21:14 -04:00
Ben Schermel 8e48c14201 Merge pull request #63 from Snapchat/pkg_update
Packaging Updates
2022-04-21 13:21:14 -04:00
Vivek Saini 8ccd1bdad6 Removed mergeReplicationId 2022-04-21 01:18:12 +00:00
Vivek Saini d86692affa Removed mergeReplicationId 2022-04-21 01:18:12 +00:00
John Sully 117c9cbaa3 Merge branch 'keydbpro' of https://github.sc-corp.net/Snapchat/keydb-internal into keydbpro 2022-04-20 21:19:34 +00:00
John Sully 64f54d865c Merge branch 'keydbpro' of https://github.sc-corp.net/Snapchat/keydb-internal into keydbpro 2022-04-20 21:19:34 +00:00
Vivek Saini 4da56ec7c6 call aeThreadOnline() earlier 2022-04-20 20:46:48 +00:00
Vivek Saini edf4b24659 call aeThreadOnline() earlier 2022-04-20 20:46:48 +00:00
benschermel 6e1d6f7f79 update deb copyright 2022-04-20 16:17:43 -04:00
benschermel 0a02276879 update deb copyright 2022-04-20 16:17:43 -04:00
benschermel 239651641e update copyright 2022-04-20 16:07:37 -04:00
benschermel 2ddb68d663 update copyright 2022-04-20 16:07:37 -04:00
benschermel dbbc8916d0 update changelog to use replica as terminology 2022-04-20 14:28:18 -04:00
benschermel 94697eb37c update changelog to use replica as terminology 2022-04-20 14:28:18 -04:00
Vivek Saini dac75359df Fix KeyDB not building with TLS < 1.1.1 2022-04-20 14:24:50 -04:00
Vivek Saini 33d22c5350 Fix KeyDB not building with TLS < 1.1.1 2022-04-20 14:24:50 -04:00
Vivek Saini 83dce1ec27 Only run the tls-name-validation test if --tls is passed into runtest 2022-04-20 12:15:19 -04:00
Vivek Saini 9606494925 Only run the tls-name-validation test if --tls is passed into runtest 2022-04-20 12:15:19 -04:00
John Sully 19f37969ca With TLS throttle accepts if server is under heavy load - do not change non TLS behavior 2022-04-18 23:07:36 +00:00
John Sully 469707fa28 With TLS throttle accepts if server is under heavy load - do not change non TLS behavior 2022-04-18 23:07:36 +00:00
John Sully 57ee67ae40 Make active client balancing a configurable option 2022-04-18 23:07:15 +00:00
John Sully 07fa0c025a Make active client balancing a configurable option 2022-04-18 23:07:15 +00:00
benschermel 6008df4a6f modify dockerfile to build within image 2022-04-15 23:10:31 -04:00
benschermel 27ea441bad modify dockerfile to build within image 2022-04-15 23:10:31 -04:00
benschermel e2e062e08c update packaging for OS merge 2022-04-15 23:09:44 -04:00
benschermel 2125c097ef update packaging for OS merge 2022-04-15 23:09:44 -04:00
Vivek Saini 9885ba7e25 Inclusive language 2022-04-14 23:54:05 +00:00
Vivek Saini a46b10c8e2 Inclusive language 2022-04-14 23:54:05 +00:00
Vivek Saini 50f182417f Remove asserts, RW lock can go below zero in cases of aeAcquireLock 2022-04-14 22:34:02 +00:00
Vivek Saini 0ab7068920 Remove asserts, RW lock can go below zero in cases of aeAcquireLock 2022-04-14 22:34:02 +00:00
Vivek Saini f5fc90c035 placement new instead of memcpy 2022-04-14 21:05:10 +00:00
Vivek Saini 0f6d646584 placement new instead of memcpy 2022-04-14 21:05:10 +00:00
Christian Legge eb7a69c07e Save and restore master info in rdb to allow active replica partial sync (#371)
* save replid for all masters in rdb

* expanded rdbSaveInfo to hold multiple master structs

* parse repl-masters from rdb

* recover replid info from rdb in active replica mode, attempt partial sync

* save offset from rdb into correct variable

* don't change replid based on master in active rep

* save and load psync info from correct fields
2022-04-14 20:17:18 +00:00
Christian Legge c75161c557 Save and restore master info in rdb to allow active replica partial sync (#371)
* save replid for all masters in rdb

* expanded rdbSaveInfo to hold multiple master structs

* parse repl-masters from rdb

* recover replid info from rdb in active replica mode, attempt partial sync

* save offset from rdb into correct variable

* don't change replid based on master in active rep

* save and load psync info from correct fields
2022-04-14 20:17:18 +00:00
Vivek Saini 43f445946d Defensive asserts for RWLock 2022-04-14 17:21:50 +00:00
Vivek Saini 37251ee2f3 Defensive asserts for RWLock 2022-04-14 17:21:50 +00:00
Vivek Saini f60c355361 Integrate readwritelock with Pro Code 2022-04-14 17:15:19 +00:00
Vivek Saini 4ef0062ef7 Integrate readwritelock with Pro Code 2022-04-14 17:15:19 +00:00
Malavan Sotheeswaran 2c3a7907d5 use atomic_load for g_pserver->mstime 2022-04-13 14:10:58 -04:00
Malavan Sotheeswaran c2147af8d6 use atomic_load for g_pserver->mstime 2022-04-13 14:10:58 -04:00
Malavan Sotheeswaran 4522751aa0 need to include stdint for uintptr_t 2022-04-13 14:10:58 -04:00
Malavan Sotheeswaran ead8b06366 need to include stdint for uintptr_t 2022-04-13 14:10:58 -04:00
Malavan Sotheeswaran 50e1fbb9fd cannot mod a pointer 2022-04-13 14:10:58 -04:00
Malavan Sotheeswaran e9f592ec00 cannot mod a pointer 2022-04-13 14:10:58 -04:00
Malavan Sotheeswaran 7fb0a3119f remove nullptr subtraction 2022-04-13 14:10:58 -04:00
Malavan Sotheeswaran aa63c38b25 remove nullptr subtraction 2022-04-13 14:10:58 -04:00
Malavan Sotheeswaran 2deb216552 check ziplist len to avoid crash on empty ziplist convert 2022-04-13 14:08:44 -04:00
Malavan Sotheeswaran ae8a391ab2 check ziplist len to avoid crash on empty ziplist convert 2022-04-13 14:08:44 -04:00
Malavan Sotheeswaran ff6fbad564 remove unused var in networking.cpp 2022-04-13 14:08:43 -04:00
Malavan Sotheeswaran 9c533334f1 remove unused var in networking.cpp 2022-04-13 14:08:43 -04:00
John Sully 4aec464d1b Eliminate firewall dialogs on mac for regular and cluster tests. There are still issues with the sentinel tests but attempting to bind only to localhost causes failures 2022-04-13 14:07:14 -04:00
John Sully 5aaed44578 Eliminate firewall dialogs on mac for regular and cluster tests. There are still issues with the sentinel tests but attempting to bind only to localhost causes failures 2022-04-13 14:07:14 -04:00
John Sully 9ba9add4a8 Fix module test break 2022-04-13 14:07:14 -04:00
John Sully c41ed07e54 Fix module test break 2022-04-13 14:07:14 -04:00
John Sully 25e5e60983 Fix MALLOC=memkind build issues 2022-04-13 14:07:14 -04:00
John Sully 7529e0b766 Fix MALLOC=memkind build issues 2022-04-13 14:07:14 -04:00
benschermel ad4840f9df update README resource links 2022-04-13 14:07:14 -04:00
benschermel 79b5c9e0d8 update README resource links 2022-04-13 14:07:14 -04:00
Malavan Sotheeswaran ad4336281b set thread as offline when waiting for time thread lock 2022-04-13 14:06:58 -04:00
Malavan Sotheeswaran e579dfd52d set thread as offline when waiting for time thread lock 2022-04-13 14:06:58 -04:00
Malavan Sotheeswaran ff023a3f5b time thread lock uses fastlock instead of std::mutex 2022-04-13 14:05:26 -04:00
Malavan Sotheeswaran 31fc5f182c time thread lock uses fastlock instead of std::mutex 2022-04-13 14:05:26 -04:00
Malavan Sotheeswaran e0e5ce4416 only need to include readwritelock in ae 2022-04-13 14:04:07 -04:00
Malavan Sotheeswaran af2e94f14d only need to include readwritelock in ae 2022-04-13 14:04:07 -04:00
Malavan Sotheeswaran a15991c2f4 hide forklock object in ae 2022-04-13 14:04:02 -04:00
Malavan Sotheeswaran 6b7ce4dc0b hide forklock object in ae 2022-04-13 14:04:02 -04:00
malavan 9243237519 fork lock for all threads, use fastlock for readwritelock 2022-04-13 13:52:41 -04:00
malavan 74e79a6ab7 fork lock for all threads, use fastlock for readwritelock 2022-04-13 13:52:41 -04:00
John Sully 9b71188b5e Update ci.yml
Change min tested version to 18.04
2022-04-13 13:34:18 -04:00
John Sully dec18fb3a1 Update ci.yml
Change min tested version to 18.04
2022-04-13 13:34:18 -04:00
John Sully c910508d8f Fix leaked reference count to dict 2022-04-13 12:51:00 -04:00
John Sully 056e6f346c Fix leaked reference count to dict 2022-04-13 12:51:00 -04:00
John Sully 4f10d12873 Improve connect performance by reducing lock contention, I'm seeing 50-100% improvements 2022-04-13 12:51:00 -04:00
John Sully 9bc1123988 Improve connect performance by reducing lock contention, I'm seeing 50-100% improvements 2022-04-13 12:51:00 -04:00
John Sully 0acd454ec4 Do not send updates to servers overly frequently during load 2022-04-13 12:51:00 -04:00
John Sully 4b0fe0da3c Do not send updates to servers overly frequently during load 2022-04-13 12:51:00 -04:00
John Sully e31bfb6736 SSL connections are expensive, do not do them overly frequently 2022-04-13 12:51:00 -04:00
John Sully 9630f1dc1a SSL connections are expensive, do not do them overly frequently 2022-04-13 12:51:00 -04:00
John Sully fab17c84b4 Handle RREPLAY errors gracefully 2022-04-13 12:51:00 -04:00
John Sully d08afadb5b Handle RREPLAY errors gracefully 2022-04-13 12:51:00 -04:00
John SullyandJohn Sully 3439bd47a7 Make multithread load configurable and disabled by default (#57)
Co-authored-by: John Sully <john@csquare.ca>
2022-04-07 13:20:38 -04:00
John SullyandJohn Sully ad8fb4f68a Make multithread load configurable and disabled by default (#57)
Co-authored-by: John Sully <john@csquare.ca>
2022-04-07 13:20:38 -04:00
John Sully 9dd19e4e60 Log the connected masters in the INFO command 2022-04-02 01:20:45 -04:00
John Sully cb8e3d8d51 Log the connected masters in the INFO command 2022-04-02 01:20:45 -04:00
John Sully bde3e1bb1e Fix test failures due to async command slip 2022-04-01 05:08:41 +00:00
John Sully 22bfc046ab Fix test failures due to async command slip 2022-04-01 05:08:41 +00:00
John Sully 56274ead49 Do not save while loading 2022-04-01 05:08:08 +00:00
John Sully 4300f4b8d3 Do not save while loading 2022-04-01 05:08:08 +00:00
John Sully a96c2aa66f Fix test failure 2022-03-31 17:48:37 -04:00
John Sully 4d17dc1d5b Fix test failure 2022-03-31 17:48:37 -04:00
John Sully 370785244b Support dynamic runtime modification of tls-allowlist, and add config rewrite support 2022-03-31 17:48:37 -04:00
John Sully b190866094 Support dynamic runtime modification of tls-allowlist, and add config rewrite support 2022-03-31 17:48:37 -04:00
Vivek Saini 300a945ecd Changed term whitelist to allowlist (#54) 2022-03-31 14:15:03 -04:00
Vivek Saini 3b6ec122df Changed term whitelist to allowlist (#54) 2022-03-31 14:15:03 -04:00
John Sully c498f50d6c Merge pull request #53 from Snapchat/freeClientLockFix
Fix lock inversion in freeClientAsync
2022-03-29 12:37:12 -04:00
John Sully bf21da939d Merge pull request #53 from Snapchat/freeClientLockFix
Fix lock inversion in freeClientAsync
2022-03-29 12:37:12 -04:00
John Sully 9c4dfdd875 Fix issue with AE unlocking in beforeSleep 2022-03-29 12:17:13 -04:00
John Sully 01e9a1eaa1 Fix issue with AE unlocking in beforeSleep 2022-03-29 12:17:13 -04:00
John Sully fb2f289e89 Fix lock inversion in freeClientAsync - make it not dependent on the AE Lock 2022-03-29 00:19:49 -04:00
John Sully 4d96f16852 Fix lock inversion in freeClientAsync - make it not dependent on the AE Lock 2022-03-29 00:19:49 -04:00
John Sully a6e701a84e Merge pull request #51 from jsully/keydbpro
KeyDB Pro Collab Bug Fixes and Mac Build
2022-03-08 18:00:28 -05:00
John Sully bfbf02b268 Merge pull request #51 from jsully/keydbpro
KeyDB Pro Collab Bug Fixes and Mac Build
2022-03-08 18:00:28 -05:00
John Sully 4354bd4fe8 Fix mac build warnings 2022-03-07 19:28:39 -05:00
John Sully 1bae7109bc Fix mac build warnings 2022-03-07 19:28:39 -05:00
John Sully 4ad063bdfd Fix spurious warnings about unclean RocksDB databases on startup 2022-03-07 16:42:37 -05:00
John Sully d51f73f2b5 Fix spurious warnings about unclean RocksDB databases on startup 2022-03-07 16:42:37 -05:00
John Sully 3abce05330 Fix FLASH Read performance after data is loaded from fastsync (the rocksdb files have compression enabled when written by the bulkWrite function 2022-03-07 16:41:51 -05:00
John Sully 072cf76bf0 Fix FLASH Read performance after data is loaded from fastsync (the rocksdb files have compression enabled when written by the bulkWrite function 2022-03-07 16:41:51 -05:00
John Sully 9320e10396 Fix test instability caused by MVCC slip with lfence command when async commands are enabled 2022-03-07 16:40:56 -05:00
John Sully 51c3567ded Fix test instability caused by MVCC slip with lfence command when async commands are enabled 2022-03-07 16:40:56 -05:00
John Sully ad19110a5a Fix fast-sync perf issue while server is under load (batch size too small) 2022-03-07 16:40:01 -05:00
John Sully fc4388ac47 Fix fast-sync perf issue while server is under load (batch size too small) 2022-03-07 16:40:01 -05:00
John Sully fb51123090 Fix cluster test fail 2022-03-07 16:39:01 -05:00
John Sully b0fc50494d Fix cluster test fail 2022-03-07 16:39:01 -05:00
John Sully 0329e62d31 Optimize async command snapshot creation, and make slip configurable 2022-03-07 16:00:48 -05:00
John Sully cccf2ca062 Optimize async command snapshot creation, and make slip configurable 2022-03-07 16:00:48 -05:00
John Sully adc66136d9 Fix mac build breaks and remove license checks (won't work on mac) 2022-03-07 14:50:31 -05:00
John Sully 570ed1feb1 Fix mac build breaks and remove license checks (won't work on mac) 2022-03-07 14:50:31 -05:00
Vivek Saini 9a0c765875 TLS Name Validation (#48)
Added TLS Name Validation
2022-03-03 13:59:07 -05:00
Vivek Saini 4e4f08db3e TLS Name Validation (#48)
Added TLS Name Validation
2022-03-03 13:59:07 -05:00
Artem Danilov ab5589be41 enable TLS build by default (#43)
* enable TLS build by default

* move export to src folder

* fix comments
2022-02-11 16:36:42 -08:00
Artem Danilov e8f94d1883 enable TLS build by default (#43)
* enable TLS build by default

* move export to src folder

* fix comments
2022-02-11 16:36:42 -08:00
John Sully bc0b3c3deb Merge pull request #42 from Snapchat/keepttl-failure
fix intermittent KEEPTTL test failure
2022-02-10 12:53:59 -05:00
John Sully 80d376325f Merge pull request #42 from Snapchat/keepttl-failure
fix intermittent KEEPTTL test failure
2022-02-10 12:53:59 -05:00
adanilov 17bd229fce fix intermittent KEEPTTL test failure 2022-02-10 16:37:13 +00:00
adanilov cf459e67b9 fix intermittent KEEPTTL test failure 2022-02-10 16:37:13 +00:00
Vivek Saini 96a7a57f8a Merge pull request #40 from Snapchat/tls_cert_rotation
Added support for TLS certificate rotation.
2022-02-02 17:38:35 -05:00
Vivek Saini 4035ddaecd Merge pull request #40 from Snapchat/tls_cert_rotation
Added support for TLS certificate rotation.
2022-02-02 17:38:35 -05:00
Vivek Saini 3d485e48cf Updated CI to run rotation test 2022-02-02 17:28:55 -05:00
Vivek Saini b029a10bf7 Updated CI to run rotation test 2022-02-02 17:28:55 -05:00
Vivek Saini 3cc79b57fe Updated default config file with TLS rotation config option 2022-02-02 15:49:52 -05:00
Vivek Saini 6c630eddcf Updated default config file with TLS rotation config option 2022-02-02 15:49:52 -05:00
Vivek Saini 97bff49db4 Added TLS rotation support 2022-02-02 14:20:19 -05:00
Vivek Saini 82e56dfaf8 Added TLS rotation support 2022-02-02 14:20:19 -05:00
christianEQ 898191750b Merge remote-tracking branch 'opensource/RELEASE_6' into keydbpro
Former-commit-id: 439c655a543f4d3224d90bcdeb21ba43c2ab8ab7
2022-01-14 22:19:42 +00:00
christianEQ 2d5ff78a3f Merge remote-tracking branch 'opensource/RELEASE_6' into keydbpro
Former-commit-id: 439c655a543f4d3224d90bcdeb21ba43c2ab8ab7
2022-01-14 22:19:42 +00:00
MalavanEQAlpha dfcbba494a Merge pull request #386 from EQ-Alpha/fix_rdb_hang
add readwrite lock for forking

Former-commit-id: 95c2a7e970ce17dd3e35eeaec0b63f7dd96d1cf5
2022-01-14 13:19:33 -08:00
christianEQ 1a65396527 bump version
Former-commit-id: e5c7525b88370d29fafa44245b0e2eecc2081fd8
2022-01-13 00:07:03 +00:00
christianEQ fb82631f48 Merge branch 'unstable' into RELEASE_6
Former-commit-id: 575bcdbf4a58f85d41bf80986bd54922f634d05c
2022-01-10 23:54:30 +00:00
John Sully eb540c7d98 Permit connTLSWrite to handle a zero sized write
Former-commit-id: 4be609ff2c80fd6261edc214bb099d6cf6ab1db3
2022-01-06 19:15:31 -05:00
John Sully 41aab2d66f Permit connTLSWrite to handle a zero sized write
Former-commit-id: 4be609ff2c80fd6261edc214bb099d6cf6ab1db3
2022-01-06 19:15:31 -05:00
John Sully dc38bc8fdb Handle the case where querybuf data is read by the fastsync read handler
Former-commit-id: c4a5b904e941e09132413abc3b4d86c59c342051
2021-12-27 00:15:09 -05:00
John Sully df570b5a53 Handle the case where querybuf data is read by the fastsync read handler
Former-commit-id: c4a5b904e941e09132413abc3b4d86c59c342051
2021-12-27 00:15:09 -05:00
John Sully 07dd648ce2 Fix partial sync failures
Former-commit-id: 7e9f7c0c4f520392a930ab72951e287f52c711ab
2021-12-26 05:16:58 -05:00
John Sully 4e4ac42f20 Fix partial sync failures
Former-commit-id: 7e9f7c0c4f520392a930ab72951e287f52c711ab
2021-12-26 05:16:58 -05:00
John Sully 7391744456 Fix repl-psync-flash test instability
Former-commit-id: 310b0cf5413dbf3e7aa67e9b9c31869f3e994291
2021-12-23 17:30:14 -05:00
John Sully dc337817d4 Fix repl-psync-flash test instability
Former-commit-id: 310b0cf5413dbf3e7aa67e9b9c31869f3e994291
2021-12-23 17:30:14 -05:00
John Sully 68a22350b6 Remove double free in keydb-benchmark
Former-commit-id: 3190dbf57320b1901e3ac75f2e4a25ca335026a1
2021-12-23 14:20:41 -05:00
John Sully 0ddf1a558d Fix deadlock issue #183 cause by lock inversion
Former-commit-id: ab975f6612941bcf3a0609b984256d24e3ae2bea
2021-12-23 13:17:14 -05:00
John Sully 6c8133c8f2 Apple build break fix
Former-commit-id: 7bde9214015efb7dea4cdca98fd87e793bb01d07
2021-12-23 13:12:59 -05:00
John Sully 600e7ce265 Fix module test break
Former-commit-id: 05767cdcb3c45619cdeeebcedbbf55ff1712e366
2021-12-23 13:12:34 -05:00
John Sully f812aafaf7 Fix module test failures with blocked clients
Former-commit-id: 18ec4b8600ea3462843b58a0f0e917824dfd7ff3
2021-12-23 02:10:20 -05:00
John Sully 44cbe57d0a Fix module test failures with blocked clients
Former-commit-id: 18ec4b8600ea3462843b58a0f0e917824dfd7ff3
2021-12-23 02:10:20 -05:00
John Sully cbedcda44a Fix partial sync corruption with FLASH
Former-commit-id: 532f58c0539b775c040c0dd9a2ad3dc349faf87a
2021-12-23 00:04:28 -05:00
John Sully 60b49510a7 Fix partial sync corruption with FLASH
Former-commit-id: 532f58c0539b775c040c0dd9a2ad3dc349faf87a
2021-12-23 00:04:28 -05:00
John Sully df17b0fac8 Reenable TCP No Delay
Former-commit-id: e11211cdfeca46574a03f6f8210bbe1ab3d70961
2021-12-22 18:42:11 -05:00
John Sully 10de1d54bd Reenable TCP No Delay
Former-commit-id: e11211cdfeca46574a03f6f8210bbe1ab3d70961
2021-12-22 18:42:11 -05:00
John Sully 346e652206 Fix memory leak
Former-commit-id: c5b9adf47e30658359071d458cfb16a094dc8e28
2021-12-22 18:41:50 -05:00
John Sully 9bf54df381 Fix memory leak
Former-commit-id: c5b9adf47e30658359071d458cfb16a094dc8e28
2021-12-22 18:41:50 -05:00
VivekSainiEQ 7702c97cdf Merge remote-tracking branch 'mainpro/PRO_RELEASE_6' into keydbpro
Former-commit-id: 5a32d66ee382b6d227a67073afc81ca058d605ed
2021-12-06 20:43:23 +00:00
VivekSainiEQ ba8f044d7b Merge remote-tracking branch 'mainpro/PRO_RELEASE_6' into keydbpro
Former-commit-id: 5a32d66ee382b6d227a67073afc81ca058d605ed
2021-12-06 20:43:23 +00:00
John Sully 273bc25b2b Implent the force-backlog-disk-reserve flag
Former-commit-id: d39f7f4407f8935b1540dd302be3e24ac02c5700
2021-12-04 02:07:03 +00:00
John Sully f85ef42ca6 Implent the force-backlog-disk-reserve flag
Former-commit-id: d39f7f4407f8935b1540dd302be3e24ac02c5700
2021-12-04 02:07:03 +00:00
Malavan Sotheeswaran cd80f5e086 Merge branch 'fix_unlocked_main_db_access_in_async_lookup' into 'keydbpro'
add async to hget and fix bug where a command can hold a key from main db without lock

See merge request external-collab/keydb-pro-6!11

Former-commit-id: 1cf683ef015f7e32fb79fbb5e41a3c3a80a80844
2021-12-02 17:39:27 +00:00
Malavan Sotheeswaran 949b660e50 Merge branch 'fix_unlocked_main_db_access_in_async_lookup' into 'keydbpro'
add async to hget and fix bug where a command can hold a key from main db without lock

See merge request external-collab/keydb-pro-6!11

Former-commit-id: 1cf683ef015f7e32fb79fbb5e41a3c3a80a80844
2021-12-02 17:39:27 +00:00
malavan 5555589247 add async to hget and fix bug where a command can hold a key from main db without lock
Former-commit-id: b0b8f426fda7cdabd3898a2d0b38d0fae47d1e69
2021-12-02 17:11:26 +00:00
malavan b6dea1d287 add async to hget and fix bug where a command can hold a key from main db without lock
Former-commit-id: b0b8f426fda7cdabd3898a2d0b38d0fae47d1e69
2021-12-02 17:11:26 +00:00
malavan 7782d46cb4 fix potential compilation fail on gettid in replication.cpp
Former-commit-id: edb6b240a7785b707652a168d90f46d8744dd4c7
2021-12-01 20:50:18 +00:00
malavan 12beccdd01 fix potential compilation fail on gettid in replication.cpp
Former-commit-id: edb6b240a7785b707652a168d90f46d8744dd4c7
2021-12-01 20:50:18 +00:00
Malavan Sotheeswaran 15d03f6b10 Merge branch 'async_commands' into 'keydbpro'
async commands

See merge request external-collab/keydb-pro-6!10

Former-commit-id: 669987028af582a8561b7959c1b33b84f67c6146
2021-11-30 17:28:17 +00:00
Malavan Sotheeswaran 36390a7d24 Merge branch 'async_commands' into 'keydbpro'
async commands

See merge request external-collab/keydb-pro-6!10

Former-commit-id: 669987028af582a8561b7959c1b33b84f67c6146
2021-11-30 17:28:17 +00:00
Malavan Sotheeswaran 71d21fa2ee missing false for return in prefetchKeysAsync
Former-commit-id: 174dc44acdc1a8cb37b86f27ab056e14fc42770c
2021-11-30 12:20:13 -05:00
Malavan Sotheeswaran 55e30b7b57 missing false for return in prefetchKeysAsync
Former-commit-id: 174dc44acdc1a8cb37b86f27ab056e14fc42770c
2021-11-30 12:20:13 -05:00
Malavan Sotheeswaran a9647ed275 Merge branch 'async_commands' of https://gitlab.eqalpha.com/external-collab/keydb-pro-6 into async_commands
Former-commit-id: 1afa51c4d21d695c052dbec690bf3880b243dbec
2021-11-30 12:17:46 -05:00
Malavan Sotheeswaran 8cea3a6b71 Merge branch 'async_commands' of https://gitlab.eqalpha.com/external-collab/keydb-pro-6 into async_commands
Former-commit-id: 1afa51c4d21d695c052dbec690bf3880b243dbec
2021-11-30 12:17:46 -05:00
Malavan Sotheeswaran a34ed32400 Merge branch 'async_commands' of https://gitlab.eqalpha.com/external-collab/keydb-pro-6 into async_commands
Former-commit-id: 59423294524bb1d093a35084aa0d48989b426961
2021-11-30 11:48:35 -05:00
Malavan Sotheeswaran ce0d680622 Merge branch 'async_commands' of https://gitlab.eqalpha.com/external-collab/keydb-pro-6 into async_commands
Former-commit-id: 59423294524bb1d093a35084aa0d48989b426961
2021-11-30 11:48:35 -05:00
Malavan Sotheeswaran 5233969299 Merge branch 'keydbpro' into async_commands
Former-commit-id: 9eaddb8ca1424ff3225dac9c144d23848228c7d2
2021-11-30 11:47:51 -05:00
Malavan Sotheeswaran 15ea551c8b Merge branch 'keydbpro' into async_commands
Former-commit-id: 9eaddb8ca1424ff3225dac9c144d23848228c7d2
2021-11-30 11:47:51 -05:00
Malavan Sotheeswaran fff3c87882 Merge branch 'fastsync_collab' into 'keydbpro'
Fastsync collab

See merge request external-collab/keydb-pro-6!9

Former-commit-id: 8f410e4b814ea6ac506ab540ee1394834fd1d8a8
2021-11-26 20:53:00 +00:00
Malavan Sotheeswaran 4763ddb9fa Merge branch 'fastsync_collab' into 'keydbpro'
Fastsync collab

See merge request external-collab/keydb-pro-6!9

Former-commit-id: 8f410e4b814ea6ac506ab540ee1394834fd1d8a8
2021-11-26 20:53:00 +00:00
christianEQ 71b3414a4c don't save master if host is null
Former-commit-id: 8238d8da82c483c093f5248b9dac983bc542e20f
2021-11-26 20:36:46 +00:00
christianEQ 617e7f6673 don't save master if host is null
Former-commit-id: 8238d8da82c483c093f5248b9dac983bc542e20f
2021-11-26 20:36:46 +00:00
Malavan Sotheeswaran e809f467a7 Merge branch 'flash-psync' into 'fastsync_collab'
Flash Partial Sync

See merge request external-collab/keydb-pro-6!6

Former-commit-id: 2ebf2a8abd8df5c4cf3a5d759491962d050e8cc5
2021-11-26 18:59:16 +00:00
Malavan Sotheeswaran cf4d90a31c Merge branch 'flash-psync' into 'fastsync_collab'
Flash Partial Sync

See merge request external-collab/keydb-pro-6!6

Former-commit-id: 2ebf2a8abd8df5c4cf3a5d759491962d050e8cc5
2021-11-26 18:59:16 +00:00
christian d4b1b7e131 Merge branch 'fastsync_collab2' into 'fastsync_collab'
fix dataloss on aof load with storage provider

See merge request external-collab/keydb-pro-6!7

Former-commit-id: a3aecc171b45308b68eb922947f8dd31be7e3566
2021-11-26 18:28:08 +00:00
christian 2b1548692e Merge branch 'fastsync_collab2' into 'fastsync_collab'
fix dataloss on aof load with storage provider

See merge request external-collab/keydb-pro-6!7

Former-commit-id: a3aecc171b45308b68eb922947f8dd31be7e3566
2021-11-26 18:28:08 +00:00
malavan 130fb929df client lock for fast sync replbuffer, delay fast sync for next replication cron
Former-commit-id: 9fe7f8328d66f9ec57060934462ad85ef60c36aa
2021-11-26 17:46:41 +00:00
malavan 56d9b59073 client lock for fast sync replbuffer, delay fast sync for next replication cron
Former-commit-id: 9fe7f8328d66f9ec57060934462ad85ef60c36aa
2021-11-26 17:46:41 +00:00
John Sully 10f5eb8908 Implement the disk backed backlog functionality
Former-commit-id: 759cc01c6ba05f9a865c11580cc4975b5f1bd1d6
2021-11-26 03:05:23 +00:00
John Sully 0a7b55bfc9 Implement the disk backed backlog functionality
Former-commit-id: 759cc01c6ba05f9a865c11580cc4975b5f1bd1d6
2021-11-26 03:05:23 +00:00
malavan 6982348ecb Merge remote-tracking branch 'origin/fastsync_collab' into fastsync_collab2
Former-commit-id: 176c00615769e1a73eb44f8fe7a6cacfa2ae539d
2021-11-24 22:00:18 +00:00
malavan 042a08deef Merge remote-tracking branch 'origin/fastsync_collab' into fastsync_collab2
Former-commit-id: 176c00615769e1a73eb44f8fe7a6cacfa2ae539d
2021-11-24 22:00:18 +00:00
malavan 53b9e32058 remove async write from fast sync repl buffer and fix some bugs
Former-commit-id: 6c45706f75d8322281296d9c73a3fac4f7f383a1
2021-11-24 21:59:01 +00:00
malavan e5f9bfde05 remove async write from fast sync repl buffer and fix some bugs
Former-commit-id: 6c45706f75d8322281296d9c73a3fac4f7f383a1
2021-11-24 21:59:01 +00:00
VivekSainiEQ 53594ea73c Initialize snapshots for module thread var
Former-commit-id: c263e0df22bab35d8417eb396d250e00e8853ab3
2021-11-24 01:42:01 +00:00
VivekSainiEQ 452df153ec Initialize snapshots for module thread var
Former-commit-id: c263e0df22bab35d8417eb396d250e00e8853ab3
2021-11-24 01:42:01 +00:00
VivekSainiEQ baba64f7e5 Fix failing cluster test
Former-commit-id: 960503a4710d4379d5ebbb67d7ac82705f312913
2021-11-22 22:21:57 +00:00
VivekSainiEQ 15592291d0 Fix failing cluster test
Former-commit-id: 960503a4710d4379d5ebbb67d7ac82705f312913
2021-11-22 22:21:57 +00:00
benschermel 4be6814018 update conf
Former-commit-id: b5b095c12973cdd3eceea8ad8df3961136464a95
2021-11-19 01:46:05 +00:00
benschermel 7f7fa94215 update conf
Former-commit-id: b5b095c12973cdd3eceea8ad8df3961136464a95
2021-11-19 01:46:05 +00:00
benschermel e2c9062d71 update deb changelog
Former-commit-id: acbfa119ae7af083a0839292ea7b55cae5d0eeb1
2021-11-17 18:22:36 +00:00
benschermel be0d0b1a10 update deb changelog
Former-commit-id: a8b215087e9bccf0d813b4b08974744ba963b31c
2021-11-17 18:20:38 +00:00
benschermel fa91f22223 update deb changelog
Former-commit-id: a8b215087e9bccf0d813b4b08974744ba963b31c
2021-11-17 18:20:38 +00:00
malavan 5c5ff77833 fix dataloss on aof load with storage provider
Former-commit-id: 447c8601b5203346fdd4b956ad1ac87c4a6073c8
2021-11-16 02:13:36 +00:00
malavan 23666861e3 fix dataloss on aof load with storage provider
Former-commit-id: 447c8601b5203346fdd4b956ad1ac87c4a6073c8
2021-11-16 02:13:36 +00:00
VivekSainiEQ 21ca83f64a Removed trial code entirely
Former-commit-id: 540a60eb12d01c2839228f9fdaa6233aed99dc38
2021-11-15 23:56:30 +00:00
VivekSainiEQ effafc9686 Removed trial code entirely
Former-commit-id: 540a60eb12d01c2839228f9fdaa6233aed99dc38
2021-11-15 23:56:30 +00:00
VivekSainiEQ c2a6fd58f2 bump version
Former-commit-id: 733f25e3530282c6cd0e3eaf9e63e1485a24152a
2021-11-15 23:45:46 +00:00
VivekSainiEQ 92b4071529 bump version
Former-commit-id: d6038f0e063579987874b88bf8a11b5b16dfb33a
2021-11-15 23:43:56 +00:00
VivekSainiEQ e2710c2205 bump version
Former-commit-id: d6038f0e063579987874b88bf8a11b5b16dfb33a
2021-11-15 23:43:56 +00:00
VivekSainiEQ fd29199a98 Removed KeyDB Enterprise Trial
Former-commit-id: 0899ede8db54db80a2cc101412e5dbcaedb706b1
2021-11-15 20:33:54 +00:00
VivekSainiEQ d7017eeaab Removed KeyDB Enterprise Trial
Former-commit-id: 0899ede8db54db80a2cc101412e5dbcaedb706b1
2021-11-15 20:33:54 +00:00
VivekSainiEQ d9cd293ca4 Merge branch 'unstable' into RELEASE_6
Former-commit-id: 1e6e8e9fe3e20a1c12d7768b632bf72bc634bd5c
2021-11-15 18:08:01 +00:00
Vivek Saini adb364b829 Merge pull request #375 from VivekSainiEQ/time_thread_backport
Backport the time thread code from the enterprise version of KeyDB.

Also fix an issue with clustering where connections are potentially written to after being closed.

Former-commit-id: 3977314d0cf8505d7e8b1bcd9bcbc1f931a3099e
2021-11-15 12:57:15 -05:00
John Sully 83c04978d7 Prevent GC related crash on force-exit
Former-commit-id: e4d95f83b02786b5a170673709780700def160cb
2021-11-13 19:44:13 +00:00
John Sully b7dbfed962 Prevent GC related crash on force-exit
Former-commit-id: e4d95f83b02786b5a170673709780700def160cb
2021-11-13 19:44:13 +00:00
benschermel 6d26cb5ff4 Merge branch 'systemd_rel' into 'PRO_RELEASE_6'
package updates to release branch

See merge request keydb-dev/KeyDB-Pro!54

Former-commit-id: eef6ec1141aafaa5afe52eb2cf501ca4c1e78b8d
2021-11-13 19:36:18 +00:00
benschermel 27b60ed0cc Merge branch 'systemd_rel' into 'PRO_RELEASE_6'
package updates to release branch

See merge request keydb-dev/KeyDB-Pro!54

Former-commit-id: eef6ec1141aafaa5afe52eb2cf501ca4c1e78b8d
2021-11-13 19:36:18 +00:00
benschermel bb3f7f8515 package updates to release branch
Former-commit-id: 1f198c7ea5926f6f7be630da1e0aadbc8abd10ca
2021-11-13 19:33:45 +00:00
benschermel e0f41f6ec8 package updates to release branch
Former-commit-id: 1f198c7ea5926f6f7be630da1e0aadbc8abd10ca
2021-11-13 19:33:45 +00:00
John Sully 5203be7b1f Allow load at boot to be cancelled with a shutdown command
Former-commit-id: 2897a59e59bed14a67d1d0abcec5cb6a71bbb15b
2021-11-13 18:39:03 +00:00
John Sully 6e7ad79f0c Allow load at boot to be cancelled with a shutdown command
Former-commit-id: 2897a59e59bed14a67d1d0abcec5cb6a71bbb15b
2021-11-13 18:39:03 +00:00
benschermel 7a32f0c6fd Merge pull request #377 from EQ-Alpha/systemd_rel
update release packaging

Former-commit-id: b9d3a1cb686782053e50de2f500fcab113bae109
2021-11-13 13:16:48 -05:00
benschermel 50565bf8b7 update release packaging
Former-commit-id: 4eeda3edae79617bf21ec41f79b526f16efaf299
2021-11-13 17:50:42 +00:00
VivekSainiEQ 1ff6e37d2f Merge remote-tracking branch 'opensource/unstable' into PRO_RELEASE_6
Former-commit-id: 60da86471f68b13e2456e113ecd4aa117d95b134
2021-11-12 21:12:53 +00:00
VivekSainiEQ 3915791d95 Merge remote-tracking branch 'opensource/unstable' into PRO_RELEASE_6
Former-commit-id: 60da86471f68b13e2456e113ecd4aa117d95b134
2021-11-12 21:12:53 +00:00
John Sully 4143ae18da Allow fast sync even if a background save is in progress
Former-commit-id: b98aadfb6875f366a63a9d27d47fb5ca60abaa03
2021-11-12 00:18:32 +00:00
John Sully e3d8c207e5 Allow fast sync even if a background save is in progress
Former-commit-id: b98aadfb6875f366a63a9d27d47fb5ca60abaa03
2021-11-12 00:18:32 +00:00
christianEQ 6aba46e1de removed unused vars
Former-commit-id: e2bb6242e8be53cdad6def6acdd7e90e0f7d9852
2021-11-11 13:43:20 +00:00
christianEQ 4399d299e6 removed unused vars
Former-commit-id: e2bb6242e8be53cdad6def6acdd7e90e0f7d9852
2021-11-11 13:43:20 +00:00
christianEQ 60788b02db removed unnecessary code to check for metadata
Former-commit-id: 69ffc89d7c27a4eef04aa5cb59ffd1c2b9b8eb20
2021-11-11 13:43:00 +00:00
christianEQ c6484102bd removed unnecessary code to check for metadata
Former-commit-id: 69ffc89d7c27a4eef04aa5cb59ffd1c2b9b8eb20
2021-11-11 13:43:00 +00:00
christianEQ d8c2c139e2 added tests for flash psync
Former-commit-id: 79f7376a4fea2de9bd06c06d96f3f98ee7308874
2021-11-11 13:43:00 +00:00
christianEQ b9ba2826b3 added tests for flash psync
Former-commit-id: 79f7376a4fea2de9bd06c06d96f3f98ee7308874
2021-11-11 13:43:00 +00:00
christianEQ b3e83ec445 save replid from storage on load
Former-commit-id: 8e5d0cb7035db30f35ead36aab52df07ab3c9bee
2021-11-11 13:43:00 +00:00
christianEQ e2f210acd1 save replid from storage on load
Former-commit-id: 8e5d0cb7035db30f35ead36aab52df07ab3c9bee
2021-11-11 13:43:00 +00:00
christianEQ 88f8f0f586 retrieve replid from IStorage rather than at load time
Former-commit-id: c25323439ce400ca91b2193aa2f464e7b09978fd
2021-11-11 13:43:00 +00:00
christianEQ ef74d1c497 retrieve replid from IStorage rather than at load time
Former-commit-id: c25323439ce400ca91b2193aa2f464e7b09978fd
2021-11-11 13:43:00 +00:00
christianEQ 9ce7ff976f save master status to storage when masters change
Former-commit-id: 4989926a0028aed7d7700fd1d1f4ed27c20277cc
2021-11-11 13:42:39 +00:00
christianEQ 1a0141013f save master status to storage when masters change
Former-commit-id: 4989926a0028aed7d7700fd1d1f4ed27c20277cc
2021-11-11 13:42:39 +00:00
christianEQ 918559c995 save and recognize metadata table identifier
Former-commit-id: f06ef757c24ecc50df0e7abf5201a5499ff28c53
2021-11-11 13:41:48 +00:00
christianEQ f13e8f4409 save and recognize metadata table identifier
Former-commit-id: f06ef757c24ecc50df0e7abf5201a5499ff28c53
2021-11-11 13:41:48 +00:00
christianEQ 738eafa2d0 add KEYDB_METADATA_ID to metadata tables when created
Former-commit-id: 7fe8a184db62eab171935c20498bdb4f30ee6b1d
2021-11-11 13:41:00 +00:00
christianEQ b2f2f27242 add KEYDB_METADATA_ID to metadata tables when created
Former-commit-id: 7fe8a184db62eab171935c20498bdb4f30ee6b1d
2021-11-11 13:41:00 +00:00
christianEQ 0c5052a2b8 added createMetadataDb to IStorageFactory + implementations
Former-commit-id: a2acf75484d2af93aad9d03a20bd402893044860
2021-11-11 13:41:00 +00:00
christianEQ 229c64349e added createMetadataDb to IStorageFactory + implementations
Former-commit-id: a2acf75484d2af93aad9d03a20bd402893044860
2021-11-11 13:41:00 +00:00
benschermel 577a1391e2 Merge pull request #345 from EQ-Alpha/pkg_update_tools
add keydb-diagnostic-tool to packaging

Former-commit-id: 3b9641e23345334d928989ca27c7bd8c61eef1d3
2021-11-10 22:16:09 -05:00
benschermel bf6f51d1f5 Merge pull request #376 from EQ-Alpha/systemd_build
Systemd build

Former-commit-id: a97bebac906a096c7cf9516c484217461fa6e8ec
2021-11-10 22:14:24 -05:00
benschermel 26ce8feca5 fix typo
Former-commit-id: 316f90674b40c03615111eac401ca2e48ec5de49
2021-11-11 02:36:20 +00:00
benschermel 43cb65e17f update license
Former-commit-id: b35cdc8be980c4edbe69461877958f904f827af4
2021-11-11 02:19:56 +00:00
benschermel 39778ad8b3 Merge branch 'unstable' into systemd_build
Former-commit-id: 78dae7a868c0c8ca66a7c0f03f6cece4a8403b81
2021-11-11 00:59:33 +00:00
malavan 23a42d7817 ignore rdb specific tests when running in --flash mode
Former-commit-id: b44ba3efb21c390c3d199ea1cdd238a57611fd85
2021-11-10 20:46:09 +00:00
malavan 59450d3b59 ignore rdb specific tests when running in --flash mode
Former-commit-id: b44ba3efb21c390c3d199ea1cdd238a57611fd85
2021-11-10 20:46:09 +00:00
John Sully dace3cba1e Fix multiple test failures
Former-commit-id: ba99418643e7b4a12e79bb08e4a7f152da28b861
2021-11-10 18:47:36 +00:00
John Sully d88c9829d3 Fix multiple test failures
Former-commit-id: ba99418643e7b4a12e79bb08e4a7f152da28b861
2021-11-10 18:47:36 +00:00
John Sully 225069ecb1 Fix compile error on some machines
Former-commit-id: 5f491a38cb7eae63fd316c465f317005bbced385
2021-11-10 17:39:00 +00:00
John Sully 41b00b2fa9 Fix compile error on some machines
Former-commit-id: 5f491a38cb7eae63fd316c465f317005bbced385
2021-11-10 17:39:00 +00:00
John Sully f5610c9a2d Prevent track changes from clearing out the cache and misreporting the key count
Former-commit-id: d7ceb59f11bc714e40f208cb8c774a5b762ad41e
2021-11-10 06:40:43 +00:00
John Sully 0dc015353f Prevent track changes from clearing out the cache and misreporting the key count
Former-commit-id: d7ceb59f11bc714e40f208cb8c774a5b762ad41e
2021-11-10 06:40:43 +00:00
John Sully 4890d4fa42 Fix snapshot count mismatch due to race
Former-commit-id: b4175c9bf82cbec047b94403e2a3700f4544b4f1
2021-11-10 05:29:13 +00:00
John Sully e3ec3707cf Fix snapshot count mismatch due to race
Former-commit-id: b4175c9bf82cbec047b94403e2a3700f4544b4f1
2021-11-10 05:29:13 +00:00
Vivek Saini a774d5a0b0 Security fixes (#373)
Fixing potential buffer overflows when using the bitop shift and cron commands, as well as comparing ACL user passwords in constant time.

Former-commit-id: b4722b3af024c5169362a4a0ea441af74c01e683
2021-11-09 19:00:01 -05:00
John Sully d1a7f5ba2c Initial implementation of snapshot fast replication. There are still a few TODOs in progress
Former-commit-id: 0febdcdab8693af443f350968ed3d8c80106675d
2021-11-09 19:36:07 +00:00
John Sully 8ea30a0e65 Initial implementation of snapshot fast replication. There are still a few TODOs in progress
Former-commit-id: 0febdcdab8693af443f350968ed3d8c80106675d
2021-11-09 19:36:07 +00:00
John Sully 6c9d1e47db Smooth out performance fluctuations caused by variance in the rehash calibration
Former-commit-id: 09580dedfef09deace7863bf68ba7e0f9edf3eb3
2021-11-06 15:49:58 +00:00
John Sully 9cf6ffad43 Smooth out performance fluctuations caused by variance in the rehash calibration
Former-commit-id: 09580dedfef09deace7863bf68ba7e0f9edf3eb3
2021-11-06 15:49:58 +00:00
VivekSainiEQ 43d055f68d Backported time thread code from enterprise
Former-commit-id: 3f27b35af74f5bf5e80837d6ce12abc977f1434b
2021-11-05 00:30:34 +00:00
John Sully 6189458033 Merge branch 'keydbpro' of https://gitlab.eqalpha.com/external-collab/keydb-pro-6 into keydbpro_collab
Former-commit-id: eca47e8d19defdc894b9dd09b2500d2e15e5fafa
2021-11-02 19:39:53 +00:00
John Sully 21a93ea629 Merge branch 'keydbpro' of https://gitlab.eqalpha.com/external-collab/keydb-pro-6 into keydbpro_collab
Former-commit-id: eca47e8d19defdc894b9dd09b2500d2e15e5fafa
2021-11-02 19:39:53 +00:00
John Sully 996234bd58 This change fixes out of file descriptor issues with FLASH.
The change does 3 things:
1. It limits RocksDB to 256 file descriptors instead of unlimited
2. It includes the fd limit in its estimation for total file descriptors needed
3. It raises the system fd limit if possible before we open rocksdb but accounting for the 256 limit we added


Former-commit-id: 1447288209c5e7daf8a1203511fc262500ebe5e1
2021-11-02 19:31:53 +00:00
John Sully 9f4830121f This change fixes out of file descriptor issues with FLASH.
The change does 3 things:
1. It limits RocksDB to 256 file descriptors instead of unlimited
2. It includes the fd limit in its estimation for total file descriptors needed
3. It raises the system fd limit if possible before we open rocksdb but accounting for the 256 limit we added


Former-commit-id: 1447288209c5e7daf8a1203511fc262500ebe5e1
2021-11-02 19:31:53 +00:00
malavan eca3cecafc Merge branch 'keydbpro' of https://gitlab.eqalpha.com/external-collab/keydb-pro-6 into keydbpro
Former-commit-id: 5b88af1067d344f121b2d65e34fb40e229722575
2021-11-02 19:14:47 +00:00
malavan 7472d644fe Merge branch 'keydbpro' of https://gitlab.eqalpha.com/external-collab/keydb-pro-6 into keydbpro
Former-commit-id: 5b88af1067d344f121b2d65e34fb40e229722575
2021-11-02 19:14:47 +00:00
malavan d629880543 don't delete db or snapshots on shutdown, still delete storage provider
Former-commit-id: edb840ce10ea77ce654ba27c9eadbf98bbc13403
2021-11-02 19:01:37 +00:00
malavan 7405b85e20 don't delete db or snapshots on shutdown, still delete storage provider
Former-commit-id: edb840ce10ea77ce654ba27c9eadbf98bbc13403
2021-11-02 19:01:37 +00:00
VivekSainiEQ b01e1e5679 Check that cluster connection is valid before setting write handler
Former-commit-id: d803e9e8bb9833023dbaf43d88aff5737ff7d08f
2021-11-02 17:43:17 +00:00
John Sully 9d9779c2a7 Make the replica weighting configurable
Former-commit-id: be6a8a7e68acb5cfbe950f13b903e6f7b98c5a39
2021-10-29 17:59:46 +00:00
John Sully 082d246974 Make the replica weighting configurable
Former-commit-id: be6a8a7e68acb5cfbe950f13b903e6f7b98c5a39
2021-10-29 17:59:46 +00:00
malavan 25fcffe2b1 null check for delete override
Former-commit-id: 3d9b2b76b8af8c7e462d7cf66e6b293b411c010a
2021-10-29 15:59:21 +00:00
Vivek Saini ecb57d695e Merge pull request #372 from VivekSainiEQ/Redis_626_Merge
Redis 6.2.6 merge

Former-commit-id: beaed5a4fd68cca086b1a239e863703ddb158653
2021-10-28 17:21:14 -04:00
VivekSainiEQ b7aa2c0ccb Cast pointer correctly and fixed MVCC not updating correctly
Former-commit-id: 582eb6cfa1cdda674eafa2be92f2fade5f107e31
2021-10-27 17:08:37 +00:00
John Sully 205c90bca4 Fix slower performance during replication by better balancing client load on threads servicing a replica
Former-commit-id: 496f91d3f169fcfe6d94c2ea69cee402f8eb60ca
2021-10-22 03:16:33 +00:00
John Sully 44640c5d19 Fix slower performance during replication by better balancing client load on threads servicing a replica
Former-commit-id: 496f91d3f169fcfe6d94c2ea69cee402f8eb60ca
2021-10-22 03:16:33 +00:00
John Sully 289ebabd2d Merge branch 'COLLAB_RELEASE_6_4' into keydbpro_collab
Former-commit-id: 3d43e7a022250273ee5cfb5755ed1d6ca42b9889
2021-10-21 23:58:32 +00:00
John Sully 66f76cdb6e Merge branch 'COLLAB_RELEASE_6_4' into keydbpro_collab
Former-commit-id: 3d43e7a022250273ee5cfb5755ed1d6ca42b9889
2021-10-21 23:58:32 +00:00
malavan 31f0fb463b null check for delete override
Former-commit-id: f5f2f5e200a5ff1b0306998624b758d5a4c10825
2021-10-21 23:56:45 +00:00
malavan 92ac53382c null check for delete override
Former-commit-id: f5f2f5e200a5ff1b0306998624b758d5a4c10825
2021-10-21 23:56:45 +00:00
malavan af153c03e6 null check for delete override
Former-commit-id: a48b4cbdf24bfa5a1d13295c0202d1ed09115374
2021-10-21 23:50:50 +00:00
malavan 84eae35329 null check for delete override
Former-commit-id: a48b4cbdf24bfa5a1d13295c0202d1ed09115374
2021-10-21 23:50:50 +00:00
John Sully 50d0ee66e7 Do not dereference a nullptr if there are too many files open
Former-commit-id: 4674eb29a261e8b046953398c94354fc3e550c2a
2021-10-21 23:45:46 +00:00
John Sully 75da3b0ac2 Do not dereference a nullptr if there are too many files open
Former-commit-id: 4674eb29a261e8b046953398c94354fc3e550c2a
2021-10-21 23:45:46 +00:00
John Sully d83da7f11b Ensure async rehash completes before we start a new time. Degrad to sync hash if necessary to ensure this
Former-commit-id: 0f830facc7c6bc6668af9bb2e10b6e13a13227aa
2021-10-21 22:46:17 +00:00
John Sully b44cd8fa66 Ensure async rehash completes before we start a new time. Degrad to sync hash if necessary to ensure this
Former-commit-id: 0f830facc7c6bc6668af9bb2e10b6e13a13227aa
2021-10-21 22:46:17 +00:00
VivekSainiEQ 817d2c55e4 Resolved merge conflicts in prior commit
Former-commit-id: 1594ef5e3e9f6413d8a68d91cad8eec0dc163b4e
2021-10-21 22:35:15 +00:00
VivekSainiEQ 443f8d8f9b Merge tag '6.2.6' into Redis_626_Merge
Former-commit-id: a4220f27d308863d77feab1713a920add23062ff
2021-10-21 22:33:55 +00:00
John Sully fb14479054 Additional change to ensure FLASH storage goes through the multithread path
Former-commit-id: 422ea0723f0b8718f28ef9c1cc4d5f56d374af46
2021-10-20 03:13:36 +00:00
John Sully c6dce69ae7 Additional change to ensure FLASH storage goes through the multithread path
Former-commit-id: 422ea0723f0b8718f28ef9c1cc4d5f56d374af46
2021-10-20 03:13:36 +00:00
John Sully a8338ade37 Permit prefetch for FLASH scenarios in single thread mode
Former-commit-id: 6d0b90ed43cc9d1196903ddbc7d50cd40e439e42
2021-10-15 16:22:42 +00:00
John Sully dcc725197a Permit prefetch for FLASH scenarios in single thread mode
Former-commit-id: 6d0b90ed43cc9d1196903ddbc7d50cd40e439e42
2021-10-15 16:22:42 +00:00
noobpwnftw 61268c2bfd Fix incorrect counting of client connections
This affects later distribution of clients among threads if there had been many connection attempts during loading phase.


Former-commit-id: 8ed711569dba18752a7c6a0c79d583faa19193fc
2021-10-12 21:47:15 -04:00
Alexis 4a02808fe8 Fix alignment of #ifndef USE_ALIGNED_ACCESS
Former-commit-id: df0003b60d542fc9a9becfc897fe23a590df1a6f
2021-10-12 14:27:53 -04:00
jsully 34f36bfe38 Merge branch 'multithread_load' into 'keydbpro'
Multithread load

See merge request external-collab/keydb-pro-6!5

Former-commit-id: 20e712244071028b0f75ccad477308efd139261f
2021-10-08 17:55:55 +00:00
jsully 685d11e368 Merge branch 'multithread_load' into 'keydbpro'
Multithread load

See merge request external-collab/keydb-pro-6!5

Former-commit-id: 20e712244071028b0f75ccad477308efd139261f
2021-10-08 17:55:55 +00:00
John Sully 3124a1ea1e disable key cache during load if necessary
Former-commit-id: 68dcf66909e2138da4902bdec98985f4fcd737cf
2021-10-04 07:35:36 +00:00
John Sully a31a268d26 disable key cache during load if necessary
Former-commit-id: 68dcf66909e2138da4902bdec98985f4fcd737cf
2021-10-04 07:35:36 +00:00
John Sully e27091d82e Handle the case where the key cache exceeds maxmemory
Former-commit-id: 01febf902267fec7fe87e6437b0b81fd08b50963
2021-10-04 07:34:05 +00:00
John Sully 0c314de03c Handle the case where the key cache exceeds maxmemory
Former-commit-id: 01febf902267fec7fe87e6437b0b81fd08b50963
2021-10-04 07:34:05 +00:00
John Sully 4ff8bfd313 Don't expand the dictionary if a storage provider is set as we won't use the whole thing
Former-commit-id: 1f07b01144397cec59ec2d94f41c85eceb7248e2
2021-10-04 07:33:38 +00:00
John Sully bcfe5b365a Don't expand the dictionary if a storage provider is set as we won't use the whole thing
Former-commit-id: 1f07b01144397cec59ec2d94f41c85eceb7248e2
2021-10-04 07:33:38 +00:00
John Sully ce814741f1 Use the concurrentqueue for multithread load instead of mutex and cvs
Former-commit-id: d5a59113dbfedaf7b62a650cff58a2e8ec01826f
2021-10-04 07:33:03 +00:00
John Sully e69932bea5 Use the concurrentqueue for multithread load instead of mutex and cvs
Former-commit-id: d5a59113dbfedaf7b62a650cff58a2e8ec01826f
2021-10-04 07:33:03 +00:00
John Sully 55c2f5ca76 Add in the concurrentqueue
Former-commit-id: 319cad462be502b0b7a8c45b634d578b2c1c4e9d
2021-10-02 18:27:21 +00:00
John Sully f65fb39f31 Add in the concurrentqueue
Former-commit-id: 319cad462be502b0b7a8c45b634d578b2c1c4e9d
2021-10-02 18:27:21 +00:00
jsully 78dffa7e77 Merge branch 'improve_overwrite_performance' into 'keydbpro'
Improve overwrite performance

See merge request external-collab/keydb-pro-6!4

Former-commit-id: 7e59e889f28e30fca409dfb951c31f8cb47effbd
2021-09-28 18:13:12 +00:00
jsully ceb86c4601 Merge branch 'improve_overwrite_performance' into 'keydbpro'
Improve overwrite performance

See merge request external-collab/keydb-pro-6!4

Former-commit-id: 7e59e889f28e30fca409dfb951c31f8cb47effbd
2021-09-28 18:13:12 +00:00
John Sully 3bde7eb463 Revert "Don't zero out potentially long buffers" - It has no benefit above the noise floor and potentially is the cause of a multithread slowdown
This reverts commit d68c35c275 [formerly 91e76ab4a00546278100baf6dfe61c13e802b40e].


Former-commit-id: f651cf67d731a10c3a52e30261c8d8b9d291576c
2021-09-28 18:08:15 +00:00
John Sully f898bbb3d6 Revert "Don't zero out potentially long buffers" - It has no benefit above the noise floor and potentially is the cause of a multithread slowdown
This reverts commit d68c35c275 [formerly 91e76ab4a00546278100baf6dfe61c13e802b40e].


Former-commit-id: f651cf67d731a10c3a52e30261c8d8b9d291576c
2021-09-28 18:08:15 +00:00
malavan 81fffaaaac add hmset and hmget to keydb-benchmark
Former-commit-id: e05466c362ba01e61cf007ad8bfc26e1af21ec4f
2021-09-23 20:53:27 +00:00
malavan dd8074e436 add hmset and hmget to keydb-benchmark
Former-commit-id: e05466c362ba01e61cf007ad8bfc26e1af21ec4f
2021-09-23 20:53:27 +00:00
malavan d0ca3bfd58 add async tag to hgwtall hkeys hvals hscan
Former-commit-id: 8534de27603bd4cbd10a087840bcb1a90651afa1
2021-09-23 20:18:38 +00:00
malavan a6d0611e6b add async tag to hgwtall hkeys hvals hscan
Former-commit-id: 8534de27603bd4cbd10a087840bcb1a90651afa1
2021-09-23 20:18:38 +00:00
malavan 4ea2524647 add async lookup to hmget
Former-commit-id: a967b47b60e3f4efbc945dc44a0903f47e07993f
2021-09-23 19:57:18 +00:00
malavan 3745a37a30 add async lookup to hmget
Former-commit-id: a967b47b60e3f4efbc945dc44a0903f47e07993f
2021-09-23 19:57:18 +00:00
malavan d37a6af91b Merge branch 'async_commands' of https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro into async_commands
Former-commit-id: a19112ec839da4684aeb1a9d1b41906f4c698944
2021-09-23 17:48:33 +00:00
malavan 1210b92720 Merge branch 'async_commands' of https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro into async_commands
Former-commit-id: a19112ec839da4684aeb1a9d1b41906f4c698944
2021-09-23 17:48:33 +00:00
John Sully 21a3f7ff89 Rework the tuning to be better for mixed read/write workloads
Former-commit-id: a4fdd3e3cb41160b20e92e1b1f4f4ebd2ee86a4a
2021-09-23 17:46:56 +00:00
John Sully e7fafc1bdd Rework the tuning to be better for mixed read/write workloads
Former-commit-id: a4fdd3e3cb41160b20e92e1b1f4f4ebd2ee86a4a
2021-09-23 17:46:56 +00:00
John Sully 7588b680ea Move the snapshot stale threshold to a named constant
Former-commit-id: 46d2aaf17abb0fb021aa6d7b393ffc143493d339
2021-09-23 17:45:49 +00:00
John Sully c05d7920a5 Move the snapshot stale threshold to a named constant
Former-commit-id: 46d2aaf17abb0fb021aa6d7b393ffc143493d339
2021-09-23 17:45:49 +00:00
John Sully 7e7049a517 prefetch crashes intermittently when a snapshot exists
Former-commit-id: 4a2657023d5d8218c815ce77c2676fd53a634b3f
2021-09-23 17:44:06 +00:00
John Sully 9ea336c4d3 prefetch crashes intermittently when a snapshot exists
Former-commit-id: 4a2657023d5d8218c815ce77c2676fd53a634b3f
2021-09-23 17:44:06 +00:00
malavan 713fa45330 prev_error_count needs to be thread local
Former-commit-id: 4abede1c40db1dfb4235b9aa1e3177678c5304b1
2021-09-23 17:41:28 +00:00
malavan 54761129e2 prev_error_count needs to be thread local
Former-commit-id: 4abede1c40db1dfb4235b9aa1e3177678c5304b1
2021-09-23 17:41:28 +00:00
John Sully 7fea970ccd Async commands incorrectly think they are dirty
Former-commit-id: 4874247931425767156ab3da934c00a4d4832bcf
2021-09-23 05:24:28 +00:00
John Sully 1b84c01751 Async commands incorrectly think they are dirty
Former-commit-id: 4874247931425767156ab3da934c00a4d4832bcf
2021-09-23 05:24:28 +00:00
John Sully 5d2724a46c Create snapshots less often, and use them if they exist
Former-commit-id: ba8a00074171d346813247de0b218e08c8f07b92
2021-09-23 00:19:52 +00:00
John Sully 49e88de93b Create snapshots less often, and use them if they exist
Former-commit-id: ba8a00074171d346813247de0b218e08c8f07b92
2021-09-23 00:19:52 +00:00
John Sully cbe71597e8 Clients should initialize with an mvcc checkpoint
Former-commit-id: 5183cb721774be1b769d130359e4bddb1eb8224b
2021-09-23 00:15:47 +00:00
John Sully 6edb7d0c82 Clients should initialize with an mvcc checkpoint
Former-commit-id: 5183cb721774be1b769d130359e4bddb1eb8224b
2021-09-23 00:15:47 +00:00
malavan a96e659e46 update expire tests for async commands
Former-commit-id: 088ecd30a7b360e63d701f811f2fc0b9d77f5eb0
2021-09-22 21:49:30 +00:00
malavan fd59d31a07 update expire tests for async commands
Former-commit-id: 088ecd30a7b360e63d701f811f2fc0b9d77f5eb0
2021-09-22 21:49:30 +00:00
malavan 139a9ba071 make keyIsExpired check earlier on async read
Former-commit-id: 32dbfbb3a69681553b65afa2d05ea47058833550
2021-09-22 21:16:36 +00:00
malavan 540c2ddcb4 make keyIsExpired check earlier on async read
Former-commit-id: 32dbfbb3a69681553b65afa2d05ea47058833550
2021-09-22 21:16:36 +00:00
malavan fa21ad8141 remove unneeded mgetCore function
Former-commit-id: 7961d4253b5a356e24d17ab07ac79ba1bf191efd
2021-09-22 21:15:47 +00:00
malavan acf1b34120 remove unneeded mgetCore function
Former-commit-id: 7961d4253b5a356e24d17ab07ac79ba1bf191efd
2021-09-22 21:15:47 +00:00
malavan 8e868739a2 check if key is expired for async lookup
Former-commit-id: d4e3a2688e903fe426e791f8608495fca1c76df6
2021-09-22 19:30:38 +00:00
malavan 5cec478fc1 check if key is expired for async lookup
Former-commit-id: d4e3a2688e903fe426e791f8608495fca1c76df6
2021-09-22 19:30:38 +00:00
malavan 066710c7d9 Merge branch 'async_commands' of https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro into async_commands
Former-commit-id: 393add1f3d70f7d1e09ecbce60c65508bc06394d
2021-09-22 19:28:37 +00:00
malavan e3c4f7a727 Merge branch 'async_commands' of https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro into async_commands
Former-commit-id: 393add1f3d70f7d1e09ecbce60c65508bc06394d
2021-09-22 19:28:37 +00:00
John Sully 181dc2c99e We can't evict in an async command
Former-commit-id: 39c2903cbca08c2dbfc3275f83d65e6360c61651
2021-09-22 19:26:30 +00:00
John Sully 66c4ff5d09 We can't evict in an async command
Former-commit-id: 39c2903cbca08c2dbfc3275f83d65e6360c61651
2021-09-22 19:26:30 +00:00
John Sully 2e853d6471 We returned too early and didn't set the mvcc
Former-commit-id: d8e2ffe538a6b237529c37cb142a7076dd4836f8
2021-09-22 19:25:57 +00:00
John Sully faf2801ac8 We returned too early and didn't set the mvcc
Former-commit-id: d8e2ffe538a6b237529c37cb142a7076dd4836f8
2021-09-22 19:25:57 +00:00
John Sully 1c7972a7b1 We can't do a command async if there are monitors because we need the lock
Former-commit-id: c5b6ade51251a3f57b69d1f3d9c22b199ec00a69
2021-09-22 19:24:39 +00:00
John Sully 34d9280a02 We can't do a command async if there are monitors because we need the lock
Former-commit-id: c5b6ade51251a3f57b69d1f3d9c22b199ec00a69
2021-09-22 19:24:39 +00:00
malavan 0e0c1109c1 Merge branch 'async_commands' of https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro into async_commands
Former-commit-id: d6cc79a80d0bd22c99e3ea21740c89870cfb235b
2021-09-21 22:00:33 +00:00
malavan d2c165bbef Merge branch 'async_commands' of https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro into async_commands
Former-commit-id: d6cc79a80d0bd22c99e3ea21740c89870cfb235b
2021-09-21 22:00:33 +00:00
John Sully d09ce2e2be Make tests deterministic and fix an issue found
Former-commit-id: fd00f39f3ca11053a5c99ab52daa1f9a051b7058
2021-09-21 21:59:19 +00:00
John Sully e8b909042f Make tests deterministic and fix an issue found
Former-commit-id: fd00f39f3ca11053a5c99ab52daa1f9a051b7058
2021-09-21 21:59:19 +00:00
John Sully 41741c85fe Improve low load latency
Former-commit-id: f5ac2432cf58c697a6da101d63423679cbd08021
2021-09-21 21:15:21 +00:00
John Sully 29235288e0 Improve low load latency
Former-commit-id: f5ac2432cf58c697a6da101d63423679cbd08021
2021-09-21 21:15:21 +00:00
malavan a4e54d20d7 add mget to keydb-benchmark
Former-commit-id: 6bd15f65c46f570f66d58bd759e1c595006d783a
2021-09-21 20:57:08 +00:00
malavan 89c43a5538 add mget to keydb-benchmark
Former-commit-id: 6bd15f65c46f570f66d58bd759e1c595006d783a
2021-09-21 20:57:08 +00:00
John Sully 5f5f985fb3 Make async commands runtime configurable
Former-commit-id: 23bafb5f7c3c9805581f4bf09d9d5136898c2883
2021-09-21 20:49:44 +00:00
John Sully 91b401786a Make async commands runtime configurable
Former-commit-id: 23bafb5f7c3c9805581f4bf09d9d5136898c2883
2021-09-21 20:49:44 +00:00
John Sully 8418a8edf1 Initial implementation of async commands
Former-commit-id: 0d3a4ce7e60c42b2d81962f13100bd1789bf64a8
2021-09-21 20:43:16 +00:00
John Sully 52868b1aa9 Initial implementation of async commands
Former-commit-id: 0d3a4ce7e60c42b2d81962f13100bd1789bf64a8
2021-09-21 20:43:16 +00:00
John Sully e024ab30e1 Unify job types so everything is processed in order
Former-commit-id: 625aa97e4cf16337e8b052b7a27491a0ab09110f
2021-09-17 17:27:19 +00:00
John Sully af70c35a8d Unify job types so everything is processed in order
Former-commit-id: 625aa97e4cf16337e8b052b7a27491a0ab09110f
2021-09-17 17:27:19 +00:00
Malavan Sotheeswaran a5ea2fa628 Merge fix to dict resize during rdb load
Former-commit-id: c398d5f8a027c67acac64bdbfbd01486dde555eb
2021-09-17 16:10:48 +00:00
Malavan Sotheeswaran 6ccffe6768 Merge fix to dict resize during rdb load
Former-commit-id: c398d5f8a027c67acac64bdbfbd01486dde555eb
2021-09-17 16:10:48 +00:00
Maxime de Roucy 2e75402668 syslog: enforce syslog identity and facility as soon as possible
Former-commit-id: 3943274f012cfe45d0cff8c77709549768abd735
2021-09-16 17:29:55 -04:00
Maxime de Roucy c85b507f9e use LL_… log level instead of syslog LOG_… log level
Else there is an out of bound access in syslogLevelMap.

For example if we use `serverLog(LOG_INFO,…`, later in the code
it tries to access `syslogLevelMap[LOG_INFO]`.
LOG_INFO == 6 but syslogLevelMap only have 4 elements.


Former-commit-id: 1033a942491c6b7d2587d3c1a228802cb48ef3eb
2021-09-16 17:29:07 -04:00
malavan 68997c6185 if statement was actually correct
Former-commit-id: d44b99afdf1ec92f8a36f0c091c37328008d867b
2021-09-14 17:17:08 +00:00
malavan dc39cb621c if statement was actually correct
Former-commit-id: d44b99afdf1ec92f8a36f0c091c37328008d867b
2021-09-14 17:17:08 +00:00
malavan d018678d4c the if statement was actually correct
Former-commit-id: 8e4d1ceb859b3440bdec525ff7b8ed4aef86f4b8
2021-09-14 17:15:44 +00:00
malavan ba2934e910 the if statement was actually correct
Former-commit-id: 8e4d1ceb859b3440bdec525ff7b8ed4aef86f4b8
2021-09-14 17:15:44 +00:00
malavan 1f0504cb2d improve overwrite key performance
Former-commit-id: 56f9d5528385ea78074a308c6d3987b920d6cc35
2021-09-14 17:06:04 +00:00
malavan 53d5fcfd32 improve overwrite key performance
Former-commit-id: 56f9d5528385ea78074a308c6d3987b920d6cc35
2021-09-14 17:06:04 +00:00
malavan 808af8f2b0 missing brackets in databasesCron rehash check
Former-commit-id: f2f0d5287edda676a514cbc02172bb874569016b
2021-09-14 02:03:18 +00:00
malavan d8710c2bf4 missing brackets in databasesCron rehash check
Former-commit-id: f2f0d5287edda676a514cbc02172bb874569016b
2021-09-14 02:03:18 +00:00
John Sully d68c35c275 Don't zero out potentially long buffers
Former-commit-id: 91e76ab4a00546278100baf6dfe61c13e802b40e
2021-09-10 00:40:08 +00:00
John Sully e68e4ab43c Don't zero out potentially long buffers
Former-commit-id: 91e76ab4a00546278100baf6dfe61c13e802b40e
2021-09-10 00:40:08 +00:00
John Sully 53779eedd8 In single thread mode don't batch
Former-commit-id: 7daadae789cdca6f0eb0c3f553737d4f8efc0566
2021-09-10 00:39:47 +00:00
John Sully bd487470a7 In single thread mode don't batch
Former-commit-id: 7daadae789cdca6f0eb0c3f553737d4f8efc0566
2021-09-10 00:39:47 +00:00
John Sully 00b9db481d Don't zero out potentially long buffers
Former-commit-id: 99eb47e129a3cd555914d4816febb02f0058253a
2021-09-10 00:38:49 +00:00
John Sully fef5c11e59 Don't zero out potentially long buffers
Former-commit-id: 99eb47e129a3cd555914d4816febb02f0058253a
2021-09-10 00:38:49 +00:00
John Sully de2b87f711 In single thread mode don't batch
Former-commit-id: b1cb230690a584b8bfe7f433fc0ca0320877ebd3
2021-09-10 00:38:08 +00:00
John Sully 5b1533cf0c In single thread mode don't batch
Former-commit-id: b1cb230690a584b8bfe7f433fc0ca0320877ebd3
2021-09-10 00:38:08 +00:00
John Sully 674b80027b Merge branch 'keydbpro' of https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro into keydbpro
Former-commit-id: 026e939db2897701d936487ca30dd1c30feb299b
2021-09-09 19:35:08 +00:00
John Sully 44265b3ed3 Merge branch 'keydbpro' of https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro into keydbpro
Former-commit-id: 026e939db2897701d936487ca30dd1c30feb299b
2021-09-09 19:35:08 +00:00
malavan f8b56f73e9 Merge branch 'keydbpro' of https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro into keydbpro
Former-commit-id: f0025394aed6f72a8c678be0da7c42d5e4fad1d9
2021-09-08 21:16:41 +00:00
malavan cbc293e7d8 Merge branch 'keydbpro' of https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro into keydbpro
Former-commit-id: f0025394aed6f72a8c678be0da7c42d5e4fad1d9
2021-09-08 21:16:41 +00:00
malavan 72313d3ef2 add command arg to clientArgs helper
Former-commit-id: b6f388ee3bd269bd8373ea16adb379ec6922ee0a
2021-09-08 21:16:04 +00:00
malavan 25e0c3d199 add command arg to clientArgs helper
Former-commit-id: b6f388ee3bd269bd8373ea16adb379ec6922ee0a
2021-09-08 21:16:04 +00:00
jsully 1cb9a290f1 Merge branch 'async_mget' into 'keydbpro'
add async mget

See merge request keydb-dev/KeyDB-Pro!38

Former-commit-id: e315b39f4779d530f5ab93e1f15915211e6706e2
2021-09-08 19:08:23 +00:00
jsully 8b7117a456 Merge branch 'async_mget' into 'keydbpro'
add async mget

See merge request keydb-dev/KeyDB-Pro!38

Former-commit-id: e315b39f4779d530f5ab93e1f15915211e6706e2
2021-09-08 19:08:23 +00:00
benschermel ff3a0dc914 update deb packaging to build with systemd flag
Former-commit-id: e3c0c99427077cb7a75abc772727efdbc7aba6f4
2021-09-08 02:28:17 +00:00
John Sully 3b40a64ada Merge branch 'keydbpro' of https://gitlab.eqalpha.com/external-collab/keydb-pro-6 into keydbpro_collab
Former-commit-id: 067acbbfd5eb0c2b4515a5d2cc87970870a88acb
2021-09-03 17:20:54 +00:00
John Sully c87e22966d Merge branch 'keydbpro' of https://gitlab.eqalpha.com/external-collab/keydb-pro-6 into keydbpro_collab
Former-commit-id: 067acbbfd5eb0c2b4515a5d2cc87970870a88acb
2021-09-03 17:20:54 +00:00
malavan bb1def0637 don't use flags that aren't supported by certain versions of OPENSSL
Former-commit-id: ca7342948fb12804905219ae106b4722368e9a2f
2021-09-02 19:06:35 +00:00
malavan 4a7e7a37a8 don't use flags that aren't supported by certain versions of OPENSSL
Former-commit-id: ca7342948fb12804905219ae106b4722368e9a2f
2021-09-02 19:06:35 +00:00
malavan b496ee8869 Remove duplicate code
Former-commit-id: a4c3182afb71a0d7d6d25111c0e0cfe5dcfc6130
2021-09-02 19:06:12 +00:00
malavan a64a97a9db Remove duplicate code
Former-commit-id: a4c3182afb71a0d7d6d25111c0e0cfe5dcfc6130
2021-09-02 19:06:12 +00:00
malavan 9f1a5fddca updates from comments
Former-commit-id: 852885f09e7df1d9570408546baffa8545707335
2021-09-01 21:00:27 +00:00
malavan 4d01b20c71 updates from comments
Former-commit-id: 852885f09e7df1d9570408546baffa8545707335
2021-09-01 21:00:27 +00:00
malavan 723bf0fa61 refactor asyncCommand
Former-commit-id: 6af5775e01872f130bc18791fdb4c0b22507b37f
2021-09-01 20:18:41 +00:00
malavan c8cbbb9e66 refactor asyncCommand
Former-commit-id: 6af5775e01872f130bc18791fdb4c0b22507b37f
2021-09-01 20:18:41 +00:00
jsully 85f07748e0 Merge branch 'add_storage_provider_data_to_INFO' into 'keydbpro'
add stats for storage provider reads

See merge request keydb-dev/KeyDB-Pro!39

Former-commit-id: 07bb08a8bc89350f4addb9dfd77435217c6b46d5
2021-09-01 19:21:05 +00:00
jsully cac4cc781b Merge branch 'add_storage_provider_data_to_INFO' into 'keydbpro'
add stats for storage provider reads

See merge request keydb-dev/KeyDB-Pro!39

Former-commit-id: 07bb08a8bc89350f4addb9dfd77435217c6b46d5
2021-09-01 19:21:05 +00:00
John Sully 629289b968 We need to send keepalives to masters while waiting to prevent disconnects
Former-commit-id: 7cbd6758b1042198c14ca9e8da0f1f7bc05df93d
2021-09-01 04:15:59 +00:00
John Sully c7ca6a6b2f We need to send keepalives to masters while waiting to prevent disconnects
Former-commit-id: 7cbd6758b1042198c14ca9e8da0f1f7bc05df93d
2021-09-01 04:15:59 +00:00
John Sully 7d2db15a8c Don't be in tracking mode during load as processChangesAsync works outside the normal system
Former-commit-id: 8d31ce6eafea1cea2f9f4ea25e44306efef28fa3
2021-09-01 04:15:28 +00:00
John Sully 65a39cafa2 Don't be in tracking mode during load as processChangesAsync works outside the normal system
Former-commit-id: 8d31ce6eafea1cea2f9f4ea25e44306efef28fa3
2021-09-01 04:15:28 +00:00
malavan 9fe5c2d9c3 remove unused variable names
Former-commit-id: 18d688c2f04a8ce67409bd4442c7635d426fc0ac
2021-08-31 20:03:55 +00:00
malavan 81a8601bac remove unused variable names
Former-commit-id: 18d688c2f04a8ce67409bd4442c7635d426fc0ac
2021-08-31 20:03:55 +00:00
malavan f0abffc8dc add method to get client args as list
Former-commit-id: 576b8cd2153c48c0ca4dfc9ed7d12f77d6f76f7e
2021-08-30 21:09:22 +00:00
malavan d37fbca781 add method to get client args as list
Former-commit-id: 576b8cd2153c48c0ca4dfc9ed7d12f77d6f76f7e
2021-08-30 21:09:22 +00:00
malavan 200b59255e add stats for storage provider reads
Former-commit-id: 612393ffba43cda31443605de924dc8dcf77ef52
2021-08-26 19:45:33 +00:00
malavan 8b39179226 add stats for storage provider reads
Former-commit-id: 612393ffba43cda31443605de924dc8dcf77ef52
2021-08-26 19:45:33 +00:00
malavan 65153ee9bb add correct thread assert to client::asyncCommand
Former-commit-id: a892fb4d551fb58d619bc80c333a6b3a9ed34215
2021-08-26 14:23:13 +00:00
malavan 849321ecbf add correct thread assert to client::asyncCommand
Former-commit-id: a892fb4d551fb58d619bc80c333a6b3a9ed34215
2021-08-26 14:23:13 +00:00
malavan 5124516913 add correct thread assert to client::asyncCommand
Former-commit-id: 8970f832348a80db6c183d25c4a5342a258a6ba9
2021-08-26 13:58:12 +00:00
malavan 522059e189 add correct thread assert to client::asyncCommand
Former-commit-id: 8970f832348a80db6c183d25c4a5342a258a6ba9
2021-08-26 13:58:12 +00:00
malavan 7632e6b2b1 refactor scan to use client::asyncCommand
Former-commit-id: 4de596631f48626b770d0217c7ff21001ea46bcf
2021-08-26 13:55:32 +00:00
malavan ceec387496 refactor scan to use client::asyncCommand
Former-commit-id: 4de596631f48626b770d0217c7ff21001ea46bcf
2021-08-26 13:55:32 +00:00
malavan 1aee0036b5 refactor of asyncCommand to include snapshot creation
Former-commit-id: c0908362162b5f2834b90cd9ce84fd1ee6768834
2021-08-26 13:10:59 +00:00
malavan a670a3c99a refactor of asyncCommand to include snapshot creation
Former-commit-id: c0908362162b5f2834b90cd9ce84fd1ee6768834
2021-08-26 13:10:59 +00:00
malavan a5f2d943db change indentation and increase async mget threshold
Former-commit-id: ffaa176d5eafabfae372224c790e99dd9e520fef
2021-08-25 22:15:28 +00:00
malavan 6005b2e726 change indentation and increase async mget threshold
Former-commit-id: ffaa176d5eafabfae372224c790e99dd9e520fef
2021-08-25 22:15:28 +00:00
malavan 65ae26cc51 refactor async to offload common code to client
Former-commit-id: 9a7547bfaa0ceff76e604262913fb11a64c627d8
2021-08-25 20:06:06 +00:00
malavan 0f3af2427a refactor async to offload common code to client
Former-commit-id: 9a7547bfaa0ceff76e604262913fb11a64c627d8
2021-08-25 20:06:06 +00:00
malavan a57fb88656 Merge branch 'keydbpro' into async_mget
Former-commit-id: ae34d0b6324ebd9d2d52342c06b3fd49f110210c
2021-08-25 19:37:33 +00:00
malavan a769f99b1e Merge branch 'keydbpro' into async_mget
Former-commit-id: ae34d0b6324ebd9d2d52342c06b3fd49f110210c
2021-08-25 19:37:33 +00:00
jsully 1a9448fd9d Merge branch 'upgrade_rocksdb' into 'keydbpro'
upgrade to latest version of rocksdb

See merge request keydb-dev/KeyDB-Pro!34

Former-commit-id: 74c39b237ee0f9ff98a6cc8e3e4fbf70a3ee00ac
2021-08-25 19:08:19 +00:00
jsully d12ad5ee03 Merge branch 'upgrade_rocksdb' into 'keydbpro'
upgrade to latest version of rocksdb

See merge request keydb-dev/KeyDB-Pro!34

Former-commit-id: 74c39b237ee0f9ff98a6cc8e3e4fbf70a3ee00ac
2021-08-25 19:08:19 +00:00
malavan fd22e8bcd4 update gitlab ci to work with facebook repo instead of ours
Former-commit-id: 2745277e7591076373e2dfd4eef8c1412cffffbc
2021-08-24 22:07:21 +00:00
malavan cfea171619 update gitlab ci to work with facebook repo instead of ours
Former-commit-id: 2745277e7591076373e2dfd4eef8c1412cffffbc
2021-08-24 22:07:21 +00:00
malavan cdc806b9e3 use latest stable version
Former-commit-id: 792f72cb513fc6db58d824649478ee36d47631eb
2021-08-24 22:00:52 +00:00
malavan a318a0a665 use latest stable version
Former-commit-id: 792f72cb513fc6db58d824649478ee36d47631eb
2021-08-24 22:00:52 +00:00
malavan 957ea27b0c Merge branch 'keydbpro' into upgrade_rocksdb
Former-commit-id: 1bf9d7e749e7007f1309f3e57e366122fdbacbac
2021-08-24 21:54:01 +00:00
malavan 0445fca9aa Merge branch 'keydbpro' into upgrade_rocksdb
Former-commit-id: 1bf9d7e749e7007f1309f3e57e366122fdbacbac
2021-08-24 21:54:01 +00:00
malavan 1ffbe014ae add async mget
Former-commit-id: c7bd2327f8e4330e2bcd857fc87ce7e86e075d20
2021-08-24 21:44:17 +00:00
malavan 141c5fdf93 add async mget
Former-commit-id: c7bd2327f8e4330e2bcd857fc87ce7e86e075d20
2021-08-24 21:44:17 +00:00
malavan 801b75d105 add a few more flash tests
Former-commit-id: b19fdc23a9a39ae718580feae5049f6906caec28
2021-08-23 21:30:16 +00:00
malavan 6067fdf9b3 add a few more flash tests
Former-commit-id: b19fdc23a9a39ae718580feae5049f6906caec28
2021-08-23 21:30:16 +00:00
benschermel 2fef45cd96 fix service install
Former-commit-id: c43cec74178d8bf35143f3f4148dbe3c37a75f90
2021-08-23 18:41:43 +00:00
benschermel 720a87c7b7 fix service install
Former-commit-id: c43cec74178d8bf35143f3f4148dbe3c37a75f90
2021-08-23 18:41:43 +00:00
malavan 64202ff83f newest version of rocksdb
Former-commit-id: e384baa62e50a5caa0cdc779f2b8554ce8d8b375
2021-08-23 17:04:01 +00:00
malavan 56f9927b84 newest version of rocksdb
Former-commit-id: e384baa62e50a5caa0cdc779f2b8554ce8d8b375
2021-08-23 17:04:01 +00:00
benschermel df6f42cfe4 fix service install
Former-commit-id: 41bf39f6e92beb8ab55ec0e7652154bc43d48774
2021-08-23 03:39:16 +00:00
benschermel 09af258023 fix service install
Former-commit-id: 41bf39f6e92beb8ab55ec0e7652154bc43d48774
2021-08-23 03:39:16 +00:00
benschermel b0a9b98919 update pkg conf file
Former-commit-id: f87945cbbd2a475394f584b09b15c2c19db5e9bd
2021-08-22 22:29:42 +00:00
benschermel f37928f174 update pkg conf file
Former-commit-id: f87945cbbd2a475394f584b09b15c2c19db5e9bd
2021-08-22 22:29:42 +00:00
benschermel 1eb871c9b4 update pkg conf file
Former-commit-id: 2a2ae61f07ecea8a178f4bc478bb7786d5be27d9
2021-08-22 22:28:18 +00:00
benschermel c1df13b946 update pkg conf file
Former-commit-id: 2a2ae61f07ecea8a178f4bc478bb7786d5be27d9
2021-08-22 22:28:18 +00:00
benschermel b1ee0d9275 update pkg conf file
Former-commit-id: da5df78872d941fe8734947b6fa5f1ecf66e2643
2021-08-22 22:21:34 +00:00
benschermel 1cdd0cc1ad update pkg conf file
Former-commit-id: 99f8caa626b46d9615cc2ce8cd4b9084fa1a9282
2021-08-22 22:18:22 +00:00
Malavan Sotheeswaran 25025bb4ff Merge branch 'keydbpro' into 'PRO_RELEASE_6'
Keydbpro

See merge request keydb-dev/KeyDB-Pro!37

Former-commit-id: e6a130e4a02b3d0cc2fcaeb0ab24e23cb60a7181
2021-08-19 19:11:04 +00:00
Malavan Sotheeswaran 207ea3dc4f Merge branch 'keydbpro' into 'PRO_RELEASE_6'
Keydbpro

See merge request keydb-dev/KeyDB-Pro!37

Former-commit-id: e6a130e4a02b3d0cc2fcaeb0ab24e23cb60a7181
2021-08-19 19:11:04 +00:00
malavan 8391e7899e Merge branch 'keydbpro' of https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro into keydbpro
Former-commit-id: 4059f9c2396f0fa517ac2946ad5f0e45039c00e6
2021-08-19 18:24:29 +00:00
malavan c5c1d03708 Merge branch 'keydbpro' of https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro into keydbpro
Former-commit-id: 4059f9c2396f0fa517ac2946ad5f0e45039c00e6
2021-08-19 18:24:29 +00:00
malavan 4fdb059d6e switch to new patch of rocksdb that fixes archlinux build
Former-commit-id: e2e5b5320e5c1b89ec2a3f946826097b819f6593
2021-08-19 18:24:01 +00:00
malavan 86c3fec4c0 switch to new patch of rocksdb that fixes archlinux build
Former-commit-id: e2e5b5320e5c1b89ec2a3f946826097b819f6593
2021-08-19 18:24:01 +00:00
Malavan Sotheeswaran 3279490892 Merge branch 'patch_rocks_db' into 'keydbpro'
public copy of rocksdb

See merge request keydb-dev/KeyDB-Pro!36

Former-commit-id: 4421396764688f7df2c967974f6a3b5dca28e3f5
2021-08-19 18:08:16 +00:00
Malavan Sotheeswaran 27c1c0a846 Merge branch 'patch_rocks_db' into 'keydbpro'
public copy of rocksdb

See merge request keydb-dev/KeyDB-Pro!36

Former-commit-id: 4421396764688f7df2c967974f6a3b5dca28e3f5
2021-08-19 18:08:16 +00:00
Malavan Sotheeswaran 75b0886fca Merge branch 'keydbpro' into 'patch_rocks_db'
# Conflicts:
#   .gitmodules

Former-commit-id: aec26e46d3b3617a57edd42d996f7598de5bfe4e
2021-08-19 17:57:52 +00:00
Malavan Sotheeswaran da55439b32 Merge branch 'keydbpro' into 'patch_rocks_db'
# Conflicts:
#   .gitmodules

Former-commit-id: aec26e46d3b3617a57edd42d996f7598de5bfe4e
2021-08-19 17:57:52 +00:00
malavan 40062589ad use --init instead of git submodule init
Former-commit-id: 967866c56c9d4590d72c63169d0e3c32c21b24e0
2021-08-19 17:47:23 +00:00
malavan 5814135960 use --init instead of git submodule init
Former-commit-id: 967866c56c9d4590d72c63169d0e3c32c21b24e0
2021-08-19 17:47:23 +00:00
malavan e429219a07 use --init instead of git submodule init
Former-commit-id: e5582ddf313a6bdd2ae0cb68da980954caf83e1b
2021-08-19 17:45:37 +00:00
malavan c358285cfe use --init instead of git submodule init
Former-commit-id: e5582ddf313a6bdd2ae0cb68da980954caf83e1b
2021-08-19 17:45:37 +00:00
malavan 6b0e96ea98 add branch for git submodule
Former-commit-id: b4471308f1cf99b0a5a4c8c8da8ccf9546123e3f
2021-08-19 17:42:52 +00:00
malavan 61c180d1f9 add branch for git submodule
Former-commit-id: b4471308f1cf99b0a5a4c8c8da8ccf9546123e3f
2021-08-19 17:42:52 +00:00
malavan bc124e3955 public copy of rocksdb
Former-commit-id: 50bbadcab6d2911fb9cbe15aef03c9762aa91280
2021-08-19 17:22:09 +00:00
malavan 32d8617ee2 public copy of rocksdb
Former-commit-id: 50bbadcab6d2911fb9cbe15aef03c9762aa91280
2021-08-19 17:22:09 +00:00
Malavan Sotheeswaran 664c7d65fd Revert "Merge branch 'patch_rocks_db' into 'keydbpro'"
This reverts merge request !35

Former-commit-id: 8ee1c251de5687fdcf8af740766d2968163bc8e9
2021-08-18 22:47:38 +00:00
Malavan Sotheeswaran bc323665c1 Revert "Merge branch 'patch_rocks_db' into 'keydbpro'"
This reverts merge request !35

Former-commit-id: 8ee1c251de5687fdcf8af740766d2968163bc8e9
2021-08-18 22:47:38 +00:00
Malavan Sotheeswaran d5f2287676 Merge branch 'patch_rocks_db' into 'keydbpro'
Patch rocks db, switch to private clone of rocksdb

See merge request keydb-dev/KeyDB-Pro!35

Former-commit-id: 08155fa62332a9e9d3046796cb378e04405c6ca7
2021-08-18 22:07:56 +00:00
Malavan Sotheeswaran 4cfaf92187 Merge branch 'patch_rocks_db' into 'keydbpro'
Patch rocks db, switch to private clone of rocksdb

See merge request keydb-dev/KeyDB-Pro!35

Former-commit-id: 08155fa62332a9e9d3046796cb378e04405c6ca7
2021-08-18 22:07:56 +00:00
malavan 2492a7fff6 use our own clone of rocksdb
Former-commit-id: 1de8a88679faa94d14875655305e6102289556a0
2021-08-18 21:53:55 +00:00
malavan 0cc976346c use our own clone of rocksdb
Former-commit-id: 1de8a88679faa94d14875655305e6102289556a0
2021-08-18 21:53:55 +00:00
malavan 56768b2b15 use our own clone of rocksdb
Former-commit-id: 0aeceb2a8c487eea43d47497647d4e38a3478ca7
2021-08-18 21:46:16 +00:00
malavan 3200249f63 use our own clone of rocksdb
Former-commit-id: 0aeceb2a8c487eea43d47497647d4e38a3478ca7
2021-08-18 21:46:16 +00:00
MalavanEQAlpha 1391594708 Merge pull request #313 from MalavanEQAlpha/fixissue295
Resolve Issue #295 by speeding up keyIsExpired and setting timeout on subkey expires.

Former-commit-id: 92b6603f5f16872268f7be6d7c9068873c932094
2021-08-18 17:34:18 -04:00
malavan 3f1cca0c27 should use LLONG_MAX for INVALID_EXPIRE not LLONG_MIN and add better comments
Former-commit-id: efe9a1533d02b3f0e5a09d314875c3ab3f71928f
2021-08-18 20:59:01 +00:00
malavan 0a990c07a3 patch rocksdb to fix archlinux build
Former-commit-id: b3c6e4f6353935545dca73cbc103fac9f3da7c42
2021-08-18 20:13:53 +00:00
malavan 8d37656252 patch rocksdb to fix archlinux build
Former-commit-id: b3c6e4f6353935545dca73cbc103fac9f3da7c42
2021-08-18 20:13:53 +00:00
VivekSainiEQ 9c9aa770db Include gperftools/tcmalloc.h instead of google/tcmalloc.h
Former-commit-id: 3575ede449cd6442ccd38b5d68c20f0154c597b1
2021-08-18 15:40:09 -04:00
John Sully f00e6c6ea9 Solo tests should work with loopn
Former-commit-id: 669ac986a1cb3f926eb0ecd867acc6827ebffcb0
2021-08-18 15:08:10 -04:00
malavan 0df4068911 upgrade to latest version of rocksdb
Former-commit-id: 9272e412acecc7d032c6299fb815c84c15fb0e2d
2021-08-18 15:18:51 +00:00
malavan 15fb97549f upgrade to latest version of rocksdb
Former-commit-id: 9272e412acecc7d032c6299fb815c84c15fb0e2d
2021-08-18 15:18:51 +00:00
benschermel a0303590d5 add keydb-diagnostic-tool to packaging
Former-commit-id: 9d1ade406bf8d1fff08eb172ee50c38d1c23d3c6
2021-08-16 23:21:07 +00:00
malavan c43062aab7 Remove duplicate code
Former-commit-id: 39cc8ce1041d6f7e03504949001c6ca8798265e1
2021-08-16 22:55:46 +00:00
malavan ce73404d40 don't use flags that aren't supported by certain versions of OPENSSL
Former-commit-id: e7704680f269872a1997c6683a6391d807494087
2021-08-16 22:55:46 +00:00
malavan f270752970 Remove duplicate code
Former-commit-id: 046df30861b73f796a7819d8a9ffe6bd68b7e910
2021-08-16 22:53:00 +00:00
malavan fe0259e272 Remove duplicate code
Former-commit-id: 046df30861b73f796a7819d8a9ffe6bd68b7e910
2021-08-16 22:53:00 +00:00
malavan bd5db8149d don't use flags that aren't supported by certain versions of OPENSSL
Former-commit-id: 1ae9af250513d1430160b37d24ba617551402926
2021-08-16 22:49:55 +00:00
malavan 252f63ed0a don't use flags that aren't supported by certain versions of OPENSSL
Former-commit-id: 1ae9af250513d1430160b37d24ba617551402926
2021-08-16 22:49:55 +00:00
malavan 41a01c6f48 Merge remote-tracking branch 'origin/keydbpro' into PRO_RELEASE_6
Former-commit-id: 11214acb5aff8af1e09a64ee2db71357899a9bf7
2021-08-16 22:49:18 +00:00
malavan 3e0f6d983a Merge remote-tracking branch 'origin/keydbpro' into PRO_RELEASE_6
Former-commit-id: 11214acb5aff8af1e09a64ee2db71357899a9bf7
2021-08-16 22:49:18 +00:00
Malavan Sotheeswaran 09aaa12af8 Merge branch 'pkg_update_tools' into 'keydbpro'
add diagnostic tool to packaging

See merge request keydb-dev/KeyDB-Pro!33

Former-commit-id: f87960ac26a710ed1a014a93e47740db1a81a07f
2021-08-16 22:44:53 +00:00
Malavan Sotheeswaran 7bb01c0241 Merge branch 'pkg_update_tools' into 'keydbpro'
add diagnostic tool to packaging

See merge request keydb-dev/KeyDB-Pro!33

Former-commit-id: f87960ac26a710ed1a014a93e47740db1a81a07f
2021-08-16 22:44:53 +00:00
Malavan Sotheeswaran 451c4d40bd Merge branch 'add_asyncFreeDictTable_to_diagnostic_tool' into 'keydbpro'
add asyncFreeDictTable tokeydb-diagnostic-tool.cpp to avoid linker error

See merge request keydb-dev/KeyDB-Pro!32

Former-commit-id: 0a253222359454f233b82c8aaff7c2d9ab57e571
2021-08-16 22:44:43 +00:00
Malavan Sotheeswaran a36a33a399 Merge branch 'add_asyncFreeDictTable_to_diagnostic_tool' into 'keydbpro'
add asyncFreeDictTable tokeydb-diagnostic-tool.cpp to avoid linker error

See merge request keydb-dev/KeyDB-Pro!32

Former-commit-id: 0a253222359454f233b82c8aaff7c2d9ab57e571
2021-08-16 22:44:43 +00:00
Malavan Sotheeswaran 683524a205 Merge branch 'pkg_config' into 'keydbpro'
update packaging config files

See merge request keydb-dev/KeyDB-Pro!31

Former-commit-id: d6bce861e5bafa30d1cc31d1856c75f6e492d454
2021-08-16 22:42:29 +00:00
Malavan Sotheeswaran c692b96fe4 Merge branch 'pkg_config' into 'keydbpro'
update packaging config files

See merge request keydb-dev/KeyDB-Pro!31

Former-commit-id: d6bce861e5bafa30d1cc31d1856c75f6e492d454
2021-08-16 22:42:29 +00:00
benschermel 6d04a4ab15 add keydb-diagnostic-tool to packaging
Former-commit-id: 5bb2b331fa0abc3b10f1bf52c5178123e54a991c
2021-08-16 22:10:31 +00:00
benschermel 5f89e73fd1 add diagnostic tool to packaging
Former-commit-id: 37c3ca16162bd8a97ef35e2104ff5dc0ed6d7e48
2021-08-16 21:59:59 +00:00
benschermel 9912731837 add diagnostic tool to packaging
Former-commit-id: 37c3ca16162bd8a97ef35e2104ff5dc0ed6d7e48
2021-08-16 21:59:59 +00:00
malavan 9e7f8fa664 add asyncFreeDictTable tokeydb-diagnostic-tool.cpp to avoid linker error
Former-commit-id: 6b1509932f592ffffb9dd5d06de7f313d44e4394
2021-08-16 21:35:52 +00:00
malavan 1d0c5763b0 add asyncFreeDictTable tokeydb-diagnostic-tool.cpp to avoid linker error
Former-commit-id: 6b1509932f592ffffb9dd5d06de7f313d44e4394
2021-08-16 21:35:52 +00:00
malavan af6a906a9d Merge remote-tracking branch 'opensource/RELEASE_6' into PRO_RELEASE_6
Former-commit-id: 4505b3caa94ea0366014fabcbdb36850f7b60be7
2021-08-14 04:04:05 +00:00
malavan 3617d3f63e Merge remote-tracking branch 'opensource/RELEASE_6' into PRO_RELEASE_6
Former-commit-id: 4505b3caa94ea0366014fabcbdb36850f7b60be7
2021-08-14 04:04:05 +00:00
MalavanEQAlpha adff8fb92c Merge pull request #344 from EQ-Alpha/fix_pbuild_ubuntu18.04
don't use flags that aren't supported by certain versions of OPENSSL

Former-commit-id: e9765ea69b5aeb7a2c45e4780a5d017a7d26c635
2021-08-13 23:59:50 -04:00
malavan d3f7fd98a5 don't use flags that aren't supported by certain versions of OPENSSL
Former-commit-id: 57c2cc6fceb6d7ae0b0fdf4c6d16170ea8f4ede2
2021-08-13 20:02:06 +00:00
malavan 64ab9dbd60 Merge branch 'RELEASE_6' of https://github.com/EQ-Alpha/KeyDB into RELEASE_6
Former-commit-id: 8a4562312ea5436e04f6b75d5ff1ed8c7ae1cdc8
2021-08-13 15:46:24 +00:00
malavan 31acab3d9e Remove duplicate code
Former-commit-id: 1c2c6b997922dd06316fc1306922fa04a6c02625
2021-08-13 15:46:09 +00:00
christianEQ fce4a7a49d install 32bit libraries in github action
Former-commit-id: ac54985d6a8d07144297682e03f19ba8e8403b37
2021-08-13 11:05:12 -04:00
christianEQ c02587edfd github runner for 32bit build
Former-commit-id: 35d1bd846a7f47a7ccabd79620d349b3967dad5b
2021-08-13 11:05:12 -04:00
christianEQ df0e7b379f changed keys counter variable to unsigned to fix signedness comparison warning
Former-commit-id: 12a12a4bbec59aab4492900ed90e59e0566cc330
2021-08-13 11:05:12 -04:00
christianEQ 3feea52419 %zu for printing type size_t
Former-commit-id: 31db055a4666deed1fb9522e0332ecf83dc36870
2021-08-13 11:05:12 -04:00
christianEQ c825ff5f27 fixed 32bit compatibility in Makefile
Former-commit-id: 2ae9d08a5152d5a71bc62ccba190cd6ee655b023
2021-08-13 11:05:12 -04:00
christianEQ dec657b4f9 fixed overly strict assert for 32bit
Former-commit-id: 748a1a61d998a65a0faf3072a97b928b700037cf
2021-08-13 11:05:12 -04:00
benschermel dfdf22c95a update deb master changelog
Former-commit-id: 4c9610a7c7a35bd83ab9a245018b9d16ffe50001
2021-08-13 00:49:41 +00:00
benschermel 91e83a893f update deb changelog
Former-commit-id: d919317ac338a9bfa2e8de7338fcf08a51e31dd1
2021-08-13 00:48:45 +00:00
benschermel 14cbb9d53e update deb changelog
Former-commit-id: d919317ac338a9bfa2e8de7338fcf08a51e31dd1
2021-08-13 00:48:45 +00:00
benschermel f563b24b1f bump version
Former-commit-id: a230a7973a64ad29174348ab8d053c9bb2ea60c9
2021-08-13 00:40:46 +00:00
benschermel 678e1f08ae bump version
Former-commit-id: af0769c1a917e9b17dda15b5aca6efdb958bfce4
2021-08-13 00:35:19 +00:00
benschermel dded699352 bump version
Former-commit-id: af0769c1a917e9b17dda15b5aca6efdb958bfce4
2021-08-13 00:35:19 +00:00
malavan 9ed2e518b4 bump version
Former-commit-id: 80ad06f51f15eabb6289a6d887a470b814763a98
2021-08-11 23:23:39 +00:00
malavan 71100f697e bump version
Former-commit-id: d923003969be0ecb507bea0acc643ccdf06f8831
2021-08-11 23:22:17 +00:00
malavan 0bcea13474 bump version
Former-commit-id: d923003969be0ecb507bea0acc643ccdf06f8831
2021-08-11 23:22:17 +00:00
malavan f910071992 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 6b385bc057d8a01ed57a6c0d89eb30e9832fe1ca
2021-08-11 21:20:47 +00:00
malavan fe9933334c Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 6b385bc057d8a01ed57a6c0d89eb30e9832fe1ca
2021-08-11 21:20:47 +00:00
malavan 55132ebab3 Merge remote-tracking branch 'opensource/unstable' into keydbpro
Former-commit-id: cf40fa5da29ba9574d20d706d0a41ca7001df95a
2021-08-11 20:41:54 +00:00
malavan a93eebc93a Merge remote-tracking branch 'opensource/unstable' into keydbpro
Former-commit-id: cf40fa5da29ba9574d20d706d0a41ca7001df95a
2021-08-11 20:41:54 +00:00
malavan df5ed116ef Merge remote-tracking branch 'origin/unstable' into RELEASE_6
Former-commit-id: 8e6c8f1da1ff6bd354a13cfafd0b3899d9d00a05
2021-08-11 19:59:28 +00:00
MalavanEQAlpha 391e4d5c7b Merge pull request #318 from VivekSainiEQ/redisearch_fixes
Initialized serverTL in more places in module.cpp

Former-commit-id: 7314eb0006522882450de7fa66b06a7f7730ed80
2021-08-11 15:47:30 -04:00
Vivek Saini 51fcef1ebc Merge pull request #296 from VivekSainiEQ/systemd_fix
Fixed bug where make USE_SYSTEMD=yes would not pass in correct flags

Former-commit-id: 0b76f5993f0d2e87cb656f4398de87fe900c08e9
2021-08-11 15:39:50 -04:00
VivekSainiEQ 35182974fc Merge remote-tracking branch 'upstream/unstable' into redisearch_fixes
Former-commit-id: 1b251153f4bc7ce2ec94103136ced64581321f4b
2021-08-11 19:28:04 +00:00
VivekSainiEQ 1c674bd6d0 Prevent invalid mvcc timestamps from causing critical errors
Former-commit-id: 5efb8db6f182919bbaaaf9c92feda54009232584
2021-08-11 15:06:14 -04:00
Paweł Sacawa 7abff1a525 Add: zsh completions with descriptions
This commit add zsh completions for the keydb `client`. They have contextual host completion and full argument descriptions.
Vendor-distributed completions for zsh should end up in `/usr/share/zsh/vendor-completions`, but unfortunatly I'm not familiar with the packaging method for *.deb archives, so these completions will need to be moved to the appropriate directory.


Former-commit-id: d3dd702af3a2ac715e8684020af17623c73fd6e9
2021-08-11 15:05:11 -04:00
MalavanEQAlpha 56f0d5ea9a Merge pull request #340 from EQ-Alpha/update_keydb.conf
update keydb.conf with new configs from redis unstable

Former-commit-id: 34c0e9e386a428fde033433e94378674454c4c15
2021-08-11 15:04:22 -04:00
MalavanEQAlpha 81bfdae670 Merge pull request #341 from EQ-Alpha/pkg_config
update packaging config files

Former-commit-id: 9abf9a4ec4bbfe0510db68d3c67c5afbc49d85ee
2021-08-11 15:01:37 -04:00
John Sully a4f12b3afb Merge branch 'keydbpro_collab' into multithread_load
Former-commit-id: f36e9efd8e0079650c78e1e8c19c5fa8553c8251
2021-08-11 02:54:02 +00:00
John Sully f406ef72ae Merge branch 'keydbpro_collab' into multithread_load
Former-commit-id: f36e9efd8e0079650c78e1e8c19c5fa8553c8251
2021-08-11 02:54:02 +00:00
John Sully 51f1c8ce57 Fix crash loading RDB on start with a storage provider set
Former-commit-id: ace6a44399a15ab48a7ef798dc656dbc1207b58d
2021-08-11 02:53:44 +00:00
John Sully 0d2b6ee3dd Fix crash loading RDB on start with a storage provider set
Former-commit-id: ace6a44399a15ab48a7ef798dc656dbc1207b58d
2021-08-11 02:53:44 +00:00
John Sully 4518eedbbf Fix crash in load with storage provider set
Former-commit-id: 6990818b7ca647819b50ae04224778e6f8f12a1a
2021-08-11 01:19:39 +00:00
John Sully fc2d678b50 Fix crash in load with storage provider set
Former-commit-id: 6990818b7ca647819b50ae04224778e6f8f12a1a
2021-08-11 01:19:39 +00:00
benschermel 743689226a add script to compare all active config parameters of any 2 config files
Former-commit-id: 4e8155966fa07f1395ad789123cc3519e614cd4f
2021-08-10 20:10:28 -04:00
benschermel 19105455d3 update packaging config files
Former-commit-id: d45cfb8e6416c9305447bb6fc02cbbc40875a4f0
2021-08-10 20:08:39 -04:00
benschermel dbbc68a223 add script to compare all active config parameters of any 2 config files
Former-commit-id: b873f90dc1f0f9343bc5c8c3c94a544b5f1f7321
2021-08-10 20:06:59 -04:00
benschermel 64eff23f91 add script to compare all active config parameters of any 2 config files
Former-commit-id: b873f90dc1f0f9343bc5c8c3c94a544b5f1f7321
2021-08-10 20:06:59 -04:00
benschermel 9007fef288 update package config files
Former-commit-id: fd367a91cc0feb22b67f034627d59feb679b81e8
2021-08-10 20:04:30 -04:00
benschermel 0c57f07b35 update package config files
Former-commit-id: fd367a91cc0feb22b67f034627d59feb679b81e8
2021-08-10 20:04:30 -04:00
malavan 1074f4a27d update keydb.conf with new configs from redis unstable
Former-commit-id: 2ccfb25ac199b720b60ea860078359ce07b995f6
2021-08-10 21:34:52 +00:00
malavan 20e5c4e5be Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: a1b8103f429a319e19ca8144f8442905530d7ed8
2021-08-09 22:15:44 +00:00
malavan 3925ab8372 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: a1b8103f429a319e19ca8144f8442905530d7ed8
2021-08-09 22:15:44 +00:00
John Sully a9f52fce05 Merge branch 'keydbpro_collab' into multithread_load
Former-commit-id: 8016c20f1f9a648e658c816e2f6777c5718d5e19
2021-08-09 20:20:34 +00:00
John Sully 2d1638e8d7 Merge branch 'keydbpro_collab' into multithread_load
Former-commit-id: 8016c20f1f9a648e658c816e2f6777c5718d5e19
2021-08-09 20:20:34 +00:00
malavan ddb6eb2ac4 Merge branch 'unstable' into RELEASE_6
Former-commit-id: e5c56d1f0ee38d72eca4efb67460cc71d35b6f0e
2021-08-09 18:17:11 +00:00
Malavan Sotheeswaran 41d87867dc Merge branch 'add_ci' into 'keydbpro'
Use artifacts to speed up pipeline

See merge request keydb-dev/KeyDB-Pro!30

Former-commit-id: 2b377364d0df4779cf5fef75d30853e1dab73638
2021-08-06 02:20:18 +00:00
Malavan Sotheeswaran a17ad2bb90 Merge branch 'add_ci' into 'keydbpro'
Use artifacts to speed up pipeline

See merge request keydb-dev/KeyDB-Pro!30

Former-commit-id: 2b377364d0df4779cf5fef75d30853e1dab73638
2021-08-06 02:20:18 +00:00
Malavan Sotheeswaran 3e19974d61 Use artifacts to speed up pipeline
Former-commit-id: 37ad7b3567aaefa7785eb50e1370db4734605e4c
2021-08-06 02:20:18 +00:00
Malavan Sotheeswaran 3c588e9179 Use artifacts to speed up pipeline
Former-commit-id: 37ad7b3567aaefa7785eb50e1370db4734605e4c
2021-08-06 02:20:18 +00:00
Malavan Sotheeswaran f2b9516b39 Merge branch 'fix_shrink_on_rdb_load' into 'keydbpro'
add noshrink flag to stop dict from shrinking during mass insertions

See merge request keydb-dev/KeyDB-Pro!28

Former-commit-id: 41241189cb0238b240b2f894f77ae254e49770ac
2021-08-05 20:07:31 +00:00
Malavan Sotheeswaran 739c29fa44 Merge branch 'fix_shrink_on_rdb_load' into 'keydbpro'
add noshrink flag to stop dict from shrinking during mass insertions

See merge request keydb-dev/KeyDB-Pro!28

Former-commit-id: 41241189cb0238b240b2f894f77ae254e49770ac
2021-08-05 20:07:31 +00:00
Malavan Sotheeswaran f1f7ff27b9 add noshrink flag to stop dict from shrinking during mass insertions
Former-commit-id: 5e0c994ec82f4adb437a31f8d89eee7a09145576
2021-08-05 20:07:31 +00:00
Malavan Sotheeswaran 4e5d72de76 add noshrink flag to stop dict from shrinking during mass insertions
Former-commit-id: 5e0c994ec82f4adb437a31f8d89eee7a09145576
2021-08-05 20:07:31 +00:00
Malavan Sotheeswaran 0a26ee1472 Merge branch 'add_ci' into 'keydbpro'
remove duplicate rules and fix duplicating pipelines

See merge request keydb-dev/KeyDB-Pro!29

Former-commit-id: 8e458fb4bed27f653a3630e15aa9c637b2915f62
2021-08-04 15:00:18 +00:00
Malavan Sotheeswaran 66615c36ca Merge branch 'add_ci' into 'keydbpro'
remove duplicate rules and fix duplicating pipelines

See merge request keydb-dev/KeyDB-Pro!29

Former-commit-id: 8e458fb4bed27f653a3630e15aa9c637b2915f62
2021-08-04 15:00:18 +00:00
malavan d5e283dd8d disable node redis for now since it does not work with redis 6.23
Former-commit-id: 6bd93684b6078782fc40973b253f1534d79888c1
2021-08-04 01:50:55 +00:00
malavan 2bcd358575 disable node redis for now since it does not work with redis 6.23
Former-commit-id: 6bd93684b6078782fc40973b253f1534d79888c1
2021-08-04 01:50:55 +00:00
malavan 589d1712b0 remove duplicate rules and try to fix double pipelines
Former-commit-id: 0f504408042670f3ead2e1522dcbbae7c4c3b62c
2021-08-04 01:44:47 +00:00
malavan 00b02b6045 remove duplicate rules and try to fix double pipelines
Former-commit-id: 0f504408042670f3ead2e1522dcbbae7c4c3b62c
2021-08-04 01:44:47 +00:00
Christian Legge 976eca1862 Add REPLPING command for use during replication (#329)
* added replping command for initiating replication

* backwards compatibility for replping (retry if not recognized)

* don't allow ping during loading (load balancer fix)

* changed replping warning to notice

Former-commit-id: 13e9a473e2a0b053e0aac64897fb2adc35240d14
2021-07-29 15:50:30 -04:00
malavan 8cb9c664d2 don't create pipeline on every push
Former-commit-id: fb4bb008856c3e685afb470617a1ab3579ee63a8
2021-07-28 22:52:50 +00:00
malavan 1b4ec9d4d7 don't create pipeline on every push
Former-commit-id: fb4bb008856c3e685afb470617a1ab3579ee63a8
2021-07-28 22:52:50 +00:00
Malavan Sotheeswaran 5683114ebf Merge branch 'add_ci' into 'keydbpro'
make make test multithreaded

See merge request keydb-dev/KeyDB-Pro!27

Former-commit-id: 7cb619601d110962ef061b99425ab03d914929c8
2021-07-28 22:23:54 +00:00
Malavan Sotheeswaran a5c74d9479 Merge branch 'add_ci' into 'keydbpro'
make make test multithreaded

See merge request keydb-dev/KeyDB-Pro!27

Former-commit-id: 7cb619601d110962ef061b99425ab03d914929c8
2021-07-28 22:23:54 +00:00
MalavanEQAlpha c483489531 Merge pull request #328 from EQ-Alpha/backtrace_for_alpine
Backtrace for alpine using libunwind

Former-commit-id: 21617ab5f355959696710e87c1afd210fb6abb12
2021-07-28 17:17:06 -04:00
malavan df2647a43f add some comments
Former-commit-id: bd8bcdae0d244e93e23871f5306b002690f101c6
2021-07-28 20:32:18 +00:00
John Sully 062e35e809 Fix issue collab #32
Former-commit-id: 0d192cf00ebe9fc0d898404b86e1173476edaefb
2021-07-26 22:30:31 +00:00
John Sully fc740893ff Fix issue collab #32
Former-commit-id: 0d192cf00ebe9fc0d898404b86e1173476edaefb
2021-07-26 22:30:31 +00:00
John Sully 0e79fce228 Initialize el so we can detect if it is null
Former-commit-id: ec0f833ea17c668971893aa8f198d22da2e1d289
2021-07-23 19:31:22 +00:00
John Sully d849a71eb8 Initialize el so we can detect if it is null
Former-commit-id: ec0f833ea17c668971893aa8f198d22da2e1d289
2021-07-23 19:31:22 +00:00
John Sully e9f2b4f67d We cannot create time events on threads that don't have an event loop
Former-commit-id: 3812586a41bb7f974b5d9820c8a68ff34ee8aa9a
2021-07-23 16:02:57 +00:00
John Sully 65228a12ea We cannot create time events on threads that don't have an event loop
Former-commit-id: 3812586a41bb7f974b5d9820c8a68ff34ee8aa9a
2021-07-23 16:02:57 +00:00
John Sully 6fbe529923 We cannot create time events on threads that don't have an event loop
Former-commit-id: 4c88a4ee0e86f6e1c9b18733e48ce50751d01e45
2021-07-23 16:02:29 +00:00
John Sully e516f6eef6 We cannot create time events on threads that don't have an event loop
Former-commit-id: 4c88a4ee0e86f6e1c9b18733e48ce50751d01e45
2021-07-23 16:02:29 +00:00
malavan bc09298bcc remove duplicate function
Former-commit-id: b1a8bb6e75d82a73755cf9e74cb74c483a3a3253
2021-07-21 16:00:24 +00:00
malavan ee6d0ff6e4 add stacktrace message
Former-commit-id: 71bd41efdbaeecedc802a73ef2f801ac62cf6ffc
2021-07-19 23:17:18 +00:00
John Sully 228cb28552 Merge branch 'keydbpro' into keydbpro_collab
Former-commit-id: e4e5c6696c6d831924f314a198b266b10d831e14
2021-07-19 20:51:27 +00:00
John Sully ea8934ddf3 Merge branch 'keydbpro' into keydbpro_collab
Former-commit-id: e4e5c6696c6d831924f314a198b266b10d831e14
2021-07-19 20:51:27 +00:00
John Sully 2c856755e9 Disable async rehash during load as it interferes with eviction
Former-commit-id: 54b4f39e9d634bf53b04cd94433b051b14323bc6
2021-07-19 18:17:54 +00:00
John Sully 6da3ff9949 Disable async rehash during load as it interferes with eviction
Former-commit-id: 54b4f39e9d634bf53b04cd94433b051b14323bc6
2021-07-19 18:17:54 +00:00
John Sully cdd6dbc6fd We need to free in order since the first big async free is likely the largest, so don't set the hipri bit
Former-commit-id: 76a9cefa94e0f446e12a690909cbda15d03ca211
2021-07-19 18:01:39 +00:00
John Sully 19916b9d26 We need to free in order since the first big async free is likely the largest, so don't set the hipri bit
Former-commit-id: 76a9cefa94e0f446e12a690909cbda15d03ca211
2021-07-19 18:01:39 +00:00
malavan fa06fedc6f dd comment and set eip unused
Former-commit-id: 4f9ba7b01a9afed82b88d3dc480c74a0e208ad70
2021-07-19 17:32:38 +00:00
malavan 50a809a25a dd comment and set eip unused
Former-commit-id: 7c96e303c8c930fe5d17fd5c448ffb0b4d4a5b47
2021-07-19 17:31:24 +00:00
malavan f373df592d dd comment and set eip unused
Former-commit-id: d1c44227782b608bf6aa2dbad24c9fb4567393cb
2021-07-19 17:29:43 +00:00
malavan e2aa947c3b add backtrace for alpine using libunwind
Former-commit-id: 4a1d0f663a7ec9c523f92608c986c57a49177871
2021-07-19 17:20:52 +00:00
malavan 960f7c761f Merge branch 'add_ci' of https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro into add_ci
Former-commit-id: 82438d8332e4f23c67df17f888b87aff04a46363
2021-07-19 17:01:17 +00:00
malavan afaef24f7b Merge branch 'add_ci' of https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro into add_ci
Former-commit-id: 82438d8332e4f23c67df17f888b87aff04a46363
2021-07-19 17:01:17 +00:00
malavan 459d1684ee split up runtests
Former-commit-id: 93e36a064033dc55fe281fe113425b33cf42b2c3
2021-07-19 16:59:03 +00:00
malavan 85efd483d2 split up runtests
Former-commit-id: 93e36a064033dc55fe281fe113425b33cf42b2c3
2021-07-19 16:59:03 +00:00
John Sully 9a172c57ee We need to periodically flush the GC or we'll end up blocking with a huge backlog at the end of load
Former-commit-id: 29c0bf79ad1a810e808790de2f7db24f3cc603e8
2021-07-19 16:50:48 +00:00
John Sully a0b0773f67 We need to periodically flush the GC or we'll end up blocking with a huge backlog at the end of load
Former-commit-id: 29c0bf79ad1a810e808790de2f7db24f3cc603e8
2021-07-19 16:50:48 +00:00
Malavan Sotheeswaran d9bf895f36 Merge branch 'keydbpro' into 'add_ci'
# Conflicts:
#   .gitlab-ci.yml

Former-commit-id: 828924d67d622483fccf570649fc81aa3d78673b
2021-07-19 16:16:36 +00:00
Malavan Sotheeswaran 807cfaa668 Merge branch 'keydbpro' into 'add_ci'
# Conflicts:
#   .gitlab-ci.yml

Former-commit-id: 828924d67d622483fccf570649fc81aa3d78673b
2021-07-19 16:16:36 +00:00
malavan f285aafc8c change make test to multithreaded
Former-commit-id: 8f2bae851f2aa7c2600a487733a82850d6552882
2021-07-19 15:52:33 +00:00
malavan 27cf986011 change make test to multithreaded
Former-commit-id: 8f2bae851f2aa7c2600a487733a82850d6552882
2021-07-19 15:52:33 +00:00
John Sully a3252bea33 Info command should show how many keys are cached in RAM vs storage provider
Former-commit-id: 08597bee69bc16ca7c3d5ff31020472774c6eec9
2021-07-19 15:11:33 +00:00
John Sully 38ac33fadd Info command should show how many keys are cached in RAM vs storage provider
Former-commit-id: 08597bee69bc16ca7c3d5ff31020472774c6eec9
2021-07-19 15:11:33 +00:00
John Sully 3a5792a089 StorageCache dtor leaks
Former-commit-id: 0262c4dc76a320141b8a4454df2f6baab4f74ab3
2021-07-19 15:10:48 +00:00
John Sully b09690d322 StorageCache dtor leaks
Former-commit-id: 0262c4dc76a320141b8a4454df2f6baab4f74ab3
2021-07-19 15:10:48 +00:00
John Sully a4e59b7f63 Do not resize replica buffer past the max client limit
Former-commit-id: ba116500ca4fd53e4e40f04fc33981e60bb21ab7
2021-07-18 20:48:08 +00:00
John Sully 56f6f8c915 Do not resize replica buffer past the max client limit
Former-commit-id: ba116500ca4fd53e4e40f04fc33981e60bb21ab7
2021-07-18 20:48:08 +00:00
John Sully e8a654166e Return the ring buffer to its original size if we temporarily resized it
Former-commit-id: a12ce4a0d105bf7d6ccff95f7dc0044c4676b0a7
2021-07-18 20:45:32 +00:00
John Sully d4cea21cd7 Return the ring buffer to its original size if we temporarily resized it
Former-commit-id: a12ce4a0d105bf7d6ccff95f7dc0044c4676b0a7
2021-07-18 20:45:32 +00:00
John Sully 53fab59e87 Do not update batch variables when not in a batch
Former-commit-id: ad1e0286cf9b2d9de33c65e8e798a05ead3f7d5a
2021-07-18 20:28:42 +00:00
John Sully dd3c4a2f38 Do not update batch variables when not in a batch
Former-commit-id: ad1e0286cf9b2d9de33c65e8e798a05ead3f7d5a
2021-07-18 20:28:42 +00:00
Christian Legge 4a0b1a3f24 Merge pull request #321 from EQ-Alpha/ci-flags-fix
Requested changes from 6.2.2 merge

Former-commit-id: 78c93bfb5a9aa09f40bba173dc5d97a7af17dc64
2021-07-15 16:42:02 -04:00
christianEQ ec2d722858 fix warnings for mac build
Former-commit-id: b533cc63300c5628550d612cb6ce068676f7b32c
2021-07-15 20:14:14 +00:00
Malavan Sotheeswaran 8ebff5164e Merge branch 'add_ci' into 'keydbpro'
test CI do not merge

See merge request keydb-dev/KeyDB-Pro!24

Former-commit-id: 047e32c63a329c9ebc6756db704eda8bbcc1b10a
2021-07-14 23:41:24 +00:00
Malavan Sotheeswaran 662ade93d9 Merge branch 'add_ci' into 'keydbpro'
test CI do not merge

See merge request keydb-dev/KeyDB-Pro!24

Former-commit-id: 047e32c63a329c9ebc6756db704eda8bbcc1b10a
2021-07-14 23:41:24 +00:00
Malavan Sotheeswaran d85c1e1458 test CI do not merge
Former-commit-id: ccdf18b1bef07ba076e5f86d74fe1e1f6ae50a8c
2021-07-14 23:41:24 +00:00
Malavan Sotheeswaran 24eae00cb3 test CI do not merge
Former-commit-id: ccdf18b1bef07ba076e5f86d74fe1e1f6ae50a8c
2021-07-14 23:41:24 +00:00
christianEQ e9b0e6453d Merge remote-tracking branch 'origin/unstable' into ci-flags-fix
Former-commit-id: 71db54191d17211c72bfdad2c4aee8f04237a5fc
2021-07-14 22:56:15 +00:00
malavan 91b1f1bb5f add endurance test
Former-commit-id: 3ebd20e66fd6cf858f8d7de7de223d18c387a2a9
2021-07-14 22:15:44 +00:00
malavan ae88a9e13e add endurance test
Former-commit-id: 3ebd20e66fd6cf858f8d7de7de223d18c387a2a9
2021-07-14 22:15:44 +00:00
malavan 51059a80b0 use INVALID_EXPIRE instead of -1
Former-commit-id: 4de458d57b37d5efe589367c5a059cf09f289d51
2021-07-14 22:13:29 +00:00
christianEQ 1e63f4aabb added REDIS_CFLAGS to makefile for backwards compatibility
Former-commit-id: c6aa233ca24f66bf4c0dfa78857cb546c024a6bf
2021-07-14 21:51:44 +00:00
malavan 78e69c2241 cleanup based on 6.2.2 merge review
Former-commit-id: 498f36e7a5c6b08ffda5f0c0fd1eb8fe966680f6
2021-07-14 15:22:27 -04:00
Christian Legge 6742c4ab8b Merge pull request #322 from EQ-Alpha/diagnostic-tool
Basic first iteration of Diagnostic Tool

Former-commit-id: 6e78becd21a40c35177e7e453820fb248c75310d
2021-07-14 14:19:44 -04:00
malavan 46b3916226 more specific requirements for jedis and node-redis
Former-commit-id: 4d3f9cb88a8d60ac0350d658f76bae7ad5e17e8f
2021-07-13 20:58:58 +00:00
malavan 13aab76b79 more specific requirements for jedis and node-redis
Former-commit-id: 4d3f9cb88a8d60ac0350d658f76bae7ad5e17e8f
2021-07-13 20:58:58 +00:00
Christian Legge 7711d4b3ac Merge pull request #327 from EQ-Alpha/issue323_fix
fix for #323: seg fault on expiremember

Former-commit-id: 4faec545abb79e4deafb3f154f39105c3cc5fb16
2021-07-12 16:54:31 -04:00
christianEQ 8fdb571453 tabs -> spaces
Former-commit-id: 668231bd2d5f3048104207befc825cc751b14f9f
2021-07-12 18:55:44 +00:00
John Sully 699ccbc2d5 Merge branch 'keydbpro' into keydbpro_collab
Former-commit-id: 8eec3e948ffd204bb2d6170ad3ca42fa8a2c6d8b
2021-07-09 05:25:04 +00:00
John Sully 508e23b2c0 Merge branch 'keydbpro' into keydbpro_collab
Former-commit-id: 8eec3e948ffd204bb2d6170ad3ca42fa8a2c6d8b
2021-07-09 05:25:04 +00:00
John Sully 88521a9dfb Merge branch 'unstable' into keydbpro
Former-commit-id: 81ded8a35daa5100cac7299a7d0b5f43ee7ac74f
2021-07-09 04:41:47 +00:00
John Sully 6e68808e4b Merge branch 'unstable' into keydbpro
Former-commit-id: 81ded8a35daa5100cac7299a7d0b5f43ee7ac74f
2021-07-09 04:41:47 +00:00
John Sully 9c841628da Merge tag '6.2.3' into unstable
Former-commit-id: 1895dbb768
2021-07-09 04:40:31 +00:00
malavan 2024682fbc only use docker
Former-commit-id: c66dbb4afe6b63caa065b7ff8e7b11691099b1ce
2021-07-08 19:11:13 +00:00
malavan f1c6c825da only use docker
Former-commit-id: c66dbb4afe6b63caa065b7ff8e7b11691099b1ce
2021-07-08 19:11:13 +00:00
christianEQ 0d436777b0 added eq alpha copyright
Former-commit-id: 0ea7b2db02f824e2b57d32dd209e59e490ba8d68
2021-07-08 02:58:18 +00:00
christianEQ d66dd25845 fix for #323: seg fault on expiremember
Former-commit-id: 92ef2743147202378c555c19afd1667d2cae10b0
2021-07-08 02:50:05 +00:00
christianEQ 5eb9942c98 various branding and cleanup fixes
Former-commit-id: 94aba1d763c2ab75943e55f188e7cb83119265db
2021-07-08 02:46:42 +00:00
jsully 43accfbbec Merge branch 'license_status_fix' into 'keydbpro'
license status OK if not checking license

Closes #14

See merge request keydb-dev/KeyDB-Pro!19

Former-commit-id: f66d0970b1eb9be50210a88bf773769a40513521
2021-07-07 18:07:30 +00:00
jsully d0c40ed511 Merge branch 'license_status_fix' into 'keydbpro'
license status OK if not checking license

Closes #14

See merge request keydb-dev/KeyDB-Pro!19

Former-commit-id: f66d0970b1eb9be50210a88bf773769a40513521
2021-07-07 18:07:30 +00:00
malavan 21d50f483b gitlab-ci syntax error
Former-commit-id: 5bab59629c39c8eb22567be36faf092d0b54dbe4
2021-07-07 08:32:09 +00:00
malavan 955caf82d8 gitlab-ci syntax error
Former-commit-id: 5bab59629c39c8eb22567be36faf092d0b54dbe4
2021-07-07 08:32:09 +00:00
malavan 24ad00cd57 gitlab-ci syntax error
Former-commit-id: 92aaa4fd66225593fa477053f960ee1dbf2f522c
2021-07-07 08:30:41 +00:00
malavan 73f6eddbd7 gitlab-ci syntax error
Former-commit-id: 92aaa4fd66225593fa477053f960ee1dbf2f522c
2021-07-07 08:30:41 +00:00
malavan 10ae6522db gitlab-ci syntax error
Former-commit-id: 2a5b4297425e773cc97376f271acce535ef3a20e
2021-07-07 08:26:39 +00:00
malavan 52efb72461 gitlab-ci syntax error
Former-commit-id: 2a5b4297425e773cc97376f271acce535ef3a20e
2021-07-07 08:26:39 +00:00
malavan 0ad560b9fd code coverage job
Former-commit-id: 418fd5716dde4b8034259ca31290e5538f0f0aad
2021-07-07 08:25:37 +00:00
malavan f680ebd9e7 code coverage job
Former-commit-id: 418fd5716dde4b8034259ca31290e5538f0f0aad
2021-07-07 08:25:37 +00:00
malavan ba39b9873e add redis-rs
Former-commit-id: 13f171eb06b98f25424b1dff8c6572b668dd92ad
2021-07-07 05:28:59 +00:00
malavan d539257d6f add redis-rs
Former-commit-id: 13f171eb06b98f25424b1dff8c6572b668dd92ad
2021-07-07 05:28:59 +00:00
malavan c0d27a3e90 tmp dir created by jedis make now
Former-commit-id: 2c362ea5359f0f814da231a5fb9e826d1851bfe3
2021-06-30 17:51:51 +00:00
malavan 1528d03efc tmp dir created by jedis make now
Former-commit-id: 2c362ea5359f0f814da231a5fb9e826d1851bfe3
2021-06-30 17:51:51 +00:00
John Sully a765b9508f Merge branch 'repl_backlog_rework' into keydbpro_collab
Former-commit-id: 0983e195757d92d6cbcb63436a1332a6b80e275c
2021-06-30 06:36:45 +00:00
John Sully 1766f223c9 Merge branch 'repl_backlog_rework' into keydbpro_collab
Former-commit-id: 0983e195757d92d6cbcb63436a1332a6b80e275c
2021-06-30 06:36:45 +00:00
malavan 415f37b5b8 Merge branch 'keydbpro' into add_ci
Former-commit-id: 3a745920e519177390a36abc207e02f01e35828a
2021-06-25 12:15:52 +00:00
malavan ef1341d2fc Merge branch 'keydbpro' into add_ci
Former-commit-id: 3a745920e519177390a36abc207e02f01e35828a
2021-06-25 12:15:52 +00:00
malavan 76344dabe1 add tags hopefully no need to kill stunnel
Former-commit-id: 6b49258ba88874075e18e71911f472bc95595c5a
2021-06-25 11:46:28 +00:00
malavan fb31e21ec7 add tags hopefully no need to kill stunnel
Former-commit-id: 6b49258ba88874075e18e71911f472bc95595c5a
2021-06-25 11:46:28 +00:00
John Sully 714c369f95 Merge branch 'keydbpro' into keydbpro_collab
Former-commit-id: ecc69952dfd1f145e1aff12bca56a4b4e102d669
2021-06-25 06:21:58 +00:00
John Sully fd352812d5 Merge branch 'keydbpro' into keydbpro_collab
Former-commit-id: ecc69952dfd1f145e1aff12bca56a4b4e102d669
2021-06-25 06:21:58 +00:00
John Sully 4eaf1fbb96 Avoid taking locks when we don't need to
Former-commit-id: 0d8d3ee9e217cd1f1366a117e6e212f610a028e1
2021-06-25 06:11:14 +00:00
John Sully 7e0a3e88b0 Avoid taking locks when we don't need to
Former-commit-id: 0d8d3ee9e217cd1f1366a117e6e212f610a028e1
2021-06-25 06:11:14 +00:00
John Sully 7a01ee9f5f OPTIMIZATION: Only notify the condition variable when needed
Former-commit-id: 11f07b49c613f54cef682da1e3c8fc54918809b0
2021-06-25 06:11:01 +00:00
John Sully 4262bed9de OPTIMIZATION: Only notify the condition variable when needed
Former-commit-id: 11f07b49c613f54cef682da1e3c8fc54918809b0
2021-06-25 06:11:01 +00:00
John Sully 80860b8224 Reenable LTO
Former-commit-id: e7c1e1c9d8021f48c4081a9dfb84dba9da2521fc
2021-06-25 06:10:13 +00:00
John Sully 22b98b86fe Reenable LTO
Former-commit-id: e7c1e1c9d8021f48c4081a9dfb84dba9da2521fc
2021-06-25 06:10:13 +00:00
jsully 3cf4c05b2b Merge branch 'repl_backlog_rework' into 'keydbpro'
Replication backlog rework

See merge request keydb-dev/KeyDB-Pro!23

Former-commit-id: 6937d3be40fdc79dddc1852bf7fc8565984da006
2021-06-25 03:10:56 +00:00
jsully d35c7a425b Merge branch 'repl_backlog_rework' into 'keydbpro'
Replication backlog rework

See merge request keydb-dev/KeyDB-Pro!23

Former-commit-id: 6937d3be40fdc79dddc1852bf7fc8565984da006
2021-06-25 03:10:56 +00:00
vivek 0b47c29683 Primitive implementation of bypassing client buffer, stats are all messed up and print statements everywhere
Former-commit-id: 59b2ae8ff451f8a5ac2f3baf3c7b509f6872895e
2021-06-25 03:10:56 +00:00
vivek aa9afe4854 Primitive implementation of bypassing client buffer, stats are all messed up and print statements everywhere
Former-commit-id: 59b2ae8ff451f8a5ac2f3baf3c7b509f6872895e
2021-06-25 03:10:56 +00:00
John Sully 368a619dbe remove unnecessary newline
Former-commit-id: 532af9cd0286ac6ece6f401c42aea18e36d16f7c
2021-06-25 02:46:32 +00:00
John Sully 134beafb76 remove unnecessary newline
Former-commit-id: 532af9cd0286ac6ece6f401c42aea18e36d16f7c
2021-06-25 02:46:32 +00:00
John Sully 001323e3f3 Avoid holding the lockPendingWrite for too long and deadlocking due to lock inversion
Former-commit-id: a4b49fbec60e2333a4407d24383ae204d5d2b413
2021-06-25 02:31:17 +00:00
John Sully 5082c186f9 Avoid holding the lockPendingWrite for too long and deadlocking due to lock inversion
Former-commit-id: a4b49fbec60e2333a4407d24383ae204d5d2b413
2021-06-25 02:31:17 +00:00
John Sully a236ba397c Remove fPendingReplicaWrite flag which can instead be calculated on demand
Former-commit-id: ae26afd13f955eb230b5c2cab20ec90db9b714ad
2021-06-25 01:54:38 +00:00
John Sully 47f515e1ae Remove fPendingReplicaWrite flag which can instead be calculated on demand
Former-commit-id: ae26afd13f955eb230b5c2cab20ec90db9b714ad
2021-06-25 01:54:38 +00:00
malavan 13493bd8ae don't fail on pkill
Former-commit-id: 7e187095eb82052c2ef0a37094a0cf3c0545c2f0
2021-06-24 22:51:14 +00:00
malavan 234179c963 don't fail on pkill
Former-commit-id: 7e187095eb82052c2ef0a37094a0cf3c0545c2f0
2021-06-24 22:51:14 +00:00
malavan 44498c7108 add local tmp dir
Former-commit-id: 7a8f6e7f3c2b4a3e10dabdb2961a39bdd859a2e0
2021-06-24 14:38:52 +00:00
malavan b9bcaeccd9 add local tmp dir
Former-commit-id: 7a8f6e7f3c2b4a3e10dabdb2961a39bdd859a2e0
2021-06-24 14:38:52 +00:00
malavan 60207f303e reset stunnel for jedis
Former-commit-id: 52d0e91046975791cc91ae230777f80ba2573dc9
2021-06-24 14:04:31 +00:00
malavan 1733911f2a reset stunnel for jedis
Former-commit-id: 52d0e91046975791cc91ae230777f80ba2573dc9
2021-06-24 14:04:31 +00:00
malavan 3d0c9529be add jedis-test
Former-commit-id: 964e0313169f3d942d9ea6d7c4af181a20f9c663
2021-06-24 13:34:08 +00:00
malavan 6c280e71c3 add jedis-test
Former-commit-id: 964e0313169f3d942d9ea6d7c4af181a20f9c663
2021-06-24 13:34:08 +00:00
christianEQ c3f0773636 removed unused command line options
Former-commit-id: 1b3b066c2530f51d31e89b1814d48bb4551df5aa
2021-06-22 17:13:35 +00:00
christianEQ 23ef7cfd21 changed --ms to --time
Former-commit-id: aad16337cdec027d7f41e50352bbd0890c6bfe5e
2021-06-21 19:57:14 +00:00
christianEQ 49900d0c92 added more verbose options
Former-commit-id: d584a7c2023d7a805179320b10c94ae89c96cc1c
2021-06-21 18:40:37 +00:00
christianEQ d180140c85 -t threads option
Former-commit-id: 151ef31abb8a0bfb4f07dfd7a9b3256ba3e75bf9
2021-06-21 18:36:21 +00:00
malavan ea2eaef3a1 redo build instead of upload and download
Former-commit-id: 841cdb2a429576ef2a6fb299aef2156ec56df243
2021-06-19 07:07:28 +00:00
malavan e0eb2051c0 redo build instead of upload and download
Former-commit-id: 841cdb2a429576ef2a6fb299aef2156ec56df243
2021-06-19 07:07:28 +00:00
malavan f4f1c74082 copy entire directory not just src
Former-commit-id: f75c88039383e1ebb83ea3254c07541b8575e869
2021-06-19 07:01:35 +00:00
malavan b39f8e859c copy entire directory not just src
Former-commit-id: f75c88039383e1ebb83ea3254c07541b8575e869
2021-06-19 07:01:35 +00:00
malavan be1d37f06f try to maintain combined files between jobs
Former-commit-id: acf5161c353ddcbbdfc45b4e85ae978bb442e507
2021-06-19 06:55:41 +00:00
malavan f9fd39673f try to maintain combined files between jobs
Former-commit-id: acf5161c353ddcbbdfc45b4e85ae978bb442e507
2021-06-19 06:55:41 +00:00
christianEQ c0b71bc9da added starting line so diagnostic tool doesnt look frozen at first
Former-commit-id: bb1714beb3b2e62fee676c0ded92f7686a673acc
2021-06-18 20:21:47 +00:00
christianEQ e35cb83bd8 Merge remote-tracking branch 'origin/unstable' into diagnostic-tool
Former-commit-id: 985477ea8c5fd62814e87970d9d663561fddc580
2021-06-18 20:19:31 +00:00
christianEQ 23dcfe0704 detect stagnating server load before 100% (diagnostic tool)
Former-commit-id: 98142d6130742b4d1c76a99051d54541255e2b6b
2021-06-18 19:01:51 +00:00
malavan 35f59a0c5c add -j to make test
Former-commit-id: 7509875974938f1087ace2437ceb95d8baeeeffa
2021-06-18 17:50:35 +00:00
malavan a14a32f40f add -j to make test
Former-commit-id: 7509875974938f1087ace2437ceb95d8baeeeffa
2021-06-18 17:50:35 +00:00
malavan 9f3b21112c use runner login for clone
Former-commit-id: 64cc31184d3a91386b689870de7d96e423fb58af
2021-06-18 17:15:49 +00:00
malavan 9e3aef3893 use runner login for clone
Former-commit-id: 64cc31184d3a91386b689870de7d96e423fb58af
2021-06-18 17:15:49 +00:00
christianEQ bbf1c456c4 added config option for time to spin up new client threads (diagnostic tool)
Former-commit-id: 2d4bc8f7db0292bd64e6febc4f84299b0f3554f8
2021-06-18 16:58:16 +00:00
christianEQ 37ac81cdc7 detect full load + server threads (diagnostic tool)
Former-commit-id: ad01eb66e72582ca7b249c8ef44049ef24d2a302
2021-06-18 16:49:25 +00:00
malavan f0a1725880 remove artifacts
Former-commit-id: dd62d85dd101b1f9947af0b335874fd28fee21bc
2021-06-18 16:32:15 +00:00
malavan 976cc2608a remove artifacts
Former-commit-id: dd62d85dd101b1f9947af0b335874fd28fee21bc
2021-06-18 16:32:15 +00:00
malavan 54ba9ad22a remove allow_failure
Former-commit-id: 55f62ea9f6ea4c6adefc81ad90a8bd1567406b72
2021-06-18 16:19:11 +00:00
malavan 9859761ef9 remove allow_failure
Former-commit-id: 55f62ea9f6ea4c6adefc81ad90a8bd1567406b72
2021-06-18 16:19:11 +00:00
malavan 6f2a74ec1f force test to run even if build hangs
Former-commit-id: e7a68417ae133402e1f53a6dbbdabbbfc2b3edf7
2021-06-18 16:16:19 +00:00
malavan 9722a3a182 force test to run even if build hangs
Former-commit-id: e7a68417ae133402e1f53a6dbbdabbbfc2b3edf7
2021-06-18 16:16:19 +00:00
malavan a4d6891b24 syntax error in last commit
Former-commit-id: 4638526c0e68d9b153a5ea11f8ef83b0ad2f42de
2021-06-18 15:34:18 +00:00
malavan 4770045e9a syntax error in last commit
Former-commit-id: 4638526c0e68d9b153a5ea11f8ef83b0ad2f42de
2021-06-18 15:34:18 +00:00
malavan af0861f8f6 add src/ as an artifact
Former-commit-id: 315bd739a9db97c4e680212dfd31580828c3fcc6
2021-06-18 15:32:58 +00:00
malavan 8f765d6aa1 add src/ as an artifact
Former-commit-id: 315bd739a9db97c4e680212dfd31580828c3fcc6
2021-06-18 15:32:58 +00:00
malavan 3cc74fb57a wrong syntax on last commit
Former-commit-id: 587ed953fa8c6a9ed9faf1c406e813ba79e9b7bf
2021-06-18 15:27:30 +00:00
malavan 7703d6da2c wrong syntax on last commit
Former-commit-id: 587ed953fa8c6a9ed9faf1c406e813ba79e9b7bf
2021-06-18 15:27:30 +00:00
malavan 435ac8eef8 parallel make, order tests
Former-commit-id: d01afd8324e415b92a292c199703999df1f72457
2021-06-18 15:23:42 +00:00
malavan 7f6443e677 parallel make, order tests
Former-commit-id: d01afd8324e415b92a292c199703999df1f72457
2021-06-18 15:23:42 +00:00
christianEQ 7ae71e9315 detect client cpu usage in diagnostic tool
Former-commit-id: ab26635dee0958cbedd4791a53f298d4c23d813b
2021-06-17 20:40:10 +00:00
malavan 3315a45cf9 uninstall before install
Former-commit-id: f30afe82d799ad680343cdcb7b80e8c257026ff7
2021-06-17 20:38:56 +00:00
malavan f063ef2ca2 uninstall before install
Former-commit-id: f30afe82d799ad680343cdcb7b80e8c257026ff7
2021-06-17 20:38:56 +00:00
malavan d7bee39125 init git submodule
Former-commit-id: e96906d095fed6b37c9ece79526cfd0a88819e4d
2021-06-17 18:52:36 +00:00
malavan 3d86a20b0f init git submodule
Former-commit-id: e96906d095fed6b37c9ece79526cfd0a88819e4d
2021-06-17 18:52:36 +00:00
christianEQ 94f2882f04 accurate cpu usage in diagnostic tool
Former-commit-id: e1dd303dce35068e631ebbcbc56b251748676411
2021-06-17 18:32:11 +00:00
malavan 20102e5164 clean before build
Former-commit-id: 49805ee385381486476d2986cca9e9c3d50d68b5
2021-06-17 18:30:11 +00:00
malavan ce4ab9fdc4 clean before build
Former-commit-id: 49805ee385381486476d2986cca9e9c3d50d68b5
2021-06-17 18:30:11 +00:00
malavan 8af94cc2f1 add CI for gitlab
Former-commit-id: 37ba6d28030f4cf1866cc9c182833fe247348f38
2021-06-17 08:44:29 +00:00
malavan 7e209b2ff4 add CI for gitlab
Former-commit-id: 37ba6d28030f4cf1866cc9c182833fe247348f38
2021-06-17 08:44:29 +00:00
VivekSainiEQ 28fecbb838 More code cleanup
Former-commit-id: 8e9962b9b7b9093399451bf93d30e5b5d26e3d33
2021-06-16 19:41:55 +00:00
VivekSainiEQ 142d45fa5b More code cleanup
Former-commit-id: 8e9962b9b7b9093399451bf93d30e5b5d26e3d33
2021-06-16 19:41:55 +00:00
VivekSainiEQ b9546e014c Merge remote-tracking branch 'origin/keydbpro' into repl_backlog_rework
Former-commit-id: e9bfcef5429c747fd9f26a829fed2281c5ec2b25
2021-06-16 16:40:06 +00:00
VivekSainiEQ fcd96d92da Merge remote-tracking branch 'origin/keydbpro' into repl_backlog_rework
Former-commit-id: e9bfcef5429c747fd9f26a829fed2281c5ec2b25
2021-06-16 16:40:06 +00:00
Ubuntu d6be246f6c Optimized use of repl_lowest_off to reduce lock contention
Former-commit-id: 30a957e5399fe94675f0b6d2d34c24112d5a9734
2021-06-15 23:13:49 +00:00
Ubuntu ad6c69df28 Optimized use of repl_lowest_off to reduce lock contention
Former-commit-id: 30a957e5399fe94675f0b6d2d34c24112d5a9734
2021-06-15 23:13:49 +00:00
John Sully 592316ea53 Prevent test code crash due to no log data
Former-commit-id: 0a56a73bd9
2021-06-14 22:06:36 +00:00
Ubuntu bd3aff50c3 Relaxed locking, should run faster now
Former-commit-id: 5cec4d026dc1766b9ecbade6ec4b9d0e75a94e0f
2021-06-14 19:30:49 +00:00
Ubuntu 605f767d5e Relaxed locking, should run faster now
Former-commit-id: 5cec4d026dc1766b9ecbade6ec4b9d0e75a94e0f
2021-06-14 19:30:49 +00:00
John Sully 7fe221221c active defrag tests need to run single threaded because jemalloc has seperate mempools per thread and the numbers won't match otherwise
Former-commit-id: 3a1d3090f2
2021-06-14 16:32:47 +00:00
christianEQ 703fa0449b changed redis_flags names to keydb in makefile
Former-commit-id: ebcd106f1602b7e622e084070130c19e9c52d3a8
2021-06-14 16:09:42 +00:00
John Sully 71784390cb Fix deadlock in storage cache
Former-commit-id: e74711e8131cd29a1e0294fbb28e1737ee98afce
2021-06-14 06:32:58 +00:00
John Sully 5d6dee7f96 Fix deadlock in storage cache
Former-commit-id: e74711e8131cd29a1e0294fbb28e1737ee98afce
2021-06-14 06:32:58 +00:00
John Sully 0dbb71e47e Merge branch 'keydbpro' into keydbpro_collab
Former-commit-id: 975655ab7ff357c2d86d2368899325f88efe5310
2021-06-14 04:07:11 +00:00
John Sully d99bbcb823 Merge branch 'keydbpro' into keydbpro_collab
Former-commit-id: 975655ab7ff357c2d86d2368899325f88efe5310
2021-06-14 04:07:11 +00:00
John Sully 847056b28d Free objects immediately before adding to the GC list, this cuts down on mem consumption
Former-commit-id: 49d718ae9c1c8a850df5ffa2c550df3381ad7174
2021-06-14 04:06:34 +00:00
John Sully d4ee53860b Free objects immediately before adding to the GC list, this cuts down on mem consumption
Former-commit-id: 49d718ae9c1c8a850df5ffa2c550df3381ad7174
2021-06-14 04:06:34 +00:00
John Sully 38d4a33369 Merge branch 'keydbpro' into keydbpro_collab
Former-commit-id: efea1ce6ca09e09cfe83425c385d0ca1c47514ce
2021-06-14 03:51:09 +00:00
John Sully d565b83a26 Merge branch 'keydbpro' into keydbpro_collab
Former-commit-id: efea1ce6ca09e09cfe83425c385d0ca1c47514ce
2021-06-14 03:51:09 +00:00
John Sully 2334d4c236 Remove lock
Former-commit-id: bb8efe2ed942fd67d091b16bb27f67ccefcbbf19
2021-06-14 03:50:47 +00:00
John Sully 48f3265891 Remove lock
Former-commit-id: bb8efe2ed942fd67d091b16bb27f67ccefcbbf19
2021-06-14 03:50:47 +00:00
John Sully 51d9a7acd4 Merge branch 'keydbpro' of https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro into keydbpro
Former-commit-id: 51c8b911b1de88065654eec87b88e1f46cf57e2a
2021-06-14 03:35:25 +00:00
John Sully 70f6e81fb2 Merge branch 'keydbpro' of https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro into keydbpro
Former-commit-id: 51c8b911b1de88065654eec87b88e1f46cf57e2a
2021-06-14 03:35:25 +00:00
John Sully 8169e4b1e3 memefficiency tests need to run single threaded as jemalloc has seperate pools for threads
Former-commit-id: 02152c7bd8bc0462edd809122873ceb8644dc69a
2021-06-14 03:34:56 +00:00
John Sully 7b8c01f194 memefficiency tests need to run single threaded as jemalloc has seperate pools for threads
Former-commit-id: 02152c7bd8bc0462edd809122873ceb8644dc69a
2021-06-14 03:34:56 +00:00
John Sully ba9c3e9eff Merge branch 'keydbpro' of https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro into keydbpro
Former-commit-id: 0f1b891c15ac27c4ad8a63a798c7dfa9fdcd2e01
2021-06-14 03:14:15 +00:00
John Sully 3e5019d124 Merge branch 'keydbpro' of https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro into keydbpro
Former-commit-id: 0f1b891c15ac27c4ad8a63a798c7dfa9fdcd2e01
2021-06-14 03:14:15 +00:00
jsully 247291f368 Merge branch 'merge_6.2.2' into 'keydbpro'
Merge 6.2.2

See merge request keydb-dev/KeyDB-Pro!21

Former-commit-id: c1076b2311e8bc1217b7f5030f5f5ebea1e98215
2021-06-14 03:14:03 +00:00
jsully 717fe46c39 Merge branch 'merge_6.2.2' into 'keydbpro'
Merge 6.2.2

See merge request keydb-dev/KeyDB-Pro!21

Former-commit-id: c1076b2311e8bc1217b7f5030f5f5ebea1e98215
2021-06-14 03:14:03 +00:00
jsully 5c1cfab4fc Merge branch 'fixintermittentdoublefree' into 'keydbpro'
Fix issue #23 by adding global locks to FreeMemoryLazyFree

Closes #23

See merge request external-collab/keydb-pro-6!2

Former-commit-id: 2c2d09b123da72483d0b85e41a457ccce13e4fc5
2021-06-14 03:01:03 +00:00
jsully c94e110104 Merge branch 'fixintermittentdoublefree' into 'keydbpro'
Fix issue #23 by adding global locks to FreeMemoryLazyFree

Closes #23

See merge request external-collab/keydb-pro-6!2

Former-commit-id: 2c2d09b123da72483d0b85e41a457ccce13e4fc5
2021-06-14 03:01:03 +00:00
christianEQ 4eec70f762 several redis->keydb changes in sentinel.conf
Former-commit-id: ca12a57661907caf88d14cab93770a3cd73c0e49
2021-06-11 19:16:33 +00:00
christianEQ 980466a511 renamed redis mentions in runtest files
Former-commit-id: 7964bde33d9eeb522d9177b7bd3a3c598aae8e1c
2021-06-11 19:11:12 +00:00
christianEQ 05d126483b renamed redis mention in readme
Former-commit-id: 99441ab9df05dc76d5be9af9d9bd463efda9fc45
2021-06-11 19:10:35 +00:00
christianEQ 21459edab6 renamed workspace gitignore
Former-commit-id: 0e35c80e4d7868611858ba2670d85e50c64cef66
2021-06-11 19:10:12 +00:00
christianEQ 7cbc2bab80 renamed redis test files
Former-commit-id: 3c9eea9085527ef3538b06e7bf41a88e70d5290a
2021-06-11 19:09:40 +00:00
christianEQ 0b74d90cbc removed unreliable musl test and left only accurate new one
Former-commit-id: 748a4442c1b631a74be07b8ca404354e4bf0d0dc
2021-06-11 18:19:59 +00:00
christianEQ 2f57a1c536 changed redis.pid to keydb.pid where necessary
Former-commit-id: 3b79e45e73028e290c9c02676dd8a968b5a891b3
2021-06-11 18:19:02 +00:00
christianEQ 48ca005c0b removed outdated comment in server.cpp
Former-commit-id: c4e4211441b16e65a63aeb5faf3e73ac0cb6b2ac
2021-06-11 18:17:18 +00:00
christianEQ d6156edbb8 updated pkg/deb/conf/keydb.conf to use keydb name throughout
Former-commit-id: 9cc096e477046176859284d14f3c34c59e225128
2021-06-11 18:15:50 +00:00
christianEQ 8ff5479f12 removed the question issue template - doesn't seem necessary for us
Former-commit-id: 93730b37b4701eb31c9ed3edcb9ff2b34ddda996
2021-06-11 18:08:19 +00:00
christianEQ 013cf6de86 fixed flag var names in ci
Former-commit-id: 31bd67f19f554faf6fdef763aca4eac71f366694
2021-06-11 17:04:33 +00:00
christianEQ 7f230f478f don't enforce upper limit for requests issued; tool will run indefinitely
Former-commit-id: 7a5fff2bef5fc6aa37de42d29de616c10550f34d
2021-06-11 16:28:29 +00:00
VivekSainiEQ 267211edfe Merged in 6.2.2
Former-commit-id: 3fb9bb5b4fdfb8e09430c7bef6bf9421065adf0f
2021-06-10 20:11:14 +00:00
VivekSainiEQ e3d6c3446a Merged in 6.2.2
Former-commit-id: 3fb9bb5b4fdfb8e09430c7bef6bf9421065adf0f
2021-06-10 20:11:14 +00:00
malavan 6c4ff04b75 add global locks to FreeMemoryLazyFree
Former-commit-id: d850ce20219a3e29a6a816ebfa0d714963d6a88b
2021-06-09 21:49:15 +00:00
malavan ad8b766df1 add global locks to FreeMemoryLazyFree
Former-commit-id: d850ce20219a3e29a6a816ebfa0d714963d6a88b
2021-06-09 21:49:15 +00:00
VivekSainiEQ af803c36c5 Cleaned up code a bit, need to rewrite some comments to reflect new behaviour
Former-commit-id: 850ec766cd71614ce9e61c12414545cd212d3878
2021-06-08 23:10:53 +00:00
VivekSainiEQ 9f84bbead8 Cleaned up code a bit, need to rewrite some comments to reflect new behaviour
Former-commit-id: 850ec766cd71614ce9e61c12414545cd212d3878
2021-06-08 23:10:53 +00:00
VivekSainiEQ 70b0b0d3da Seems to pass multithreaded test cases, thank the lord
Former-commit-id: 6cbf70cfff5735f3d4ef2e980945b4b1a1f85971
2021-06-04 20:09:47 +00:00
VivekSainiEQ 43dc050850 Seems to pass multithreaded test cases, thank the lord
Former-commit-id: 6cbf70cfff5735f3d4ef2e980945b4b1a1f85971
2021-06-04 20:09:47 +00:00
VivekSainiEQ 7b8b69529f Removed unused variables
Former-commit-id: 48663bc480f7279a94c68aeebdd9721ca64f7038
2021-06-03 21:47:33 +00:00
VivekSainiEQ 76bf7d0b69 Removed unused variables
Former-commit-id: 48663bc480f7279a94c68aeebdd9721ca64f7038
2021-06-03 21:47:33 +00:00
VivekSainiEQ 4ca223609c Single threaded tests work now
Former-commit-id: 0e760d7c71231c7f52102909a31fc8db1b3e2860
2021-06-03 20:44:32 +00:00
VivekSainiEQ 03120ea5cd Single threaded tests work now
Former-commit-id: 0e760d7c71231c7f52102909a31fc8db1b3e2860
2021-06-03 20:44:32 +00:00
John Sully cb744773c6 Fix collab issue #26
Former-commit-id: 2392879772a77fc30c856488b9911d194ced827b
2021-06-03 04:43:38 +00:00
John Sully bad63230fd Fix collab issue #26
Former-commit-id: 2392879772a77fc30c856488b9911d194ced827b
2021-06-03 04:43:38 +00:00
VivekSainiEQ e5bbdafdcb Sync works single threaded properly, passes all but one testcase (which hangs)
Former-commit-id: 9a6ca3a5d906b9d87fe70652d218decbb2775ac1
2021-06-02 23:41:36 +00:00
VivekSainiEQ e8a24e31aa Sync works single threaded properly, passes all but one testcase (which hangs)
Former-commit-id: 9a6ca3a5d906b9d87fe70652d218decbb2775ac1
2021-06-02 23:41:36 +00:00
christianEQ 3bf6bba21e fixed code style for ifdef
Former-commit-id: 93c41fa31c91098af98d2bc0362eb29685cd6678
2021-06-02 15:02:27 +00:00
christianEQ 66a384e08e fixed code style for ifdef
Former-commit-id: 93c41fa31c91098af98d2bc0362eb29685cd6678
2021-06-02 15:02:27 +00:00
John Sully 106dbd9ebe Merge branch 'keydbpro_collab' into multithread_load
Former-commit-id: b580a5561220bc6dc7bc073135f3045ba0cdda51
2021-06-02 04:24:49 +00:00
John Sully 9d3c917836 Merge branch 'keydbpro_collab' into multithread_load
Former-commit-id: b580a5561220bc6dc7bc073135f3045ba0cdda51
2021-06-02 04:24:49 +00:00
John Sully 5012bc6d56 Merge branch 'merge_6.2.2' into keydbpro_collab
Former-commit-id: 00f3646df54d25443d8d42c92de60fdeef4fbbe8
2021-06-02 02:12:16 +00:00
John Sully 6c1da9873e Merge branch 'merge_6.2.2' into keydbpro_collab
Former-commit-id: 00f3646df54d25443d8d42c92de60fdeef4fbbe8
2021-06-02 02:12:16 +00:00
John Sully df521863e0 Merge branch 'keydbpro' of https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro into keydbpro
Former-commit-id: 6eb1417295ecc6ce23677e9a8e1c756579177629
2021-06-02 02:11:29 +00:00
John Sully 3b3b8216be Merge branch 'keydbpro' of https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro into keydbpro
Former-commit-id: 6eb1417295ecc6ce23677e9a8e1c756579177629
2021-06-02 02:11:29 +00:00
John Sully 13639a6538 Fix merge issue with wrong return type
Former-commit-id: 1640a2fefb8f09c7b6b335838f14a7fd3a51ae88
2021-06-02 02:10:00 +00:00
John Sully df60b4ad91 Fix merge issue with wrong return type
Former-commit-id: 1640a2fefb8f09c7b6b335838f14a7fd3a51ae88
2021-06-02 02:10:00 +00:00
John Sully fbe6ce2a27 Merge branch 'unstable' into keydbpro
Former-commit-id: 657789db5c3bd0fbbfc15be150d6eb525554251c
2021-06-02 02:08:18 +00:00
John Sully aedb2393fe Merge branch 'unstable' into keydbpro
Former-commit-id: 657789db5c3bd0fbbfc15be150d6eb525554251c
2021-06-02 02:08:18 +00:00
John Sully 64d0a1c98a Merge branch 'merge_6.2.2' into keydbpro_collab
Former-commit-id: 54fe037e4e215b1e5bdb42b567c6df04a69ba150
2021-06-02 02:05:44 +00:00
John Sully 170641144c Merge branch 'merge_6.2.2' into keydbpro_collab
Former-commit-id: 54fe037e4e215b1e5bdb42b567c6df04a69ba150
2021-06-02 02:05:44 +00:00
jsully 8586bc1aea Merge branch 'fixleakindictdelete' into 'keydbpro'
fix leak caused by dict entry not being added to GCList

See merge request keydb-dev/KeyDB-Pro!20

Former-commit-id: 92c8c6d854c3029269f695d0f9e4afe80c1e48f6
2021-06-02 00:01:52 +00:00
jsully 40b9d8974f Merge branch 'fixleakindictdelete' into 'keydbpro'
fix leak caused by dict entry not being added to GCList

See merge request keydb-dev/KeyDB-Pro!20

Former-commit-id: 92c8c6d854c3029269f695d0f9e4afe80c1e48f6
2021-06-02 00:01:52 +00:00
jsully 6841a4ef1a Merge branch 'jesse/update-readme-build-instructions' into 'PRO_RELEASE_6'
Add additional libraries that need to be installed for building pro

See merge request keydb-dev/KeyDB-Pro!16

Former-commit-id: b18a4f718f40059c30dba6f8ceb2c7612dbcf392
2021-06-02 00:01:33 +00:00
jsully 85f466d8fe Merge branch 'jesse/update-readme-build-instructions' into 'PRO_RELEASE_6'
Add additional libraries that need to be installed for building pro

See merge request keydb-dev/KeyDB-Pro!16

Former-commit-id: b18a4f718f40059c30dba6f8ceb2c7612dbcf392
2021-06-02 00:01:33 +00:00
jsully cdfd3bf870 Merge branch 'monkey_blocking' into 'keydbpro'
Monkey Improvements

See merge request keydb-dev/KeyDB-Pro!13

Former-commit-id: 130434f01b4bd27c14502b005b5dc71daa6b9cae
2021-06-02 00:01:19 +00:00
jsully c32c53a624 Merge branch 'monkey_blocking' into 'keydbpro'
Monkey Improvements

See merge request keydb-dev/KeyDB-Pro!13

Former-commit-id: 130434f01b4bd27c14502b005b5dc71daa6b9cae
2021-06-02 00:01:19 +00:00
John Sully 6b3e7e700a We need to refactor to gurantee the key is visible when loading subexpires. Keys may be temporarily invisible while waiting to be added to the storage
Former-commit-id: 222eecb95925f7c60e28a5717d73163ad64b522b
2021-06-01 23:59:22 +00:00
John Sully 82f8bfaa3d We need to refactor to gurantee the key is visible when loading subexpires. Keys may be temporarily invisible while waiting to be added to the storage
Former-commit-id: 222eecb95925f7c60e28a5717d73163ad64b522b
2021-06-01 23:59:22 +00:00
John Sully b6a63ce5c3 Merge branch 'keydbpro_collab' into multithread_load
Former-commit-id: ffd1225c007e3d1eaecb6b71e215d1e08364aa51
2021-06-01 22:31:52 +00:00
John Sully 18f67cab17 Merge branch 'keydbpro_collab' into multithread_load
Former-commit-id: ffd1225c007e3d1eaecb6b71e215d1e08364aa51
2021-06-01 22:31:52 +00:00
John Sully 7b456ab0db Fix lock mismatch
Former-commit-id: 98eb0e778bc3a5ff7da917d39997b2fdb4adbca6
2021-06-01 22:15:35 +00:00
John Sully ecd450fc49 Fix lock mismatch
Former-commit-id: 98eb0e778bc3a5ff7da917d39997b2fdb4adbca6
2021-06-01 22:15:35 +00:00
christianEQ a6d12fe713 working diag tool prototype
Former-commit-id: 20775387a55743c59cbca1096bb2c071c29fcd27
2021-06-01 20:54:48 +00:00
John Sully f5391f23b7 Reduce lock contention when loading to a storage provider
Former-commit-id: 58bc777f2215918043325753b6e2bf89dc3108f7
2021-06-01 20:01:41 +00:00
John Sully 3e74b3dfe3 Reduce lock contention when loading to a storage provider
Former-commit-id: 58bc777f2215918043325753b6e2bf89dc3108f7
2021-06-01 20:01:41 +00:00
John Sully 66af36ec4f Merge branch 'keydbpro_collab' into multithread_load
Former-commit-id: 31ddf772cd89344017042a18547ae83a60ce02b9
2021-06-01 19:18:19 +00:00
John Sully 190cf3a47d Merge branch 'keydbpro_collab' into multithread_load
Former-commit-id: 31ddf772cd89344017042a18547ae83a60ce02b9
2021-06-01 19:18:19 +00:00
John Sully 7dde8c69d3 Merge branch 'keydbpro' into keydbpro_collab
Former-commit-id: 0f2132505470ca63375f53b54cb6751b604d92f9
2021-06-01 19:17:54 +00:00
John Sully b484bce57c Merge branch 'keydbpro' into keydbpro_collab
Former-commit-id: 0f2132505470ca63375f53b54cb6751b604d92f9
2021-06-01 19:17:54 +00:00
John Sully 6044000963 Implement bulkInsert for rocksdb
Former-commit-id: e9abae77d6ae18e21d7dac0cbdd563f572ac3d03
2021-06-01 19:17:40 +00:00
John Sully 3633e6e8df Implement bulkInsert for rocksdb
Former-commit-id: e9abae77d6ae18e21d7dac0cbdd563f572ac3d03
2021-06-01 19:17:40 +00:00
John Sully e9712d4fff Initial bulkInsert implementation
Former-commit-id: 2a721d4dff3c9f78ec4ba1c7b490ea1f5d216a89
2021-06-01 19:15:01 +00:00
John Sully c37c948cec Initial bulkInsert implementation
Former-commit-id: 2a721d4dff3c9f78ec4ba1c7b490ea1f5d216a89
2021-06-01 19:15:01 +00:00
John Sully 86e56e87a9 Merge remote-tracking branch 'collab/keydbpro' into multithread_load
Former-commit-id: a09454b3a4b295b2d04bdb7d742db7f9a3e17be7
2021-05-31 01:16:01 +00:00
John Sully 1e120f2287 Merge remote-tracking branch 'collab/keydbpro' into multithread_load
Former-commit-id: a09454b3a4b295b2d04bdb7d742db7f9a3e17be7
2021-05-31 01:16:01 +00:00
John Sully 73f8a791aa Merge branch 'keydbpro' into keydbpro_collab
Former-commit-id: 40187ebd4cc479fa86a3ee5cca9bedef7d488ee7
2021-05-31 01:15:30 +00:00
John Sully f9cf1d67ae Merge branch 'keydbpro' into keydbpro_collab
Former-commit-id: 40187ebd4cc479fa86a3ee5cca9bedef7d488ee7
2021-05-31 01:15:30 +00:00
John Sully 26cc3b5414 Eliminate unnecessary global locks
Former-commit-id: 8f924ed0979f3cf7cd290395d1b1eec358979325
2021-05-31 01:14:28 +00:00
John Sully e507883b22 Eliminate unnecessary global locks
Former-commit-id: 8f924ed0979f3cf7cd290395d1b1eec358979325
2021-05-31 01:14:28 +00:00
John Sully 792a217ed7 Fix deadlock in async work queue
Former-commit-id: 3265f2908e8d3aa567b3b9e6b141a7881c795053
2021-05-31 01:14:11 +00:00
John Sully 24d55e8a9e Fix deadlock in async work queue
Former-commit-id: 3265f2908e8d3aa567b3b9e6b141a7881c795053
2021-05-31 01:14:11 +00:00
John Sully 4f8183fc6a Don't pass on flags indicating membership in a list
Former-commit-id: b1f662d639
2021-05-30 05:11:18 +00:00
John Sully 1cf10d50d8 Merge branch 'unstable' into keydbpro
Former-commit-id: 4fd95b064648ee3d02097a1c2dabf306978b44f9
2021-05-30 04:28:09 +00:00
John Sully b2d8707d1f Merge branch 'unstable' into keydbpro
Former-commit-id: 4fd95b064648ee3d02097a1c2dabf306978b44f9
2021-05-30 04:28:09 +00:00
John Sully f70016f7f3 Fix a leak in the benchmark
Former-commit-id: aa5b27b040
2021-05-30 02:55:39 +00:00
John Sully 0083e887cb Fix merge issue with module test script
Former-commit-id: 10d254ec1b
2021-05-30 02:45:06 +00:00
John Sully 136da0109b Ensure our connections are touched only on the right thread
Former-commit-id: e8a44821d0
2021-05-30 02:08:30 +00:00
John Sully b06e054df7 Handle race where a different thread cancels the replication but we haven't closed the connection
Former-commit-id: 92e48f0717
2021-05-30 02:08:02 +00:00
John Sully 57668c22d0 Delete pipe on the right thread so event handlers are cleaned up
Former-commit-id: 9742c44db5
2021-05-30 02:07:31 +00:00
John Sully c059411e28 Don't leave dangling client pointers in the process list
Former-commit-id: 5d16f51950
2021-05-30 02:06:47 +00:00
John Sully 3d297a7ca9 Don't leak AE control pipes to fork children
Former-commit-id: 1ed2e8b5bc
2021-05-30 02:06:20 +00:00
John Sully 45b04d0009 Fix branding
Former-commit-id: b20803b766
2021-05-29 07:08:01 +00:00
John Sully ffb285cdfe Fix cluster test failures
Former-commit-id: 8cf1daf823
2021-05-29 07:07:54 +00:00
John Sully 333a5a5fa5 Merge branch 'unstable' into keydbpro
Former-commit-id: 14c24ce161ddcbddb701a20062659261397cb0e4
2021-05-29 06:49:05 +00:00
John Sully aab7bbdf4c Merge branch 'unstable' into keydbpro
Former-commit-id: 14c24ce161ddcbddb701a20062659261397cb0e4
2021-05-29 06:49:05 +00:00
John Sully 95260c1146 Mac build break fixes
Former-commit-id: 083b54472c
2021-05-28 22:40:03 -04:00
John Sully 2ad6491c38 Prevent partial sync in test that requires only full syncs
Former-commit-id: 1b9fea0669
2021-05-29 02:22:20 +00:00
John Sully 35895e5272 Fix failover command test failures
Former-commit-id: d3c37c7159
2021-05-29 01:19:12 +00:00
John Sully 403c0fede2 Remove dup'd code from merge
Former-commit-id: 807f020184
2021-05-29 01:08:52 +00:00
John Sully da53561354 ProcessingEventsWhileBlocked is relevant only to the current thread
Former-commit-id: b400be68b7
2021-05-29 01:08:43 +00:00
John Sully 2c5b0926f3 Make processClients reentrant
Former-commit-id: e39bdb58ec
2021-05-29 01:08:14 +00:00
John Sully b6d5588fe6 Don't have dangling expires
Former-commit-id: 83c8977033
2021-05-29 01:07:46 +00:00
John Sully 7cd60ccf36 Use correct make flags
Former-commit-id: 682990eeb3
2021-05-29 01:07:35 +00:00
John Sully ad631c3fe2 Repair async rehash code removed by merge
Former-commit-id: 14a3ab8133c474bf8f1ad636c8699d5d59c5394e
2021-05-29 00:24:46 +00:00
John Sully 0680492265 Repair async rehash code removed by merge
Former-commit-id: 14a3ab8133c474bf8f1ad636c8699d5d59c5394e
2021-05-29 00:24:46 +00:00
John Sully 7d6aa9ada3 Merge branch 'unstable' into keydbpro
Former-commit-id: 205d8f18d2bb8df5253bab40578b006b7aa73fd5
2021-05-28 23:32:46 +00:00
John Sully a43a69f47a Merge branch 'unstable' into keydbpro
Former-commit-id: 205d8f18d2bb8df5253bab40578b006b7aa73fd5
2021-05-28 23:32:46 +00:00
VivekSainiEQ 7bdb7882d4 Added more synchronization and fixed some data races
Former-commit-id: 183e015dac6f85df1c94d0761e89bc23d9f53319
2021-05-27 18:57:23 +00:00
VivekSainiEQ e184db14e4 Added more synchronization and fixed some data races
Former-commit-id: 183e015dac6f85df1c94d0761e89bc23d9f53319
2021-05-27 18:57:23 +00:00
VivekSainiEQ 59598b0402 Added transmitted RDB lock
Former-commit-id: 4b32167afc85742d85ff9b47b2c2e0b6b02e140a
2021-05-26 20:10:33 +00:00
VivekSainiEQ a7d7ea5beb Added transmitted RDB lock
Former-commit-id: 4b32167afc85742d85ff9b47b2c2e0b6b02e140a
2021-05-26 20:10:33 +00:00
John Sully 5a43dcdbcd Ensure multi-thread handling of cached master is equivalent to single thread case
Former-commit-id: 7ee766aee1
2021-05-26 17:29:47 +00:00
John Sully 7b6d758463 Avoid differences between single thread and multi-thread
Former-commit-id: 848c5ad784
2021-05-26 17:29:01 +00:00
malavan 4df6b6fe36 fix leak caused by dict entry not being added to GCList
Former-commit-id: d8c1b3b6ec64f63fdff04d53102e4563c2c6764a
2021-05-26 17:01:51 +00:00
malavan 7b921a3324 fix leak caused by dict entry not being added to GCList
Former-commit-id: d8c1b3b6ec64f63fdff04d53102e4563c2c6764a
2021-05-26 17:01:51 +00:00
John Sully 586eaa3409 Eliminate test issue while clients wait for async free
Former-commit-id: a41fb1b036
2021-05-26 01:18:47 +00:00
John Sully 598887ec75 Fix failure sending deferred aggregate lengths to clients on other threads (merge bug)
Former-commit-id: 915117ae7b
2021-05-25 20:51:18 +00:00
John Sully 45b724d03e Remove duplicate code
Former-commit-id: de5fa78762
2021-05-25 20:50:40 +00:00
John Sully 096ac1019d Fix TLS test failure due to tls-port not marked as runtime configurable
Former-commit-id: b0c8efd840
2021-05-25 20:50:23 +00:00
John Sully 554962b31e Fix crash in TLS due to merge
Former-commit-id: 1dcd5edbf9
2021-05-25 18:52:27 +00:00
John Sully 8e8773a574 Build break fix: Remove dependency on future C++ feature
Former-commit-id: 87d7fc8e5d
2021-05-25 18:52:08 +00:00
John Sully 221e4a3d13 More OS X build breaks
Former-commit-id: 100a747eab
2021-05-25 18:35:45 +00:00
John Sully acd9d5a0fa OS X build break fix
Former-commit-id: 105fd03ef8
2021-05-25 18:32:31 +00:00
John Sully 8fd5ac303b Fix uninitialized variable
Former-commit-id: 9395a9c1d9
2021-05-25 18:30:07 +00:00
John Sully 47054b40c9 Fix duplicate checks (resolve PR comments)
Former-commit-id: 02f7efd9d4
2021-05-25 16:57:49 +00:00
John Sully 655cdd7d3c Fix TLS Build Errors
Former-commit-id: aea86c5977
2021-05-25 16:55:59 +00:00
VivekSainiEQ 6f5e7e0bb5 Initialized serverTL in more places in module.cpp
Former-commit-id: 31cac772a925893c25c8ee7f67a13535818c752d
2021-05-25 16:55:47 +00:00
VivekSainiEQ ace622ba15 Fixed single threaded for real this time, need to add synchronization for multi threaded
Former-commit-id: 4d858dac1a503f4d518477212ba585069af22574
2021-05-21 17:05:55 +00:00
VivekSainiEQ 2154d54f6b Fixed single threaded for real this time, need to add synchronization for multi threaded
Former-commit-id: 4d858dac1a503f4d518477212ba585069af22574
2021-05-21 17:05:55 +00:00
John Sully 25f083a1f4 Merge tag '6.2.2' into unstable
Former-commit-id: 93ebb31b17
2021-05-21 05:54:39 +00:00
christianEQ a9aec03dde license status OK if not checking license
Former-commit-id: 6bfdc9d41dc638989d50f005af8d66e4ed47ce77
2021-05-20 19:09:02 +00:00
christianEQ 7a0a307b6c license status OK if not checking license
Former-commit-id: 6bfdc9d41dc638989d50f005af8d66e4ed47ce77
2021-05-20 19:09:02 +00:00
John Sully f6b81914d8 Merge tag '6.2.1' into unstable
Former-commit-id: bfed57e3e0
2021-05-19 02:59:48 +00:00
Malavan 0809cc1e0c Fix issue with INVALID_EXPIRE overlapping with mask
Former-commit-id: b66949d8c0a97110e22c68607411fa1095226162
2021-05-17 21:38:42 +00:00
Malavan fb37f9e297 Merge remote-tracking branch 'upstream/unstable' into fixissue295
Former-commit-id: 25fab4ed4a42378f0e0d018db42a235c258f34fe
2021-05-17 21:35:43 +00:00
Malavan 03400d555a merge when and whenFull
Former-commit-id: 2e63ff052725f3aaf4c008ae7c86250c145f282e
2021-05-15 05:48:23 +00:00
Malavan 2d960bbbfe Speedup keyIsExpired by removing subkey search
Former-commit-id: 4f6935f98b491243669482f95be4e224bb463986
2021-05-07 09:40:23 +00:00
John Sully 6949ba3e74 Fix test hang
Former-commit-id: 23647390e6
2021-05-07 00:28:10 +00:00
VivekSainiEQ 89e9af0aef Changed branding in various locations
Former-commit-id: 96bca72bb4
2021-05-06 20:13:45 -04:00
John Sully 7cb340cbdd Pause execution during rdbLoadProgressCallback as its too risky to let it run
Former-commit-id: e70c01cb3e756d1e02ed190b76c73b7b7010c0d3
2021-05-06 00:42:49 +00:00
John Sully 88fe187e45 Pause execution during rdbLoadProgressCallback as its too risky to let it run
Former-commit-id: e70c01cb3e756d1e02ed190b76c73b7b7010c0d3
2021-05-06 00:42:49 +00:00
John Sully 760fff16bf Add endurance testing to better detect threading bugs
Former-commit-id: 945e428aa110968479fdcdfc2d5c5308a99eadc3
2021-05-06 00:09:07 +00:00
John Sully 007b4fc2a1 Add endurance testing to better detect threading bugs
Former-commit-id: 945e428aa110968479fdcdfc2d5c5308a99eadc3
2021-05-06 00:09:07 +00:00
VivekSainiEQ dc1fc6da7e Fixed data race? Seems to be passing multithreaded test cases now
Former-commit-id: cb13edd1200c1230fa7e313d69c69e06129951d3
2021-05-05 22:26:36 +00:00
VivekSainiEQ f050652e74 Fixed data race? Seems to be passing multithreaded test cases now
Former-commit-id: cb13edd1200c1230fa7e313d69c69e06129951d3
2021-05-05 22:26:36 +00:00
VivekSainiEQ 57c50c45e0 Updated overhead calculation to only use repl_backlog_size
Former-commit-id: 6f93c7eb44d84bb143b4ad4fff3c6a5436ebaaf7
2021-05-05 17:04:08 +00:00
VivekSainiEQ 4f2b5bf50f Updated overhead calculation to only use repl_backlog_size
Former-commit-id: 6f93c7eb44d84bb143b4ad4fff3c6a5436ebaaf7
2021-05-05 17:04:08 +00:00
VivekSainiEQ a6ac4ec42d Updated maxmemory tests to account for overhead in new replication backlog behaviour
Former-commit-id: 4cd197959693dfe4d1497c3f703cf6aaa27d34ad
2021-05-05 16:37:02 +00:00
VivekSainiEQ 24956cb5af Updated maxmemory tests to account for overhead in new replication backlog behaviour
Former-commit-id: 4cd197959693dfe4d1497c3f703cf6aaa27d34ad
2021-05-05 16:37:02 +00:00
Malavan 93fbec9d7e add lookup limit to active subkey expire
Former-commit-id: 697e122cd9b4188329a4cef788891455d8fcd0c5
2021-05-04 22:28:03 +00:00
Malavan c1fb90e61a add lookup limit to active subkey expire
Former-commit-id: a9e2fb1731304d170f3b30f2c708cdbb44e8c092
2021-05-04 21:34:25 +00:00
John Sully de80fd8d29 Merge branch 'keydbpro' into keydbpro_collab
Former-commit-id: 446daf8f4c33005096372ad9e29ae9b3d465c64e
2021-05-03 22:58:56 +00:00
John Sully 28e11e5766 Merge branch 'keydbpro' into keydbpro_collab
Former-commit-id: 446daf8f4c33005096372ad9e29ae9b3d465c64e
2021-05-03 22:58:56 +00:00
jsully cfad8e971d Merge branch 'cluster_bugfix' into 'keydbpro'
Set repl_down_since in freeClientAsync

See merge request keydb-dev/KeyDB-Pro!12

Former-commit-id: bd7591fe50b1e5565da2fa521438b88058d4da07
2021-05-03 21:41:05 +00:00
jsully 62a8d238ca Merge branch 'cluster_bugfix' into 'keydbpro'
Set repl_down_since in freeClientAsync

See merge request keydb-dev/KeyDB-Pro!12

Former-commit-id: bd7591fe50b1e5565da2fa521438b88058d4da07
2021-05-03 21:41:05 +00:00
christian 950fe2d370 Set repl_down_since in freeClientAsync
Former-commit-id: fb4bd2984651837fadd1dbbbb56327e8452b4a2a
2021-05-03 21:41:04 +00:00
christian 101a0b9e5d Set repl_down_since in freeClientAsync
Former-commit-id: fb4bd2984651837fadd1dbbbb56327e8452b4a2a
2021-05-03 21:41:04 +00:00
John Sully 0afdff5ce7 Ensure multithread load works with FLASH storage
Former-commit-id: 24e2991c7aa2cef90a89b1640f7095235c5d34ed
2021-05-03 20:18:45 +00:00
John Sully e09f383bec Ensure multithread load works with FLASH storage
Former-commit-id: 24e2991c7aa2cef90a89b1640f7095235c5d34ed
2021-05-03 20:18:45 +00:00
VivekSainiEQ edfcc6700a Forgot to add server.h in last commit
Former-commit-id: 34fa6119c9a3f1533cc3e6e5d118dc6424a70891
2021-05-03 16:49:09 +00:00
VivekSainiEQ 3298a34592 Forgot to add server.h in last commit
Former-commit-id: 34fa6119c9a3f1533cc3e6e5d118dc6424a70891
2021-05-03 16:49:09 +00:00
John Sully ceff9cba70 Respect replica output buffer limits when adding large commands to the ring buffer
Former-commit-id: 37ec01cfd8a8da1e895c7cdc358d382d35ad59dd
2021-05-03 16:33:16 +00:00
John Sully 96738f6e16 Respect replica output buffer limits when adding large commands to the ring buffer
Former-commit-id: 37ec01cfd8a8da1e895c7cdc358d382d35ad59dd
2021-05-03 16:33:16 +00:00
VivekSainiEQ 51d7c726eb Now tracks memory and resizes 'accurately', need to fix cluster
Former-commit-id: 5f0e01cc199427ab6dfd7f8f28321f6a1f34fd1c
2021-05-03 16:29:11 +00:00
VivekSainiEQ 00be2d6a8c Now tracks memory and resizes 'accurately', need to fix cluster
Former-commit-id: 5f0e01cc199427ab6dfd7f8f28321f6a1f34fd1c
2021-05-03 16:29:11 +00:00
John Sully 9e194bf712 Don't sync too often it hurts perf
Former-commit-id: a20e89a457a0a682483c22f0f1cdb5c93c574d28
2021-05-03 04:15:46 +00:00
John Sully c1cc3c04ad Don't sync too often it hurts perf
Former-commit-id: a20e89a457a0a682483c22f0f1cdb5c93c574d28
2021-05-03 04:15:46 +00:00
John Sully 8fee5c8dc5 Fix remaining test failures
Former-commit-id: 37e607f9b13b6601ff52e74e613fb369cab22b56
2021-05-03 02:37:02 +00:00
John Sully 38a9edbacb Fix remaining test failures
Former-commit-id: 37e607f9b13b6601ff52e74e613fb369cab22b56
2021-05-03 02:37:02 +00:00
John Sully 995cd35f24 Fix issue where async load thread misses work
Former-commit-id: a24a7b093295c5f5d69feee9fbc37c64cfa8aa03
2021-04-30 18:48:23 +00:00
John Sully 35cfaa6eca Fix issue where async load thread misses work
Former-commit-id: a24a7b093295c5f5d69feee9fbc37c64cfa8aa03
2021-04-30 18:48:23 +00:00
John Sully 1133c3049f Fix majority of test issues with multithread load
Former-commit-id: 4db88176e33e3615ffb90852b49e76b12d5b4622
2021-04-30 18:45:37 +00:00
John Sully 9edfd54b63 Fix majority of test issues with multithread load
Former-commit-id: 4db88176e33e3615ffb90852b49e76b12d5b4622
2021-04-30 18:45:37 +00:00
John Sully e71a845fdd Initial implementation of multithread load
Former-commit-id: 87b0657c3acd7a3c89964afe1702851b44467c9a
2021-04-30 17:32:54 +00:00
John Sully afec826030 Initial implementation of multithread load
Former-commit-id: 87b0657c3acd7a3c89964afe1702851b44467c9a
2021-04-30 17:32:54 +00:00
VivekSainiEQ abe08bf8be Performance optimizations
Former-commit-id: 7fd83d467784d293f7da78b74f9b9763ce387238
2021-04-29 18:51:30 +00:00
VivekSainiEQ 7fa9844579 Performance optimizations
Former-commit-id: 7fd83d467784d293f7da78b74f9b9763ce387238
2021-04-29 18:51:30 +00:00
VivekSainiEQ 10e3eb917e Updated resize logic
Former-commit-id: e6d892ef21b7fc6f51433f32b01198038e555419
2021-04-29 17:01:06 +00:00
VivekSainiEQ c047c180df Updated resize logic
Former-commit-id: e6d892ef21b7fc6f51433f32b01198038e555419
2021-04-29 17:01:06 +00:00
benschermel bbe4de456b update README with community slack info
Former-commit-id: 6163e7b13a
2021-04-29 03:11:54 +00:00
christianEQ f7e86c62d2 fixed diagnostic tool to use correct obj files
Former-commit-id: 69747205fb0046b187b3cf67ad6bff7eda61de73
2021-04-28 16:02:44 +00:00
christianEQ d38445540f updated makefile vars to keydb names
Former-commit-id: b459f73fac6c38f3258a5eb5c8d8573deb6179f8
2021-04-27 21:14:05 +00:00
christianEQ b49eafa7db added keydb-diagnostic-tool binary (copy of benchmark)
Former-commit-id: d93ee004c5d87f6f81d3ca503b7745cc0e977600
2021-04-27 20:56:37 +00:00
VivekSainiEQ 2183eca2be Primitive implementation of bypassing client buffer, stats are all messed up and print statements everywhere
Former-commit-id: 8ae310fb0f7b53add826f76891da333b63860001
2021-04-26 22:13:32 +00:00
VivekSainiEQ d1ff0a428c Primitive implementation of bypassing client buffer, stats are all messed up and print statements everywhere
Former-commit-id: 8ae310fb0f7b53add826f76891da333b63860001
2021-04-26 22:13:32 +00:00
John Sully 5c045b8fed Optimize freeMemory by lazy freeing objects
Former-commit-id: cca31ed5ee2f42975f0051cfabf1e88720b3d678
2021-04-21 01:20:13 +00:00
John Sully 223869a4bb Optimize freeMemory by lazy freeing objects
Former-commit-id: cca31ed5ee2f42975f0051cfabf1e88720b3d678
2021-04-21 01:20:13 +00:00
John Sully 5413584b5c Better RocksDB perf tuning
Former-commit-id: cbe1e0a7c1b5dc49c1adff07b7c32042e673acf4
2021-04-21 01:19:44 +00:00
John Sully b5186a76d6 Better RocksDB perf tuning
Former-commit-id: cbe1e0a7c1b5dc49c1adff07b7c32042e673acf4
2021-04-21 01:19:44 +00:00
John Sully 1b14a3621f Fix issue where we reply a dangling pointer
Former-commit-id: fd11e490c39fe876d979eace5eaec56c645cdfcf
2021-04-21 01:19:29 +00:00
John Sully b0f16a88cd Fix issue where we reply a dangling pointer
Former-commit-id: fd11e490c39fe876d979eace5eaec56c645cdfcf
2021-04-21 01:19:29 +00:00
John Sully 24f5098d17 _dictExpandIfNeeded is called too late to be useful
Former-commit-id: 7f75ca5d3a9ed47465bceb22f5f74fd6f0760008
2021-04-21 01:18:38 +00:00
John Sully e0a17a583c _dictExpandIfNeeded is called too late to be useful
Former-commit-id: 7f75ca5d3a9ed47465bceb22f5f74fd6f0760008
2021-04-21 01:18:38 +00:00
John Sully 1c40cccc4c Allow prefetch even with a single thread
Former-commit-id: 2e68821b330a6bae8a352e37c3da643d504b2ce3
2021-04-12 04:44:52 +00:00
John Sully 4607953218 Allow prefetch even with a single thread
Former-commit-id: 2e68821b330a6bae8a352e37c3da643d504b2ce3
2021-04-12 04:44:52 +00:00
John Sully 53fdec20ec Avoid posting unnecessary async tasks
Former-commit-id: 1661d2a05943f96992be195f5dc32dd9a67c0e68
2021-04-12 03:44:29 +00:00
John Sully 616357cb50 Avoid posting unnecessary async tasks
Former-commit-id: 1661d2a05943f96992be195f5dc32dd9a67c0e68
2021-04-12 03:44:29 +00:00
John Sully 9dfdae6c3b Fix issue where GC is not free'd until a BGSAVE
Former-commit-id: 38523e6b508cf5f4b40c178dfe98554abea8f6bd
2021-04-12 03:44:15 +00:00
John Sully 357330dcd5 Fix issue where GC is not free'd until a BGSAVE
Former-commit-id: 38523e6b508cf5f4b40c178dfe98554abea8f6bd
2021-04-12 03:44:15 +00:00
John Sully 5ddbcd065e Make prefetch more aggressive
Former-commit-id: 25a5cfefcf7fa3451e92500f5d310290c4b6bbde
2021-04-12 03:42:05 +00:00
John Sully f2e86ecfb7 Make prefetch more aggressive
Former-commit-id: 25a5cfefcf7fa3451e92500f5d310290c4b6bbde
2021-04-12 03:42:05 +00:00
John Sully d30bee0c5f Don't prefetch when lock contention is low, it increases latency
Former-commit-id: 0d21614e0e5aba28acd364231823d51a3073081f
2021-04-12 03:41:53 +00:00
John Sully 4f7205f5ac Don't prefetch when lock contention is low, it increases latency
Former-commit-id: 0d21614e0e5aba28acd364231823d51a3073081f
2021-04-12 03:41:53 +00:00
John Sully 64cd1d636a Reduce P99 latency with async rehash
Former-commit-id: 7ea4c26fd82c0cdfa377183083f38a43336e480b
2021-04-12 03:39:13 +00:00
John Sully c0e07e5ae3 Reduce P99 latency with async rehash
Former-commit-id: 7ea4c26fd82c0cdfa377183083f38a43336e480b
2021-04-12 03:39:13 +00:00
John Sully 37a3df1fb7 Make prefetch configurable
Former-commit-id: 3b660347d70cc25d57119080bd43fb4671e36488
2021-04-12 03:38:57 +00:00
John Sully c63f8e7568 Make prefetch configurable
Former-commit-id: 3b660347d70cc25d57119080bd43fb4671e36488
2021-04-12 03:38:57 +00:00
John Sully 6d45e00876 Make prefetch more aggressive
Former-commit-id: 9cb0be197fb96d7fb3cb697c19b5be313b01337a
2021-04-12 03:24:05 +00:00
John Sully 164d10f655 Make prefetch more aggressive
Former-commit-id: 9cb0be197fb96d7fb3cb697c19b5be313b01337a
2021-04-12 03:24:05 +00:00
John Sully efef50b5d8 Don't prefetch when lock contention is low, it increases latency
Former-commit-id: 9b2629f6a20368cec8e55f0d006f3a67c8b770b7
2021-04-12 03:23:49 +00:00
John Sully 6f19b3acca Don't prefetch when lock contention is low, it increases latency
Former-commit-id: 9b2629f6a20368cec8e55f0d006f3a67c8b770b7
2021-04-12 03:23:49 +00:00
John Sully 47588d6da8 Reduce P99 latency with async rehash
Former-commit-id: 6c045837c7cf92dc92be35465229b482e09e46d2
2021-04-12 03:22:22 +00:00
John Sully a4f9891699 Reduce P99 latency with async rehash
Former-commit-id: 6c045837c7cf92dc92be35465229b482e09e46d2
2021-04-12 03:22:22 +00:00
John Sully a8d2656e87 DO not set the timethread as high priority, it can starve the server threads
Former-commit-id: faeac65371af9d6b6effe0886bcbdefaec24ad6d
2021-04-09 01:06:24 +00:00
John Sully 3534b0bf8c DO not set the timethread as high priority, it can starve the server threads
Former-commit-id: faeac65371af9d6b6effe0886bcbdefaec24ad6d
2021-04-09 01:06:24 +00:00
John Sully ef48760857 DO not set the timethread as high priority, it can starve the server threads
Former-commit-id: 5355207a0ad3f1a191fa06450490c792caa76e87
2021-04-09 01:05:55 +00:00
John Sully ee70e6ef6a DO not set the timethread as high priority, it can starve the server threads
Former-commit-id: 5355207a0ad3f1a191fa06450490c792caa76e87
2021-04-09 01:05:55 +00:00
John Sully b8ecf1e705 Make prefetch configurable
Former-commit-id: 16996c048042bd3799c8051645bbe7c54137d54c
2021-04-08 19:52:38 +00:00
John Sully 292d52890e Make prefetch configurable
Former-commit-id: 16996c048042bd3799c8051645bbe7c54137d54c
2021-04-08 19:52:38 +00:00
John Sully a9b727ff48 Avoid posting unnecessary async tasks
Former-commit-id: 08f63fdfd6c78388bba093ec2edda7d77fc9173e
2021-04-07 17:41:20 +00:00
John Sully 059d0dee23 Avoid posting unnecessary async tasks
Former-commit-id: 08f63fdfd6c78388bba093ec2edda7d77fc9173e
2021-04-07 17:41:20 +00:00
John Sully fb0a113dad Fix issue where GC is not free'd until a BGSAVE
Former-commit-id: e19350005b571591876e49219bfca75e905604a5
2021-04-07 17:30:59 +00:00
John Sully 06cd8b5f1f Fix issue where GC is not free'd until a BGSAVE
Former-commit-id: e19350005b571591876e49219bfca75e905604a5
2021-04-07 17:30:59 +00:00
John Sully c5b96a4ff1 Reduce connection latency for cluster clients
Former-commit-id: f1acee99bdaee4faf9e18cdf4734d51a73e78a41
2021-04-07 15:49:58 +00:00
John Sully 06891c8e7b Reduce connection latency for cluster clients
Former-commit-id: f1acee99bdaee4faf9e18cdf4734d51a73e78a41
2021-04-07 15:49:58 +00:00
John Sully 08265654d9 Fix build break from merge conflicts
Former-commit-id: 5052388bd43b0e42430fd741fb2b403544684246
2021-04-07 15:25:22 +00:00
John Sully e44e85e042 Fix build break from merge conflicts
Former-commit-id: 5052388bd43b0e42430fd741fb2b403544684246
2021-04-07 15:25:22 +00:00
John Sully 90906c36af Merge branch 'keydbpro' of https://gitlab.eqalpha.com/external-collab/keydb-pro-6 into keydbpro_collab
Former-commit-id: e077756b140855cb5a7e60567abf845dbfbc162d
2021-04-07 15:14:59 +00:00
John Sully 2385f7443e Merge branch 'keydbpro' of https://gitlab.eqalpha.com/external-collab/keydb-pro-6 into keydbpro_collab
Former-commit-id: e077756b140855cb5a7e60567abf845dbfbc162d
2021-04-07 15:14:59 +00:00
jsully cc5c051de6 Merge branch 'flash_read_perf' into 'keydbpro'
Flash read perf

See merge request external-collab/keydb-pro-6!1

Former-commit-id: f6d7277f307b78f079dd99bf532cd26a7b62018d
2021-04-07 06:12:55 +00:00
jsully fbe0319ba2 Merge branch 'flash_read_perf' into 'keydbpro'
Flash read perf

See merge request external-collab/keydb-pro-6!1

Former-commit-id: f6d7277f307b78f079dd99bf532cd26a7b62018d
2021-04-07 06:12:55 +00:00
Cloud User 6cb110a4b8 Make high pri time thread configurable
Former-commit-id: 7e94207765d2166f46792aea0919786f3f30d7b3
2021-04-06 22:39:20 +00:00
Cloud User 9764bf43e4 Make high pri time thread configurable
Former-commit-id: 7e94207765d2166f46792aea0919786f3f30d7b3
2021-04-06 22:39:20 +00:00
christianEQ 61abb462c4 check for musl in logging.tcl as backtrace() is not available with it
Former-commit-id: b9fc00651c5740dced751a3700f6891f5dae0b8a
2021-04-05 11:09:49 -04:00
John Sully 7ecff2c81d Don't ensure if we don't have to
Former-commit-id: b7b678a3ada531890e67313c867b7b49b01fe41e
2021-04-01 18:17:05 +00:00
John Sully 7133b9dffa Don't ensure if we don't have to
Former-commit-id: b7b678a3ada531890e67313c867b7b49b01fe41e
2021-04-01 18:17:05 +00:00
jsully 11046122d1 Merge branch 'keydbpro' into 'flash_read_perf'
# Conflicts:
#   src/db.cpp
#   src/networking.cpp

Former-commit-id: e16c846b2b9e70f20981172287b19e585f81d73d
2021-04-01 17:25:31 +00:00
jsully f91b859668 Merge branch 'keydbpro' into 'flash_read_perf'
# Conflicts:
#   src/db.cpp
#   src/networking.cpp

Former-commit-id: e16c846b2b9e70f20981172287b19e585f81d73d
2021-04-01 17:25:31 +00:00
John Sully fad8cfb654 Fix issue #300
Former-commit-id: 22d0bca3a51bef7d42264b518b1c470df51fdc5e
2021-03-30 23:45:07 +00:00
John Sully 6caf6678b7 Fix issue #300
Former-commit-id: 22d0bca3a51bef7d42264b518b1c470df51fdc5e
2021-03-30 23:45:07 +00:00
John Sully 43cbcb6283 Fix issue #300
Former-commit-id: bee7f398c9c3b4c01b687d26194913bf215dca36
2021-03-30 23:44:34 +00:00
John Sully 30e5abf59f Fix issue #300
Former-commit-id: bee7f398c9c3b4c01b687d26194913bf215dca36
2021-03-30 23:44:34 +00:00
John Sully 0686803753 Fix issue #300
Former-commit-id: 571815035089d91c66c8ac744134921dcb3463ad
2021-03-30 23:30:41 +00:00
John Sully 802e0df3ac Fix issue #300
Former-commit-id: 59e70d9d56d9fe84992afb9bb0bfb4f332f68710
2021-03-30 23:30:17 +00:00
John Sully d533499d02 Fix crash in RDB save
Former-commit-id: b032809b3e978fe571b791179d32ecdc9c067045
2021-03-30 20:49:33 +00:00
John Sully a2fa45ad22 Fix crash in RDB save
Former-commit-id: b032809b3e978fe571b791179d32ecdc9c067045
2021-03-30 20:49:33 +00:00
John Sully 205a3a08fe Merge branch 'keydbpro' of https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro into keydbpro
Former-commit-id: c4eefb1345209790e31b41401d1870473a401676
2021-03-30 20:44:36 +00:00
John Sully bc4428e0a6 Merge branch 'keydbpro' of https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro into keydbpro
Former-commit-id: c4eefb1345209790e31b41401d1870473a401676
2021-03-30 20:44:36 +00:00
John Sully 8595e669a2 Fix crash in RDB save
Former-commit-id: ef1e122fcb039d25f60752ca27c9feb5e8cfbb31
2021-03-30 20:44:22 +00:00
John Sully 9b433d60b4 Fix crash in RDB save
Former-commit-id: ef1e122fcb039d25f60752ca27c9feb5e8cfbb31
2021-03-30 20:44:22 +00:00
jsully 2a6bb9356b Merge branch 'jesse/update-readme-build-instructions-default-branch' into 'keydbpro'
Add additional libraries that need to be installed for building pro

See merge request keydb-dev/KeyDB-Pro!17

Former-commit-id: d42c70048d4e4b7dd0ecc802742ff45f7c959b1c
2021-03-30 20:20:45 +00:00
jsully 0930736378 Merge branch 'jesse/update-readme-build-instructions-default-branch' into 'keydbpro'
Add additional libraries that need to be installed for building pro

See merge request keydb-dev/KeyDB-Pro!17

Former-commit-id: d42c70048d4e4b7dd0ecc802742ff45f7c959b1c
2021-03-30 20:20:45 +00:00
Jesse 420b8c2536 Add additional libraries that need to be installed for building pro
Former-commit-id: 303a0646b5510e310dfd03c7288d747f76ce3d62
2021-03-30 13:14:03 -07:00
Jesse af946c3e3f Add additional libraries that need to be installed for building pro
Former-commit-id: 303a0646b5510e310dfd03c7288d747f76ce3d62
2021-03-30 13:14:03 -07:00
Jesse 71916be8e0 Add additional libraries that need to be installed for building pro
Former-commit-id: 506d4229c46598330ed39d837196d790bf4867cb
2021-03-30 13:12:23 -07:00
Jesse b827cf20b8 Add additional libraries that need to be installed for building pro
Former-commit-id: 506d4229c46598330ed39d837196d790bf4867cb
2021-03-30 13:12:23 -07:00
Hanif Ariffin 393e88f3d3 Fix typo in error string
Former-commit-id: b8cd7d90264d9a2cafdff3d6feb2ca501edf366b
2021-03-30 13:52:47 -04:00
VivekSainiEQ a0ac5f67ff Added logic back to only acquire/release GIL if modules are enabled, without causing deadlocks
Former-commit-id: e80c892a964a5675a6296efb1b416585fe9e5d35
2021-03-30 13:46:03 -04:00
VivekSainiEQ 35a95a5fdc now acquire and release GIL every time you go to/wake from sleep
Former-commit-id: 79fd5e8efa73795b3f7c43b7867f316b24abcbc6
2021-03-30 13:46:03 -04:00
VivekSainiEQ 7ff439e4b1 Created and initialized seperate thread variables for modules
Former-commit-id: ab508bf18f8bcf20dddd258cd8cd8de97df64802
2021-03-30 13:46:03 -04:00
VivekSainiEQ faa788ae43 Readded getkeys to module build
Former-commit-id: 330eabc49fdf67b00c707ed49d8c2512728325a5
2021-03-30 13:46:03 -04:00
John Sully 866dcc954c Merge branch 'unstable' of https://github.com/JohnSully/KeyDB into unstable
Former-commit-id: 907928d65dffee97a788609af40a462e53932d1e
2021-03-29 00:49:34 +00:00
John Sully a28afc203b Enable LTO
Former-commit-id: a6edb104b7142b8e76048e0534e342048ade08d6
2021-03-29 00:47:50 +00:00
John Sully ec166f3a91 Enable LTO
Former-commit-id: a6edb104b7142b8e76048e0534e342048ade08d6
2021-03-29 00:47:50 +00:00
John Sully cff7ee08d5 Prevent unnecessary copies in replication scenarios
Former-commit-id: b152a9bd88c081ce98eebe9a7af49649e60e5523
2021-03-28 22:43:15 +00:00
John Sully 929417233d Prevent unnecessary copies in replication scenarios
Former-commit-id: b152a9bd88c081ce98eebe9a7af49649e60e5523
2021-03-28 22:43:15 +00:00
John Sully cfcab8f330 Make some asserts debug only for perf
Former-commit-id: dc66209f2cf8eadb794dad302bd1ea92890e75b0
2021-03-28 21:08:48 +00:00
John Sully ea5ca47234 Make some asserts debug only for perf
Former-commit-id: dc66209f2cf8eadb794dad302bd1ea92890e75b0
2021-03-28 21:08:48 +00:00
John Sully ecc8e28d19 Excessive rehashing adds latency
Former-commit-id: ee5a4528d61420a18f89a07f4ac63e2181a19738
2021-03-28 20:22:01 +00:00
John Sully ba403c8833 Excessive rehashing adds latency
Former-commit-id: ee5a4528d61420a18f89a07f4ac63e2181a19738
2021-03-28 20:22:01 +00:00
John Sully b4cef22f69 Fix thread safety issues with the cache prefetch logic
Former-commit-id: 4892122fc02109d98684a350bd732a0b08a8c7b4
2021-03-28 20:21:44 +00:00
John Sully 7523d80632 Fix thread safety issues with the cache prefetch logic
Former-commit-id: 4892122fc02109d98684a350bd732a0b08a8c7b4
2021-03-28 20:21:44 +00:00
John Sully 9446b1b71d Prefetch keys even in pure RAM scenarios
Former-commit-id: d7219de186d60a5a437c1828ac97117eaad34819
2021-03-28 20:21:31 +00:00
John Sully 9655ec0b4a Prefetch keys even in pure RAM scenarios
Former-commit-id: d7219de186d60a5a437c1828ac97117eaad34819
2021-03-28 20:21:31 +00:00
John Sully 8bcf649faa Eliminate unnecessary lookup in ensure when there is no snapshot
Former-commit-id: 1f363ed7c13c186f0c120ab4f3e321144667f50f
2021-03-28 20:19:15 +00:00
John Sully 734e18774b Eliminate unnecessary lookup in ensure when there is no snapshot
Former-commit-id: 1f363ed7c13c186f0c120ab4f3e321144667f50f
2021-03-28 20:19:15 +00:00
John Sully 7a2e02ca59 Enable LTO
Former-commit-id: 3ec75184bae92c0e7af579eda8cbe6cfa2375327
2021-03-28 20:13:54 +00:00
John Sully bb7c5fd4ca Enable LTO
Former-commit-id: 3ec75184bae92c0e7af579eda8cbe6cfa2375327
2021-03-28 20:13:54 +00:00
John Sully c4888f2c65 Enable LTO
Former-commit-id: 7241bfc25525e8b27193fb0d4f9eae2e5e98e8d6
2021-03-28 18:27:14 +00:00
John Sully f0d9393a65 Enable LTO
Former-commit-id: 7241bfc25525e8b27193fb0d4f9eae2e5e98e8d6
2021-03-28 18:27:14 +00:00
John Sully d35de9dbf0 Make some asserts debug only for perf
Former-commit-id: c22740df4f7c1468fbe19fd97dfaec20e011b6f1
2021-03-28 18:27:00 +00:00
John Sully 52f7a35480 Make some asserts debug only for perf
Former-commit-id: c22740df4f7c1468fbe19fd97dfaec20e011b6f1
2021-03-28 18:27:00 +00:00
John Sully 31e2daacb3 Excessive rehashing adds latency
Former-commit-id: 9db2277b0fea032abcde089f617fe7e4f5ce12e3
2021-03-28 17:59:02 +00:00
John Sully 0cc4b4a3b9 Excessive rehashing adds latency
Former-commit-id: 9db2277b0fea032abcde089f617fe7e4f5ce12e3
2021-03-28 17:59:02 +00:00
John Sully 2b6f72a1b4 Fix thread safety issues with the cache prefetch logic
Former-commit-id: a80a128bb64b81115c095d6dd91896ff73048b3d
2021-03-28 17:58:43 +00:00
John Sully 327e51c761 Fix thread safety issues with the cache prefetch logic
Former-commit-id: a80a128bb64b81115c095d6dd91896ff73048b3d
2021-03-28 17:58:43 +00:00
benschermel a735700a50 bump version
Former-commit-id: 82f946187730290919c6c5433eead6a14397c772
2021-03-27 18:30:52 +00:00
benschermel 61d0605ae3 bump version
Former-commit-id: 33b75e0a2cf8712c976e7af74e2a615bb991c356
2021-03-27 18:26:11 +00:00
benschermel fb8db543f1 bump version
Former-commit-id: 33b75e0a2cf8712c976e7af74e2a615bb991c356
2021-03-27 18:26:11 +00:00
John Sully 08a23f72e1 Prefetch keys even in pure RAM scenarios
Former-commit-id: 54c0f11db0b35f34c9dfc3c8b4b76b7b7921bacd
2021-03-26 23:48:24 +00:00
John Sully 52dd09e503 Prefetch keys even in pure RAM scenarios
Former-commit-id: 54c0f11db0b35f34c9dfc3c8b4b76b7b7921bacd
2021-03-26 23:48:24 +00:00
John Sully f2612e4664 Eliminate unnecessary lookup in ensure when there is no snapshot
Former-commit-id: 04540531b95ebadf6d60c90c6681c11060eaf907
2021-03-26 23:44:42 +00:00
John Sully d466af2606 Eliminate unnecessary lookup in ensure when there is no snapshot
Former-commit-id: 04540531b95ebadf6d60c90c6681c11060eaf907
2021-03-26 23:44:42 +00:00
benschermel 8ed4126080 bump version
Former-commit-id: d3660673152f7c7becccc19a7fc19650bdbb4065
2021-03-26 22:57:19 +00:00
benschermel b5d7a722a5 update rpm script for centos8
Former-commit-id: eb639f456586a3105bef1ad7f299c371310e671e
2021-03-26 22:55:12 +00:00
John Sully 2e39d4ba92 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 7e0bcf58224921abf2046dc1f58606ed18ebb379
2021-03-26 02:54:50 +00:00
John Sully 47288fe4c2 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 7e0bcf58224921abf2046dc1f58606ed18ebb379
2021-03-26 02:54:50 +00:00
John Sully 98e5854e11 Fix issue where timethread wakes too slowly
Former-commit-id: 60f875f5eb7cb541e537f0f440ce8d5aeac57862
2021-03-26 02:54:33 +00:00
John Sully f6e5830c14 Fix issue where timethread wakes too slowly
Former-commit-id: 60f875f5eb7cb541e537f0f440ce8d5aeac57862
2021-03-26 02:54:33 +00:00
John Sully 61d803cfdc Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: c180de1c6d3ef25877ec3b4c50698624dfd3320d
2021-03-26 02:36:27 +00:00
John Sully 85a0dc2ab9 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: c180de1c6d3ef25877ec3b4c50698624dfd3320d
2021-03-26 02:36:27 +00:00
jsully 9d41b2fe0e Merge branch 'timethread_idle' into 'keydbpro'
Sleep the time thread when server sleeps

See merge request keydb-dev/KeyDB-Pro!15

Former-commit-id: 0864c46e38f85f03ea69a18162e3797370c17c91
2021-03-26 02:36:01 +00:00
jsully 67ea9f5803 Merge branch 'timethread_idle' into 'keydbpro'
Sleep the time thread when server sleeps

See merge request keydb-dev/KeyDB-Pro!15

Former-commit-id: 0864c46e38f85f03ea69a18162e3797370c17c91
2021-03-26 02:36:01 +00:00
John Sully 6aa51e8e4d Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 20d2c4fd62bb1867b8970b2bb282bd2ed64bcf6e
2021-03-26 01:50:51 +00:00
John Sully e982c1f1a5 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 20d2c4fd62bb1867b8970b2bb282bd2ed64bcf6e
2021-03-26 01:50:51 +00:00
John Sully 3b19014c51 Fix bug where we skip valid dict elements in dictGetRandomKey
Former-commit-id: c25a9a3b84c967428b3598c99a65b14ed2417571
2021-03-26 01:18:39 +00:00
John Sully 569419c981 Fix bug where we skip valid dict elements in dictGetRandomKey
Former-commit-id: c25a9a3b84c967428b3598c99a65b14ed2417571
2021-03-26 01:18:39 +00:00
John Sully 1ab6768267 Prevent unnecessary copies in replication scenarios
Former-commit-id: 84c671cdafae7e84beef722fcc8a90b92918c89d
2021-03-25 23:14:48 +00:00
John Sully 7d986f86d7 Prevent unnecessary copies in replication scenarios
Former-commit-id: 84c671cdafae7e84beef722fcc8a90b92918c89d
2021-03-25 23:14:48 +00:00
christianEQ 8331157897 moved time thread code to end of beforeSleep
Former-commit-id: ac1022c772c7357571829f24c87aa3dc2deade72
2021-03-24 21:16:21 +00:00
christianEQ 8977c9e83f moved time thread code to end of beforeSleep
Former-commit-id: ac1022c772c7357571829f24c87aa3dc2deade72
2021-03-24 21:16:21 +00:00
christianEQ 94b083705c serverAsserts on sleeping_threads, remove bare locks
Former-commit-id: 8c64ca2333d8eb2ee92d835907474ec63e127b62
2021-03-24 20:44:40 +00:00
christianEQ 2d91c3d828 serverAsserts on sleeping_threads, remove bare locks
Former-commit-id: 8c64ca2333d8eb2ee92d835907474ec63e127b62
2021-03-24 20:44:40 +00:00
christianEQ 0da12556e3 counter for time thread sleeping threads
Former-commit-id: 6270939d6a2d7820fecac9c5aedf0ff985531f6b
2021-03-24 20:33:26 +00:00
christianEQ 1db70e13a3 counter for time thread sleeping threads
Former-commit-id: 6270939d6a2d7820fecac9c5aedf0ff985531f6b
2021-03-24 20:33:26 +00:00
John Sully 5c5fe484c4 Fix bug where we skip valid dict elements in dictGetRandomKey
Former-commit-id: 626b56b00824573660af0c47b210fd1e8d2cfeb2
2021-03-24 20:26:33 +00:00
John Sully 084ebaaf30 Fix bug where we skip valid dict elements in dictGetRandomKey
Former-commit-id: 626b56b00824573660af0c47b210fd1e8d2cfeb2
2021-03-24 20:26:33 +00:00
christianEQ fe6965e6c9 removed extraneous wakeTimeThread cal
Former-commit-id: cfb5c5d7dc1e09c51ca416a2dbb19eab4bbaa77a
2021-03-24 20:24:07 +00:00
christianEQ cd5bbcf251 removed extraneous wakeTimeThread cal
Former-commit-id: cfb5c5d7dc1e09c51ca416a2dbb19eab4bbaa77a
2021-03-24 20:24:07 +00:00
John Sully 08c97588f0 Don't run code in evict unless we really have to
Former-commit-id: b665b1c2b2df96883a6e2237f7bf3f9b1bec2a89
2021-03-24 20:13:42 +00:00
John Sully b5adbb82a8 Don't run code in evict unless we really have to
Former-commit-id: b665b1c2b2df96883a6e2237f7bf3f9b1bec2a89
2021-03-24 20:13:42 +00:00
John Sully 3ec53d1583 Bump RocksDB version for better perf
Former-commit-id: ab4ae61b9c54b3c28dc5fd775d0df3d377c4846a
2021-03-24 20:12:43 +00:00
John Sully 368c7a929b Bump RocksDB version for better perf
Former-commit-id: ab4ae61b9c54b3c28dc5fd775d0df3d377c4846a
2021-03-24 20:12:43 +00:00
John Sully 6594175fff Fix bug where we skip valid dict elements in dictGetRandomKey
Former-commit-id: 291a3610a679cb1d17caadf6ab067cad41885935
2021-03-24 19:58:51 +00:00
John Sully 2b273f6bcc Fix bug where we skip valid dict elements in dictGetRandomKey
Former-commit-id: 291a3610a679cb1d17caadf6ab067cad41885935
2021-03-24 19:58:51 +00:00
christianEQ 5de451ba39 added condition variable to time thread; wake on afterSleep, sleep on beforeSleep
Former-commit-id: ff2f2a3aceff2ba4a74951197348d67fc39568b2
2021-03-24 19:27:39 +00:00
christianEQ bb4d3031bd added condition variable to time thread; wake on afterSleep, sleep on beforeSleep
Former-commit-id: ff2f2a3aceff2ba4a74951197348d67fc39568b2
2021-03-24 19:27:39 +00:00
John Sully 2645467fda Disable assert
Former-commit-id: b5d5eeee7cb1900eba192704e5d68c90b9f2b9f2
2021-03-23 23:50:48 +00:00
John Sully c5474170c3 Disable assert
Former-commit-id: b5d5eeee7cb1900eba192704e5d68c90b9f2b9f2
2021-03-23 23:50:48 +00:00
benschermel 15fe9ca5a6 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 99021efc9d4b59a93328e6f85db8b29010b3b0b1
2021-03-23 21:29:16 +00:00
benschermel d2d35b27cc Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 99021efc9d4b59a93328e6f85db8b29010b3b0b1
2021-03-23 21:29:16 +00:00
christian b286eaaee8 Merge branch 'rebrand' into 'keydbpro'
Rebrand

See merge request keydb-dev/KeyDB-Pro!14

Former-commit-id: 6840087819f26804302635dd0a75de523e133f8c
2021-03-23 20:01:05 +00:00
christian ed7bfc10da Merge branch 'rebrand' into 'keydbpro'
Rebrand

See merge request keydb-dev/KeyDB-Pro!14

Former-commit-id: 6840087819f26804302635dd0a75de523e133f8c
2021-03-23 20:01:05 +00:00
benschermel 730946ebeb addressing comments from merge review
Former-commit-id: 955aa69ca16ca7230d5099ad16f6f825402b5dd5
2021-03-23 18:41:59 +00:00
benschermel 39e0e0db7c addressing comments from merge review
Former-commit-id: 955aa69ca16ca7230d5099ad16f6f825402b5dd5
2021-03-23 18:41:59 +00:00
John Sully 0770e77be2 Perform GET command inline
Former-commit-id: 5623936d99e334ab103f3dc1541b145c125d0ee8
2021-03-23 03:44:20 +00:00
John Sully 8b6c824ab3 Perform GET command inline
Former-commit-id: 5623936d99e334ab103f3dc1541b145c125d0ee8
2021-03-23 03:44:20 +00:00
benschermel 2e51ff9d50 update enterprise wording for keydb.config lk
Former-commit-id: feb2d31e6544763c94f4abaea69bc98bd1cb8b17
2021-03-21 05:19:28 +00:00
benschermel af9826ee8f update enterprise wording for keydb.config lk
Former-commit-id: feb2d31e6544763c94f4abaea69bc98bd1cb8b17
2021-03-21 05:19:28 +00:00
VivekSainiEQ 6fd47f1dba Updated jemalloc to version 5.2.1
Former-commit-id: 8f2ef6d6f00981654631b90fbb08339ca96ad5a9
2021-03-19 20:10:27 +00:00
VivekSainiEQ a08ea414f3 Removed hasModuleGIL boolean and added fix from PR #292
Former-commit-id: eb33b6c78fcd4462816a5fd0a0bacdc2d20f23ec
2021-03-19 20:10:24 +00:00
VivekSainiEQ daba381150 added lock releasing w/ hasModuleGIL, changed module serverTL, and moved module_blocking_pipe to global scope to fix issue #276
Former-commit-id: c9b296fbc2bb44940189da05b1f76343b20d700e
2021-03-19 20:08:28 +00:00
benschermel d6c790f574 update rpm script for centos8
Former-commit-id: 8d2e94c9682c46df39ae97302625972d196a03e2
2021-03-18 19:31:54 +00:00
benschermel e1dfab9f1f bump version
Former-commit-id: d5b042f010395628734848fc0b7db370fa9106c4
2021-03-18 02:11:19 +00:00
benschermel 20942bc16d bump version
Former-commit-id: d5b042f010395628734848fc0b7db370fa9106c4
2021-03-18 02:11:19 +00:00
benschermel 5ff1cfc774 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: c03c45a1a1bf3c92a75804e123e34ea394adad07
2021-03-18 02:01:15 +00:00
benschermel 2af23dbff6 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: c03c45a1a1bf3c92a75804e123e34ea394adad07
2021-03-18 02:01:15 +00:00
benschermel 810998b8e0 minor fixes
Former-commit-id: ad7a27d41fb9e8e47966bbee72b28a4be66bbd8f
2021-03-18 01:16:57 +00:00
benschermel 3db62730ab minor fixes
Former-commit-id: ad7a27d41fb9e8e47966bbee72b28a4be66bbd8f
2021-03-18 01:16:57 +00:00
christianEQ d02a582815 fix old reference to c variable (monkey)
Former-commit-id: 0b9b6413c70d4ba71bbabcd0b22fb004d804958f
2021-03-17 20:22:01 +00:00
christianEQ 60101dbd67 fix old reference to c variable (monkey)
Former-commit-id: 0b9b6413c70d4ba71bbabcd0b22fb004d804958f
2021-03-17 20:22:01 +00:00
christianEQ 49a8978ac2 removed unused stuff from monkey
Former-commit-id: be55daa6f7bcbf137b37269d1ee7a5fcacc14ff0
2021-03-17 20:17:52 +00:00
christianEQ 59b48097d9 removed unused stuff from monkey
Former-commit-id: be55daa6f7bcbf137b37269d1ee7a5fcacc14ff0
2021-03-17 20:17:52 +00:00
christianEQ ee19e5ba3d fixed runtime arg for monkey
Former-commit-id: b3e6e1f13b3d24c92d9f7e8441831232f47ff053
2021-03-17 19:50:28 +00:00
christianEQ cefe51e6c3 fixed runtime arg for monkey
Former-commit-id: b3e6e1f13b3d24c92d9f7e8441831232f47ff053
2021-03-17 19:50:28 +00:00
christianEQ a3d64a3f4e working blpop test in monkey
Former-commit-id: 21af13c2a38741ad9e036fad42b23ea2454ac33c
2021-03-17 16:10:06 +00:00
christianEQ 15aa870d2d working blpop test in monkey
Former-commit-id: 21af13c2a38741ad9e036fad42b23ea2454ac33c
2021-03-17 16:10:06 +00:00
christianEQ 6f8f6a5653 track each command separately in monkey
Former-commit-id: e3accdaad985fd9f93490a5cc6704d9ecb909604
2021-03-17 16:03:51 +00:00
christianEQ 8449160521 track each command separately in monkey
Former-commit-id: e3accdaad985fd9f93490a5cc6704d9ecb909604
2021-03-17 16:03:51 +00:00
benschermel a7293b7391 fix rpm script for centos8
Former-commit-id: 6790d9b793b1995b2faae7dbfb5d09dce90a878c
2021-03-17 05:11:01 +00:00
benschermel 89b127823e fix rpm script for centos8
Former-commit-id: 6790d9b793b1995b2faae7dbfb5d09dce90a878c
2021-03-17 05:11:01 +00:00
benschermel 2d25c05371 update all packaging to support enterprise dist
Former-commit-id: 1fd4f27cd271090fc66dba3b09a3800bf1c33b0e
2021-03-17 02:30:34 +00:00
benschermel c14e5bbe79 update all packaging to support enterprise dist
Former-commit-id: 1fd4f27cd271090fc66dba3b09a3800bf1c33b0e
2021-03-17 02:30:34 +00:00
christianEQ 6254157251 unblocking test to monkey, works with 1 client
Former-commit-id: 9fbe8cf6a8aeb141d4a502532a456e4256f4daf8
2021-03-17 01:40:38 +00:00
christianEQ 0187094fd8 unblocking test to monkey, works with 1 client
Former-commit-id: 9fbe8cf6a8aeb141d4a502532a456e4256f4daf8
2021-03-17 01:40:38 +00:00
christianEQ 09eafa7494 parameterized monkey options
Former-commit-id: eda1055689587c25dca3e889dd3a74d3f9c9378f
2021-03-16 23:19:29 +00:00
christianEQ 0e8e3e3cd5 parameterized monkey options
Former-commit-id: eda1055689587c25dca3e889dd3a74d3f9c9378f
2021-03-16 23:19:29 +00:00
John Sully 5d285683dd Make async rehash behave with snapshots (thread safety issues)
Former-commit-id: 372adf39a80252b8035e3c948fcaf7d5ef6f928f
2021-03-16 02:38:41 +00:00
John Sully 86563bab91 Make async rehash behave with snapshots (thread safety issues)
Former-commit-id: 372adf39a80252b8035e3c948fcaf7d5ef6f928f
2021-03-16 02:38:41 +00:00
John Sully 96421f2bd0 Remove snapshot consolidation because its not properly thread safe
Former-commit-id: dcb86d2b92e3ecdb9f914b6f5de9e184cdd23036
2021-03-16 02:37:49 +00:00
John Sully 7cd8632a75 Remove snapshot consolidation because its not properly thread safe
Former-commit-id: dcb86d2b92e3ecdb9f914b6f5de9e184cdd23036
2021-03-16 02:37:49 +00:00
John Sully fb54dba744 Fix TSAN errors in tests
Former-commit-id: 30207d2ab34f175b94f430f97581191343d23f1e
2021-03-16 02:29:24 +00:00
John Sully 16bd1dd059 Fix TSAN errors in tests
Former-commit-id: 30207d2ab34f175b94f430f97581191343d23f1e
2021-03-16 02:29:24 +00:00
benschermel 164eb146ea re-label keydb-pro-server to keydb-server
Former-commit-id: eb6f61ad372f0f4e573b9b731eac6c7f2ada0d9f
2021-03-16 01:57:26 +00:00
benschermel 8d3edbc2b4 re-label keydb-pro-server to keydb-server
Former-commit-id: eb6f61ad372f0f4e573b9b731eac6c7f2ada0d9f
2021-03-16 01:57:26 +00:00
John Sully e5560fc648 Support deletes in the monkey
Former-commit-id: 84101aaa1bd0c89fbaffc11a264788cd75458c48
2021-03-15 19:41:38 +00:00
John Sully be852aa1bb Support deletes in the monkey
Former-commit-id: 84101aaa1bd0c89fbaffc11a264788cd75458c48
2021-03-15 19:41:38 +00:00
John Sully 8e626528c0 Add the monkey script to enhance testing
Former-commit-id: 57ce7b9e9976ca6827415d756ea3cabef1a0d615
2021-03-15 15:32:43 +00:00
John Sully fa8cae657f Add the monkey script to enhance testing
Former-commit-id: 57ce7b9e9976ca6827415d756ea3cabef1a0d615
2021-03-15 15:32:43 +00:00
John Sully 906b115353 We can't swap databases if there are async rehashes
Former-commit-id: 4b8967f94667309c5585032db7403bf4c8885145
2021-03-15 05:46:52 +00:00
John Sully 01c4352706 We can't swap databases if there are async rehashes
Former-commit-id: 4b8967f94667309c5585032db7403bf4c8885145
2021-03-15 05:46:52 +00:00
John Sully 4390666be7 Enable more asserts to better validate snapshots
Former-commit-id: 01113e2eec3a0dbe0d07f98289a0050df7713047
2021-03-14 23:40:41 +00:00
John Sully f666501de6 Enable more asserts to better validate snapshots
Former-commit-id: 01113e2eec3a0dbe0d07f98289a0050df7713047
2021-03-14 23:40:41 +00:00
John Sully 3a0aea272f Fix incorrect memory order on refcounted strings
Former-commit-id: fcf3368b1d56ad7a11e510e5a66e415a46277e8b
2021-03-14 19:42:56 +00:00
John Sully 87ff698b36 Fix incorrect memory order on refcounted strings
Former-commit-id: fcf3368b1d56ad7a11e510e5a66e415a46277e8b
2021-03-14 19:42:56 +00:00
John Sully aacbc3ca06 Avoid queuing null pointers to be freed
Former-commit-id: f50541d437cd1d98139c29407bb3fb4d6ce17fca
2021-03-14 03:22:10 +00:00
John Sully eeb68d7e38 Avoid queuing null pointers to be freed
Former-commit-id: f50541d437cd1d98139c29407bb3fb4d6ce17fca
2021-03-14 03:22:10 +00:00
John Sully 6b4c774c8a Ensure the hash is passed through when moving tombstones
Former-commit-id: 91c8d2d38a33175c64c987b75e94c4b8782a3cdc
2021-03-14 03:21:09 +00:00
John Sully 7381b59022 Ensure the hash is passed through when moving tombstones
Former-commit-id: 91c8d2d38a33175c64c987b75e94c4b8782a3cdc
2021-03-14 03:21:09 +00:00
John Sully 8ab21e8ad9 Reduce log spam
Former-commit-id: a5ba7bdde5435ad5b7cf066e0b45f6df1f784808
2021-03-14 03:19:41 +00:00
John Sully e266759edb Reduce log spam
Former-commit-id: a5ba7bdde5435ad5b7cf066e0b45f6df1f784808
2021-03-14 03:19:41 +00:00
John Sully d63f68a936 Remove rarely used bug-prone code paths from tricky snapshot code
Former-commit-id: dff84228afb97962d77caefe948154090dd5ce23
2021-03-14 03:19:04 +00:00
John Sully dde9d91de2 Remove rarely used bug-prone code paths from tricky snapshot code
Former-commit-id: dff84228afb97962d77caefe948154090dd5ce23
2021-03-14 03:19:04 +00:00
John Sully 9d297cba23 Add checked build support to makefile
Former-commit-id: 7e27c371679d780137a5d39b03b9472651ddf686
2021-03-14 03:18:24 +00:00
John Sully 8537affa36 Add checked build support to makefile
Former-commit-id: 7e27c371679d780137a5d39b03b9472651ddf686
2021-03-14 03:18:24 +00:00
John Sully 847b42242e bump version
Former-commit-id: c802ea93a167ff6c59e585d4ab72c9f7b6b03a1c
2021-03-10 04:03:56 +00:00
John Sully 8ae177ef21 bump version
Former-commit-id: c802ea93a167ff6c59e585d4ab72c9f7b6b03a1c
2021-03-10 04:03:56 +00:00
John Sully 3b518970b0 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 066f984e5223f58b239d99c115901ea9845da513
2021-03-10 04:03:13 +00:00
John Sully 0e5e0e50b6 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 066f984e5223f58b239d99c115901ea9845da513
2021-03-10 04:03:13 +00:00
John Sully 4f1804f11a If we're clearing the command queue we need to reset the parse length
Former-commit-id: 19068f990a77fb428a50a8f751ed6f8cf59a8a74
2021-03-10 02:53:52 +00:00
John Sully a6c3749143 If we're clearing the command queue we need to reset the parse length
Former-commit-id: 19068f990a77fb428a50a8f751ed6f8cf59a8a74
2021-03-10 02:53:52 +00:00
John Sully d882e4126b When we add a delay to rdb save for test purposes we still need to check for aborts
Former-commit-id: b057b4d05aae6c08b855bfc9ae48d41ad0e881f8
2021-03-10 02:53:15 +00:00
John Sully 2a7a302d94 When we add a delay to rdb save for test purposes we still need to check for aborts
Former-commit-id: b057b4d05aae6c08b855bfc9ae48d41ad0e881f8
2021-03-10 02:53:15 +00:00
John Sully 14f60aa1cb Fix failed merge due to overwriting the hashidx and pretending no rehash is in progress
Former-commit-id: 0524b822a05b732e0f3e510dcaeb3304069d3595
2021-03-10 02:52:22 +00:00
John Sully d60b7b3953 Fix failed merge due to overwriting the hashidx and pretending no rehash is in progress
Former-commit-id: 0524b822a05b732e0f3e510dcaeb3304069d3595
2021-03-10 02:52:22 +00:00
John Sully b5c43f682a Fix crash saving an RDB
Former-commit-id: 51c35f03a84f7ada0f150a1c3992df574ab89b95
2021-03-05 00:54:11 +00:00
John Sully bb5780c7fc Fix crash saving an RDB
Former-commit-id: 51c35f03a84f7ada0f150a1c3992df574ab89b95
2021-03-05 00:54:11 +00:00
VivekSainiEQ 71d130ddb2 Updated module tests to default to multithreaded and added tests for RM_CreateTimer while loading .rdb
Former-commit-id: 1b29115190ce3f72fddf8e1549901c327b064880
2021-03-04 23:33:01 +00:00
John Sully 85da00bd91 Load perf fixes with a storage provider set
Former-commit-id: 861b19de00c75c9167cc25031292284ad1c21893
2021-03-04 07:41:06 +00:00
John Sully bfb8332ac6 Load perf fixes with a storage provider set
Former-commit-id: 861b19de00c75c9167cc25031292284ad1c21893
2021-03-04 07:41:06 +00:00
John Sully ca11197dd3 Fix compile warnings
Former-commit-id: c314cab888e9c8b3e825b2dfe0c0392ee998bdc4
2021-03-03 22:12:51 +00:00
John Sully b6817662a1 Fix compile warnings
Former-commit-id: c314cab888e9c8b3e825b2dfe0c0392ee998bdc4
2021-03-03 22:12:51 +00:00
jsully d900de5ec9 Merge branch 'time_thread_priority' into 'keydbpro'
time thread priority + nanosleep

See merge request keydb-dev/KeyDB-Pro!11

Former-commit-id: 423b76a2bbbd568f525f6469ce829ab053972536
2021-03-03 18:55:07 +00:00
jsully e9d8bb7998 Merge branch 'time_thread_priority' into 'keydbpro'
time thread priority + nanosleep

See merge request keydb-dev/KeyDB-Pro!11

Former-commit-id: 423b76a2bbbd568f525f6469ce829ab053972536
2021-03-03 18:55:07 +00:00
John Sully df965d6b3b Data loss issue due to async rehash interfering with snapshots
Former-commit-id: 5245ca9a67c74b34139cafc9754543d1b8bed90a
2021-03-03 07:06:19 +00:00
John Sully bfbf9ecaf3 Data loss issue due to async rehash interfering with snapshots
Former-commit-id: 5245ca9a67c74b34139cafc9754543d1b8bed90a
2021-03-03 07:06:19 +00:00
John Sully 1884a5c578 In low load async rehash may not complete in time, do it in the cron
Former-commit-id: 0a27d30753d887b6251e645abe26118068c55587
2021-03-03 07:05:51 +00:00
John Sully 63920249c7 In low load async rehash may not complete in time, do it in the cron
Former-commit-id: 0a27d30753d887b6251e645abe26118068c55587
2021-03-03 07:05:51 +00:00
John Sully bfc22535ff Don't let dictionaries shrink too rapidly. It can cause massive perf issues while in the shrink rehash
Former-commit-id: a7ad346e4f03c85d22a29c8268d35471e86283aa
2021-03-03 07:05:12 +00:00
John Sully 9856f5f905 Don't let dictionaries shrink too rapidly. It can cause massive perf issues while in the shrink rehash
Former-commit-id: a7ad346e4f03c85d22a29c8268d35471e86283aa
2021-03-03 07:05:12 +00:00
John Sully c8861f1c0d Drastically improve perf when loading an RDB with a storage provider
Former-commit-id: 0133b42d54676e8fac2c5cb006cc87988dced268
2021-03-02 04:16:20 +00:00
John Sully 9d082df132 Drastically improve perf when loading an RDB with a storage provider
Former-commit-id: 0133b42d54676e8fac2c5cb006cc87988dced268
2021-03-02 04:16:20 +00:00
John Sully dd55dd4ce4 Key prefetch error handling instead of crashign
Former-commit-id: b322a14efb1b897134b229c1726b45264b57783f
2021-03-02 01:38:12 +00:00
John Sully a41f244be8 Key prefetch error handling instead of crashign
Former-commit-id: b322a14efb1b897134b229c1726b45264b57783f
2021-03-02 01:38:12 +00:00
VivekSainiEQ d06c0cfc21 Fixed bug where make USE_SYSTEMD=yes would not pass in correct flags, issue #226
Former-commit-id: 36d3f29d19585bfc44051aa7241dcf564d649d63
2021-03-01 21:31:33 +00:00
John Sully 0fee53178a Bump version
Former-commit-id: 31392562b27a6fc1576476626a27a3defe13795f
2021-02-28 21:02:25 +00:00
John Sully b9fcc6bd4c Bump version
Former-commit-id: 31392562b27a6fc1576476626a27a3defe13795f
2021-02-28 21:02:25 +00:00
John Sully fdb83b8260 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 7609673e282b46a760a3d0e0b42d685af9b4d056
2021-02-28 20:46:08 +00:00
John Sully 8b05e96866 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 7609673e282b46a760a3d0e0b42d685af9b4d056
2021-02-28 20:46:08 +00:00
christianEQ ef946cb69e time thread priority + nanosleep
Former-commit-id: c84f296edabc001a1836ab8437f746dcff811148
2021-02-26 20:17:34 +00:00
christianEQ 8f750152ef time thread priority + nanosleep
Former-commit-id: c84f296edabc001a1836ab8437f746dcff811148
2021-02-26 20:17:34 +00:00
John Sully d7314f54e5 Don't complain about unclean shutdowns with an empty database
Former-commit-id: 99f5c02e87062552eaa2f26e960eb7c9dd977c84
2021-02-26 06:06:58 +00:00
John Sully 4aef22fc98 Don't complain about unclean shutdowns with an empty database
Former-commit-id: 99f5c02e87062552eaa2f26e960eb7c9dd977c84
2021-02-26 06:06:58 +00:00
John Sully e3b375ba25 Eliminate needless lock
Former-commit-id: 60f972d463f202edb33ff9a25bc2bd3e2558105c
2021-02-26 05:40:56 +00:00
John Sully 5ff29a085a Eliminate needless lock
Former-commit-id: 60f972d463f202edb33ff9a25bc2bd3e2558105c
2021-02-26 05:40:56 +00:00
John Sully f5de17239a Eliminate the need for an mfence by tricking the CPU into ordering the futex read
Former-commit-id: 340e6f5bc94cd1c3b0c6fb6da833e8504acaf23a
2021-02-26 01:28:05 +00:00
John Sully 41433cafe1 Eliminate the need for an mfence by tricking the CPU into ordering the futex read
Former-commit-id: 340e6f5bc94cd1c3b0c6fb6da833e8504acaf23a
2021-02-26 01:28:05 +00:00
John Sully 97c0849225 eliminate syscall in call()
Former-commit-id: 3ee111a2e50bc29818ba85ae4fb786171d695c37
2021-02-26 01:03:10 +00:00
John Sully 79ae103538 eliminate syscall in call()
Former-commit-id: 3ee111a2e50bc29818ba85ae4fb786171d695c37
2021-02-26 01:03:10 +00:00
jsully fdc2bfc12d Merge branch 'timethread' into 'keydbpro'
Offload updating cached time to dedicated thread

See merge request keydb-dev/KeyDB-Pro!10

Former-commit-id: 31786a995d0220ec0cb4502917a8cc0f192da4cb
2021-02-26 00:50:22 +00:00
jsully d5857dad94 Merge branch 'timethread' into 'keydbpro'
Offload updating cached time to dedicated thread

See merge request keydb-dev/KeyDB-Pro!10

Former-commit-id: 31786a995d0220ec0cb4502917a8cc0f192da4cb
2021-02-26 00:50:22 +00:00
christian 7bbf6ecf1c Offload updating cached time to dedicated thread
Former-commit-id: 9bfc8a43952481b5b54a7b051d44b8bece4a18dd
2021-02-26 00:50:22 +00:00
christian 7cfe8b51cc Offload updating cached time to dedicated thread
Former-commit-id: 9bfc8a43952481b5b54a7b051d44b8bece4a18dd
2021-02-26 00:50:22 +00:00
John Sully ce986661a2 Fix issue where finding random keys is slow due to not shrinking the hash table.
Former-commit-id: fd05010cdcf9d6a6187ca2e18bc55adbaa680a02
2021-02-22 09:14:24 +00:00
John Sully 9b9821d616 Fix issue where finding random keys is slow due to not shrinking the hash table.
Former-commit-id: fd05010cdcf9d6a6187ca2e18bc55adbaa680a02
2021-02-22 09:14:24 +00:00
John Sully aec5daee04 Implement maxstorage config
Former-commit-id: 79e07859dfec14edf2a39646013e1a82db033d4f
2021-02-19 05:17:41 +00:00
John Sully a77a739b6f Implement maxstorage config
Former-commit-id: 79e07859dfec14edf2a39646013e1a82db033d4f
2021-02-19 05:17:41 +00:00
John Sully 4e0230df2a Disable async rehash with single threads, it causes slowdowns as the rehash never completes
Former-commit-id: 5d08dbdf76c0fd1e0cfcf86b97ef3e656f0e4f5d
2021-02-16 21:07:43 +00:00
John Sully 51d8472d83 Disable async rehash with single threads, it causes slowdowns as the rehash never completes
Former-commit-id: 5d08dbdf76c0fd1e0cfcf86b97ef3e656f0e4f5d
2021-02-16 21:07:43 +00:00
John Sully 62d26b0584 Fix deadlock in storage prefetch
Former-commit-id: 9e6162de08248f7726b97b73aee2f23808ff4e7b
2021-02-12 19:38:57 +00:00
John Sully 538e3cdeaa Fix deadlock in storage prefetch
Former-commit-id: 9e6162de08248f7726b97b73aee2f23808ff4e7b
2021-02-12 19:38:57 +00:00
John Sully 447e92a8b4 Enable prefetch with storage providers
Former-commit-id: 21f9c52c446ad1b460a340c3d873839b2355728f
2021-02-11 00:50:21 +00:00
John Sully f8800af069 Enable prefetch with storage providers
Former-commit-id: 21f9c52c446ad1b460a340c3d873839b2355728f
2021-02-11 00:50:21 +00:00
John Sully efe591f9a7 Fix polarity issue in async rehash
Former-commit-id: 936bb30c08711179063f22682623a1e306c5c707
2021-02-09 05:10:22 +00:00
John Sully 0f2e6a8682 Fix polarity issue in async rehash
Former-commit-id: 9eefba49d4fcde7f12929929d7aeb36f5186a63d
2021-02-09 02:41:44 +00:00
John Sully 446ceba0d1 Fix polarity issue in async rehash
Former-commit-id: 9eefba49d4fcde7f12929929d7aeb36f5186a63d
2021-02-09 02:41:44 +00:00
John Sully 48e4958ae6 Fix deadlock with disconnecting client and storage provider
Former-commit-id: 0831745323e425f463322e8c0dc27fc25854868e
2021-02-08 19:02:01 +00:00
John Sully 8fe49b253d Fix deadlock with disconnecting client and storage provider
Former-commit-id: 0831745323e425f463322e8c0dc27fc25854868e
2021-02-08 19:02:01 +00:00
John Sully 46b19b37e5 Merge branch 'unstable' into keydbpro
Former-commit-id: e2140793f2bf565972ada799af73bf4457e2718d
2021-02-08 18:17:09 +00:00
John Sully 2780384c2b Merge branch 'unstable' into keydbpro
Former-commit-id: e2140793f2bf565972ada799af73bf4457e2718d
2021-02-08 18:17:09 +00:00
John Sully f878487caa Fix bug in fastlock stack metadata
Former-commit-id: 241d1bd7e1
2021-02-07 19:11:05 -05:00
John Sully 5e0bf4243d Disable multithreaded rehash when active defrag is enabled. The two are not compatible
Former-commit-id: 56addcd172
2021-02-07 19:11:05 -05:00
John Sully e129dd7b85 The server should recalibrate periodically. Also reduce log noise
Former-commit-id: 8d8e1810d4
2021-02-07 19:11:05 -05:00
John Sully 52a2225ec6 Ensure the C lock implementation behaves the same as the ASM
Former-commit-id: b5ddc11c46
2021-02-07 19:11:05 -05:00
John Sully 0b0314e8bc Ensure rehash completes even when we're in a long running task
Former-commit-id: f107746e90
2021-02-07 19:11:05 -05:00
John Sully c9d27531d3 Implement rehash during spinlock
Former-commit-id: f68a26381a
2021-02-07 19:11:05 -05:00
John Sully 37dbd2ccad Allow multiple threads to rehash simultaneously
Former-commit-id: 5a2cc90786
2021-02-07 19:11:05 -05:00
John Sully a631637dba Fix races in free
Former-commit-id: 3881d5c1f2
2021-02-07 19:11:05 -05:00
John Sully ae8278c810 Initial implementation
Former-commit-id: 958f2c00c8
2021-02-07 19:11:05 -05:00
John Sully 1566f1bff4 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 4a269c3382083f6ad7f697ef07eebc552e0de9d8
2021-02-08 00:02:54 +00:00
John Sully 85bd35266d Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 4a269c3382083f6ad7f697ef07eebc552e0de9d8
2021-02-08 00:02:54 +00:00
John Sully fdf059fe3a Merge branch 'unstable' into RELEASE_6
Former-commit-id: b4cd39d752cda834cb1a1633c36644deb8f4d39f
2021-02-07 23:55:58 +00:00
John Sully 9f9e8d8a02 Fix memory leak in mvccRestore
Former-commit-id: 8606dcd8b34016acb27ab03ead9adc43defc7f67
2021-02-07 23:38:49 +00:00
John Sully 0a1c7ea0ef Fix cluster test failure
Former-commit-id: 230fde39882766426d892fd30d0c8349f5cca912
2021-02-07 23:38:25 +00:00
John Sully 2e12641654 Fix cluster test failure
Former-commit-id: 230fde39882766426d892fd30d0c8349f5cca912
2021-02-07 23:38:25 +00:00
John Sully 6a68773299 Fix memory leak in mvccRestore
Former-commit-id: 92da1cbd0a08b66264f170a9b57ef7270f270157
2021-02-07 23:38:09 +00:00
John Sully 35afdb415b Fix memory leak in mvccRestore
Former-commit-id: 92da1cbd0a08b66264f170a9b57ef7270f270157
2021-02-07 23:38:09 +00:00
John Sully 008e471460 Update test to handle forkless bgsave
Former-commit-id: fc8c6de8252e6b802688413050f1a823093d0a1d
2021-02-07 21:41:19 +00:00
John Sully a77a1f4491 Update test to handle forkless bgsave
Former-commit-id: fc8c6de8252e6b802688413050f1a823093d0a1d
2021-02-07 21:41:19 +00:00
John Sully 83956b7e40 Merge branch 'keydbpro' of https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro into keydbpro
Former-commit-id: 8bad923169b2a73f249fd8b3153236d6a74100c9
2021-02-07 20:53:07 +00:00
John Sully e697e4c623 Merge branch 'keydbpro' of https://gitlab.eqalpha.com/keydb-dev/KeyDB-Pro into keydbpro
Former-commit-id: 8bad923169b2a73f249fd8b3153236d6a74100c9
2021-02-07 20:53:07 +00:00
jsully ecf233091b Merge branch 'opensourcemerge_2021-02-01' into 'keydbpro'
Merge from open source Feb 5 2021

See merge request keydb-dev/KeyDB-Pro!9

Former-commit-id: 1a2e2b99cc0123b1b03b78b5f28107df395decdb
2021-02-07 20:49:08 +00:00
jsully 76bbacddbe Merge branch 'opensourcemerge_2021-02-01' into 'keydbpro'
Merge from open source Feb 5 2021

See merge request keydb-dev/KeyDB-Pro!9

Former-commit-id: 1a2e2b99cc0123b1b03b78b5f28107df395decdb
2021-02-07 20:49:08 +00:00
christianEQ f3b65e1a8a fixed up backup stuff
Former-commit-id: 8a23162c24dc13a4268928c5defd85b0b5249d39
2021-02-04 22:36:32 +00:00
christianEQ 4706ae5aa1 fixed up backup stuff
Former-commit-id: 8a23162c24dc13a4268928c5defd85b0b5249d39
2021-02-04 22:36:32 +00:00
christianEQ d73174fafc removed bgsave test, not applicable to keydb pro
Former-commit-id: d017c160662702ebcdbf063df239b907c2a193c5
2021-02-03 19:13:53 +00:00
christianEQ d3cc5d688a removed bgsave test, not applicable to keydb pro
Former-commit-id: d017c160662702ebcdbf063df239b907c2a193c5
2021-02-03 19:13:53 +00:00
christianEQ c6bff25bdd Merge remote-tracking branch 'opensource/unstable' into keydbpro
Former-commit-id: 5bad058733de2c217340bb9ee48f02b07d754808
2021-02-03 18:10:27 +00:00
christianEQ 0c94c81a5e Merge remote-tracking branch 'opensource/unstable' into keydbpro
Former-commit-id: 5bad058733de2c217340bb9ee48f02b07d754808
2021-02-03 18:10:27 +00:00
John Sully e1fde4a814 Module test reliability
Former-commit-id: c8edabc7effdc4120fc97cc78e8335f358671d8c
2021-02-01 22:21:49 +00:00
John Sully f4c444d82d Simplify the handling of CreateTimer
Former-commit-id: 466c9565004c62da6ba427855456d45132486804
2021-02-01 15:51:22 -05:00
VivekSainiEQ 52dde56d28 Modified RM_CreateTimer to prevent more that one function being posted at a time
Former-commit-id: 291007fd5b34ba143e198a845bd1b6c7e04363af
2021-02-01 15:51:22 -05:00
VivekSainiEQ 624165459e Changed RM_CreateTimer to only call aePostFunction is existing aePostFunction isn't in flight
Former-commit-id: 35cc135fa3faa8bbf4f47f9455d880c1e9680f33
2021-02-01 15:51:22 -05:00
VivekSainiEQ 2f6f5dbb98 Now post entire timer installation process as one function to make atomic with respect to global locks
Former-commit-id: bccf62a6c706063124c1df06d776e787ca28b382
2021-02-01 15:51:22 -05:00
VivekSainiEQ 285e459c22 Updated header file to remove fSynchronous flag
Former-commit-id: df75a6b788a0e9bed22c812fb52431155b90dd4d
2021-02-01 15:51:22 -05:00
VivekSainiEQ 53a06f0830 Removed more uses of fSynchronous and the use of condition variable and mutex on the control struct.
Former-commit-id: c6dcccda36d105a75ea5dd1766837b67f75fd9da
2021-02-01 15:51:22 -05:00
VivekSainiEQ 1283f9a607 Added fix for scenario where module thread waiting for s_mutexModule in acquireGIL can deadlock with module thread waiting for s_mutex in releaseGIL
Former-commit-id: 11b37083822ce5bf632b5c76d1b4aaa2fe9857e3
2021-02-01 15:51:22 -05:00
VivekSainiEQ f0f8479c59 removed synchronous calls to aePostFunction and changed scope of g_fModuleThread in order to prevent module related deadlocks, issue #214
Former-commit-id: 1ea1989ce4a794b4049e2164ba32d2daf2cfb317
2021-02-01 15:51:22 -05:00
John Sully 84b2ed3a3c Bump version
Former-commit-id: b8ec401b9e5538e2b979cd6104506d1d8219e205
2021-01-31 21:24:49 +00:00
John Sully 5465254118 Merge branch 'unstable' into RELEASE_6
Former-commit-id: fab3d5327757ac9cb4c225662a313edf13451ec0
2021-01-31 21:24:07 +00:00
John Sully 523a16eb09 ARM build fix
Former-commit-id: b337bfb833a555198c7e89d2979b008c1ff03b38
2021-01-31 21:22:23 +00:00
John Sully 47ee3919d4 Fix test failure caused by allowing pings during load
Former-commit-id: 283ab96f7c2f1e15232100489f61075a0cca07f7
2021-01-31 07:15:55 +00:00
John Sully d521a37098 Reduce intermittent failures by giving tests more time
Former-commit-id: 9f7080345873bf1bf231750d6a010979b14016d5
2021-01-31 06:33:13 +00:00
christianEQ a3a493408d added exception to allow pings during loading
Former-commit-id: 6c83a49a5b50bfc7a14bdd319df70e26606a60a9
2021-01-31 00:12:49 -05:00
christianEQ 1ea3c634c2 added severity levels for afterErrorReply
Former-commit-id: bee6b658f6b6fadae03f2b3be237d0f6955b6655
2021-01-31 00:12:49 -05:00
John Sully fcf9262430 Improve multithreaded test reliability
Former-commit-id: 863beff3dfc161c2ebfcd336fdbd820abc1a528d
2021-01-31 04:33:27 +00:00
John Sully e7fccbb560 Fix test failure due to bad merge
Former-commit-id: f7ce65d042875d21e5c85c2394fec0f81f578141
2021-01-31 03:40:57 +00:00
John Sully c85399eaaf Fix CI failure due to missing package
Former-commit-id: e46fec51c7033613339e2b5e46048bee1d75bd62
2021-01-31 02:36:30 +00:00
John Sully e30df2bcf3 Fix crash on shutdown command
Former-commit-id: 920c223fbf47e4a0e75f87cadfdf177014e7e31d
2021-01-31 02:30:28 +00:00
christianEQ 22c4ab41a4 Merge pull request #284 from christianEQ/redismerge_2021-01-20
Merge Redis 6.0.10 into KeyDB

Former-commit-id: 699a417cd0b1b893863448a6aceff4e76fb61c65
2021-01-29 10:59:36 -05:00
christianEQ 3f02de85fe killMainThread -> killServerThreads
Former-commit-id: 62f6ef926de1e5242903ea061a2869493ec5d6cb
2021-01-28 23:57:19 +00:00
christianEQ fc9a30ea54 compare_exchange in connSocketRead, explicitly enforce memory order (even if redundant)
Former-commit-id: 8f68407e7f4c17b6887a69b7166924a2d33c8b3d
2021-01-28 23:17:48 +00:00
christianEQ fd7ab16158 fixed replicaof no one config, added test case
Former-commit-id: 44c2069d16f411ed9f7da3597f3bf3c9062797d2
2021-01-28 19:49:22 +00:00
christianEQ 00e086d7fc updated version num to 255.255.255
Former-commit-id: 6ff152f80dc59940a5f45c86474f50a819e85fdf
2021-01-28 16:54:22 +00:00
christianEQ ce440666a5 Merge remote-tracking branch 'john/unstable' into redismerge_2021-01-20
Former-commit-id: d65b126bd84d98db219194b11ad7b8fd72600cf7
2021-01-27 22:25:14 +00:00
christianEQ 6c929d3878 arm locker before checking zmalloc_used_memory
Former-commit-id: c58db6dbbc393f958fa19465a89ef60278660fe3
2021-01-27 22:24:06 +00:00
Daniel Dai a5b6c92e89 Fix Swapdb crash
Former-commit-id: 597372e89faad099d8b7391c5e083255de1f1dce
2021-01-27 15:24:10 -05:00
christianEQ 2aed0db93b fixed uninitialized variables in ACLSetUserCommandBit
Former-commit-id: 23558c5719fa2951df5e019652924ea968ed435e
2021-01-26 23:29:15 +00:00
christianEQ 724117c3e5 fixed strncpy off-by-one errors
Former-commit-id: 6dd2042798e264dd2c15ad4795e5f8e4e586cf87
2021-01-26 23:27:28 +00:00
christianEQ ef934d40c3 removed unimplemented killIOThreads function declaration
Former-commit-id: 1acec0f11c8c5741a521f442f559be6b902d43e1
2021-01-26 22:27:22 +00:00
christianEQ 0e02a1cb05 fixed server.cpp mentions
Former-commit-id: da633f09d19157b2eaa8b32c05f07bc33bbf3086
2021-01-26 22:22:19 +00:00
christianEQ 0221403ae6 added note about io-threads to keydb.conf
Former-commit-id: 5b395d951f53af50e7d2f8f69f3ccdc3881a8465
2021-01-26 22:10:53 +00:00
christianEQ f3c7b79032 fixed race condition in connSocketWrite
Former-commit-id: 1a015c82284b509f73e326e44c44df87c1265365
2021-01-26 22:08:07 +00:00
christianEQ 554136f5b3 Removed Redis-specific things from conf file
Former-commit-id: 9ff6662c9d5c93b6a52e34a9acd53ef757c39339
2021-01-26 21:50:45 +00:00
christianEQ 3a13377335 Merge tag 'tags/6.0.10' into redismerge_2021-01-20
Former-commit-id: 3cdace182152727b2b19362072ab5f6ad55e2cd5
2021-01-26 21:43:09 +00:00
christianEQ 5d2bcd7776 changed loading process config types to be consistent across environments
Former-commit-id: 5206748bfc86d73c6ccc432cb4833f2383fb4741
2021-01-14 21:12:36 -05:00
christianEQ 23d3012eb4 renamed loaded key counter to be more clear
Former-commit-id: f1219663bd2ab507c863d3ec6206e95e46c1012f
2021-01-14 13:06:57 -05:00
christianEQ 89a48113e1 removed 'comment arguments' from config options (doesn't ignore inline comments)
Former-commit-id: 699e59b491954af3812da7d13628b8387ce411d5
2021-01-14 13:06:57 -05:00
christianEQ c5d4dc229d fixed signedness warning
Former-commit-id: 4ed05a76d5aed48a0e52015a8b4ffb3f7ecb4777
2021-01-14 13:06:57 -05:00
christianEQ 5621104d0e added section to keydb.conf for new options, tweaked default
Former-commit-id: 3fda1011452ad5827c87feefe7d9d5244cb0db87
2021-01-14 13:06:57 -05:00
christianEQ e33350f6bc ping replicas during key load
Former-commit-id: 1a5dce72817169b8ea4d06eb770124919c8c0a4a
2021-01-14 13:06:57 -05:00
christianEQ ea67fe825a added config option for loading callback interval keys
Former-commit-id: 6ca62735148627a137539301217c519770312b6e
2021-01-14 13:06:57 -05:00
christianEQ 05fc997663 configurized loading_process_events_interval_bytes
Former-commit-id: 02c650c5039504c69a13c98abc579ced79adc307
2021-01-14 13:06:57 -05:00
John Sully 2003225ce0 Fix intermittent module test failure, resizing the repl backlog is not good enough to clear the backlog
Former-commit-id: fd5c08a0ecdfda5eeb35bdf5dc767c11d1b353ec
2021-01-12 00:29:07 +00:00
benschermel 11926cd922 update perf chart, build info, job post link
Former-commit-id: 8a1a527f664d1a40663c61fdc127e3c74feac7a1
2021-01-11 11:40:00 -05:00
benschermel 6e0b385b99 created ascii logo image
Former-commit-id: 4dfa3d609a67bee466c96da767e7bb52f6d40273
2021-01-11 11:40:00 -05:00
John Sully f302712b6d Merge branch 'repl_perf' into unstable
Former-commit-id: c903d955a14a1b2304cded85ffba54d85b68567a
2020-12-24 02:22:57 +00:00
John Sully 2a8980a135 Don't write in the lock
Former-commit-id: 93b7364aaecbe578be4b75c18c840c4b396c7d4e
2020-12-17 06:52:59 +00:00
John Sully 8e759d128a Don't write in the lock
Former-commit-id: 93b7364aaecbe578be4b75c18c840c4b396c7d4e
2020-12-17 06:52:59 +00:00
John Sully c13b52ae8d Merge branch 'unstable' into keydbpro
Former-commit-id: 53a062a6b796ccbd43560fed1b05367ba759da96
2020-12-11 18:39:30 +00:00
John Sully f3c6d6b83b Merge branch 'unstable' into keydbpro
Former-commit-id: 53a062a6b796ccbd43560fed1b05367ba759da96
2020-12-11 18:39:30 +00:00
John Sully 03b347168a Merge branch 'unstable' of https://github.com/JohnSully/KeyDB into unstable
Former-commit-id: 0f6cd758443f6a9d8a2856e3a6d6f431cc52c627
2020-12-11 03:59:50 +00:00
John Sully e848a39f6c don't try and free a client that can't be freed
Former-commit-id: da3b2e33fb31a46af4e979a704377e7b176d2bec
2020-12-11 03:59:39 +00:00
John Sully 0d37295788 Prevent use after free
Former-commit-id: 0bb42e7c1388eca172f32ecf7cab2e7261e658e2
2020-12-11 03:59:26 +00:00
John Sully 19ab526892 Merge branch 'unstable' into keydbpro
Former-commit-id: e59c3945d3ed0b05a3e42713b091b1b5c96a9db2
2020-12-11 00:49:54 +00:00
John Sully 06a81e1074 Merge branch 'unstable' into keydbpro
Former-commit-id: e59c3945d3ed0b05a3e42713b091b1b5c96a9db2
2020-12-11 00:49:54 +00:00
John Sully c3f0207ece Remove AE_ASSERT and use the proper assert infra
Former-commit-id: c81c858e9ecc2e17d034af40ed4a41f98c9a8184
2020-12-11 00:24:27 +00:00
John Sully 888ff95e6b Prevent test crash due to unimplemented save for nested hash
Former-commit-id: a6e4888b78a54e154a91f11eaa33bacf557996d6
2020-12-11 00:23:44 +00:00
John Sully 84545663e8 Fix crash freeing nested hash with list
Former-commit-id: 6435a6c672fe2ccbf9d05dc023bb53fbb26a68f8
2020-12-11 00:23:14 +00:00
John Sully a42288bcaa Fix test timeouts
Former-commit-id: 6f3feee67678b594fbe9fd592f9f823a7a07b770
2020-12-10 20:09:19 +00:00
John Sully 775e8d240a Fix test timeouts
Former-commit-id: 6f3feee67678b594fbe9fd592f9f823a7a07b770
2020-12-10 20:09:19 +00:00
John Sully 7eb901875b Merge branch 'repl_perf' into keydbpro
Former-commit-id: c4431a6be7a1ddc05abdd4510630fac2a2a6664e
2020-12-10 18:45:52 +00:00
John Sully 433981d3f4 Merge branch 'repl_perf' into keydbpro
Former-commit-id: c4431a6be7a1ddc05abdd4510630fac2a2a6664e
2020-12-10 18:45:52 +00:00
John Sully 81298de6da Merge branch 'unstable' into keydbpro
Former-commit-id: b7a1e16c0f04e8aeb3764e3681fa14fc0f97f6a3
2020-12-10 02:37:28 +00:00
John Sully 32304c5425 Merge branch 'unstable' into keydbpro
Former-commit-id: b7a1e16c0f04e8aeb3764e3681fa14fc0f97f6a3
2020-12-10 02:37:28 +00:00
Kajaruban Surendran 2b501361be Addressing PR comments
Former-commit-id: bdff284bbf1dce9340f9b67b3c100e47de159d4f
2020-12-04 14:54:06 -05:00
Kajaruban Surendran 890be9bc2c Addressing PR comments
Former-commit-id: f75add86841dab18958a2a8efda8fb30fefd4b7d
2020-12-04 14:54:06 -05:00
Kajaruban Surendran 911c409f94 Handling of aeResizeSetSize's return code for current thread
Former-commit-id: 52dc30ce32f915e67e59dcefce1f913d0c84c9cc
2020-12-04 14:54:06 -05:00
Kajaruban Surendran 73bf964327 check the aeResizeSetSize return code
Former-commit-id: 192644ef41f1aec99f76223c776de31dff38d71f
2020-12-04 14:54:06 -05:00
Kajaruban Surendran 37b09f2c06 Adding thread index to the error message
Former-commit-id: b6f6f0f1740accb0dc213a709440411320f6c867
2020-12-04 14:54:06 -05:00
Kajaruban Surendran 4e5b192def Call aePostFunction to change the setsize of each threads by that thread
Former-commit-id: 26aa7060b1985f0b46ffd4878ff41ec3dbe25cf1
2020-12-04 14:54:06 -05:00
Kajaruban Surendran 8a95f17a05 Calling initServerThread function cserver.cthreads(server-threads) times than MAX_EVENT_LOOPS(constant)
Former-commit-id: d3921bfafb478d02f3ba9a6a098c4c4a9cc091ea
2020-12-04 14:52:28 -05:00
christianEQ f06f55182c Issue: #204 Allocate 8 MB to thread stack
Former-commit-id: f02dccbad092f223f77962b2946933bd89ee3dff
2020-12-01 14:50:03 -05:00
John Sully bfc8948aa9 Issue: #260 Don't use C++ static_assert in C files
Former-commit-id: 3a53ab815c2148191e27db263b1b001ba40b0546
2020-11-30 23:01:20 +00:00
John Sully fd7cbbe4d5 code coverage reports should test multithreaded
Former-commit-id: 6af2ba5d246b5d43a4e146e538dbb4cca0195272
2020-11-30 22:59:00 +00:00
VivekSainiEQ 1e7d62f67b Added module data type load/save tests
Former-commit-id: 80976ac7708de11151850b2da733765f65dc7528
2020-11-30 17:47:04 -05:00
VivekSainiEQ 17be372b5c Removed use of module datatypes, now should work if tests/modules is not built
Former-commit-id: 6ed470dcf6718e1ee4aa5d507746cea710591d3a
2020-11-30 17:47:04 -05:00
VivekSainiEQ 58f5e7f9cf Added tests for saving various data types to disk and loading them back, and for loading data types from redis to maintain compatibility
Former-commit-id: 888c82911d6169b305d2f245bd55ac646785c040
2020-11-30 17:47:04 -05:00
VivekSainiEQ 4a4136fd18 Added remainder of runtest scripts to make lcov command. Code coverage goes from 57.9% to 72.1%
Former-commit-id: a273fefd761ca3eca476d56c0c187a0e72dd8b61
2020-11-30 17:47:04 -05:00
VivekSainiEQ 487dcd65c3 Added KeyDB.info to .gitignore file
Former-commit-id: c43cc37417773e837cffc70cec89a0799e14735f
2020-11-30 17:47:04 -05:00
Kajaruban Surendran 77bb11598b Configurable option for MOTD
Former-commit-id: 530cf1e2323233d554c18fba1c756bcdec4ab112
2020-11-30 10:42:48 -05:00
VivekSainiEQ 3634644315 Added references to KeyDB.info instead of redis.info
Former-commit-id: 2beaac58aba430a7bf1a0cc8a2c7b05fa421dc7f
2020-11-25 18:49:20 -05:00
VivekSainiEQ 43226ab4c6 Properly escaped $ in lcov command
Former-commit-id: 88f0b8cc8a465803298699fdb7e22a95975602bb
2020-11-25 18:49:20 -05:00
VivekSainiEQ 67ff83c078 Updated 'make lcov' command to exclude external dependancies and generate final code coverage percentage
Former-commit-id: a81d1da39760207a6a6af58a6f39a90e64accc52
2020-11-25 18:49:20 -05:00
VivekSainiEQ 2d5ce59ee4 Added test for issue #257
Former-commit-id: d5bb9c71f544944b9bb6aa4f1878918f2180519c
2020-11-25 17:21:37 -05:00
VivekSainiEQ 87caa9a91e Made NULL pointer check explicit, issue #257
Former-commit-id: 9db40371e91ee3049cd1df6d2a48ad6dee412f44
2020-11-25 17:21:37 -05:00
VivekSainiEQ 9506950051 Added NULL check to function objFromAllocPtr, now NULL input will map to NULL output even if active replica is enabled
Former-commit-id: 2ec45133b5fdcae4e95b44a2b6fb39dd46f7a390
2020-11-25 17:21:37 -05:00
John Sully 2dfec4fb92 Merge branch 'unstable' of https://github.com/JohnSully/KeyDB into unstable
Former-commit-id: 4f1d44a28d1a410e7fce8a70a3ef9a286d485207
2020-11-23 02:01:54 +00:00
John Sully 5e51793751 Fix issue where active replication doesn't replicate RDB data
Former-commit-id: 95cf9b5f4d469cbf33199776c31713673a836fd8
2020-11-23 02:01:40 +00:00
Kajaruban Surendran 24017c3061 fix for the server crash when the maxclients increased via config set
Former-commit-id: 7457a0533ebd4d140ee46945f262068041c0bac0
2020-11-20 15:20:46 -05:00
John Sully 2ea281c3df Blocking clients should not crash if an active replica loads a remote RDB with a key in the blocklist
Former-commit-id: 95f29fa6e321d29d41d2fefab07ad5391780d3d2
2020-11-19 23:28:01 +00:00
John Sully e77c41e6dc Merge branch 'RELEASE_6' into keydbpro
Former-commit-id: 2ee33cb050b26cbe34f0b390b8807cdc1b908ded
2020-11-19 20:38:47 +00:00
John Sully 2d76c9ee21 Merge branch 'RELEASE_6' into keydbpro
Former-commit-id: 2ee33cb050b26cbe34f0b390b8807cdc1b908ded
2020-11-19 20:38:47 +00:00
John Sully ff792410aa Ensure multithreaded tests pass
Former-commit-id: bbbe78c86827ea3709bcdd5b1b960a30bca70ec9
2020-11-13 21:08:10 +00:00
John Sully a7da7b7446 Improve replication performance in multithreaded scenarios
Former-commit-id: a2ec35955e8040518ec18e3d25b5a0c0c5ae8a8c
2020-11-13 21:08:10 +00:00
John Sully af2aae39d2 Add ability to compile KeyDB without MOTD and curl
Former-commit-id: 23727346417cf948813dbd4801aea8a93f995072
2020-11-13 20:51:30 +00:00
John Sully 4db5e4ee6d Add missing file
Former-commit-id: 674ac5cf782fbb529aa88d361acdd431ea580416
2020-11-11 03:29:38 +00:00
John Sully 8019d11a6f Second implementation of nested hashes
Former-commit-id: b5603c032e2df25a76f57aee9d2a79c93416f4c7
2020-11-06 19:24:48 +00:00
John Sully 04651d9def Additional test reliability fixes
Former-commit-id: 17e75329203f8790833554533f85be5871ebba70
2020-10-27 07:25:43 +00:00
John Sully b2dcc47d48 Disarm not release D'oh
Former-commit-id: 0c68dae246b9c0039af2fef91d3f43ec54d289fe
2020-10-27 06:41:33 +00:00
John Sully 89b44a303b Active replica test reliability enhancements
Former-commit-id: 5dcf6b4b450dc53c05bc74060f29f6dd07d03b7e
2020-10-27 06:23:14 +00:00
John Sully e57dfd55aa Prevent crashes on shutdown due to lock being held
Former-commit-id: 5c4b8b6ceb7635c973ec54d6f873c66b9649a493
2020-10-27 04:53:19 +00:00
John Sully 2cee32b8b6 Ensure MVCC timestamp is incremented after the real time is updated
Former-commit-id: 2ab7773a22f86d2c26432611dce10a3c2165076c
2020-10-27 04:52:35 +00:00
John Sully 7ee9dd155e Fix multithreaded test failure
Former-commit-id: eef6200bfaaacb8e9682be1b72bed95ee50faa67
2020-10-27 01:54:13 +00:00
John Sully abd238c0de Avoid unnecessary memory fences
Former-commit-id: f3ea0ec949528f05a843ae624e8dd104dca3009b
2020-10-26 02:28:38 +00:00
John Sully 2a2d333a21 Remove addReply*Async methods since we already know if its async or not. This is just a source of bugs
Former-commit-id: 85c423e69c0f0daef21c0a267b30a324a1b64b84
2020-10-24 02:18:03 +00:00
John Sully bbb8090c2e Allow the locker to be used even without a client
Former-commit-id: 00d0b0d388a68329af8f0dcaec4005c26ca2b592
2020-10-23 20:21:49 +00:00
John Sully 485cb21e01 Fix multithread test failures
Former-commit-id: 554e86e0a360e65583786c480588c8503404db80
2020-10-23 15:57:39 +00:00
John Sully 51a8d8d118 Remove leak warning with ASAN in the CLI
Former-commit-id: 1d3355e6fbdde409b9fc4ca3443f31cb43857549
2020-10-21 21:16:08 +00:00
John Sully 78b8b74e58 run when necessary
Former-commit-id: d482e3758cb0cfb6037faa56714a20057ae33130
2020-10-16 07:00:03 +00:00
John Sully b4e3feab16 Fix replica buffer overflows
Former-commit-id: 4d839bc049d6f73509fe13ec8a27ca6fdc491540
2020-10-16 06:47:40 +00:00
John Sully 2fa4fe6264 Avoid locking if we won't run a time event
Former-commit-id: e54091e7e9ab4d2145823808bd76e43ece1b3f82
2020-10-16 06:19:52 +00:00
John Sully c8355e6aa5 Reduce async write copies
Former-commit-id: 88e119d9a24fa90f57c46445d1b0d06d88564bf3
2020-10-15 23:10:17 +00:00
John Sully 5e77b9e2dc Fix branding
Former-commit-id: f4856d487713926a31f48f838ace9197c8273ce1
2020-10-15 20:15:35 +00:00
John Sully d9aeb40ae3 Relax memory order where possible
Former-commit-id: a43e9c2d348ebdf3c1af8c2abce0d9d1195d6409
2020-10-13 06:35:16 +00:00
John Sully ad8bc153cb Significantly improve perf in replication scenarios
Former-commit-id: f3e7a8704e138d9990c4420e7c6c0cf4c6963d96
2020-10-12 15:27:03 +00:00
John Sully 8aaa09e520 Avoid excess locking, seeing up to 8% performance improvements
Former-commit-id: 9d36aea946498aaa58f6413a23528c77a6818695
2020-10-12 05:50:58 +00:00
John Sully 44adc8aa40 Perf: remove unnecessary vector operations
Former-commit-id: 446eac58e8dcbc0fec25a9a7d09b65765be6bb34
2020-10-12 04:28:39 +00:00
John Sully 8944fea601 Remove dead code
Former-commit-id: 23aad600ee82ead40b06ec559583f57076f160e6
2020-10-09 21:02:09 +00:00
Hanif Bin Ariffin c5aab0e855 Fixed non-empty check in src/Makefile
Per [GNU Make Manual](https://www.gnu.org/software/make/manual/html_node/Conditional-Syntax.html).
To properly check for non-empty variable, one must strip whitespaces.

Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>

Former-commit-id: 7b6b0fdd1b5e120e2fb7f7df4933a637d3139879
2020-10-05 10:58:49 -04:00
Hanif Bin Ariffin 50eb3b11eb Removed dead code from a macro in zmalloc.cpp
I think the compiler would have removed this no-op anyways but it
definitely wasted me some 30 minutes on this :(

I was hoping I could remove the branch through some bit-hacking but
apparently its dead code :). Oh well, its 30 minutes of refreshing
bit hacking.

Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>

Former-commit-id: bbc9912f528771174400e7344f30f8b114d7477a
2020-10-03 20:41:26 -04:00
John Sully ef0ee8dc5b Delete CONTRIBUTING
Former-commit-id: 13f3d36a150708e54684c9f64cda65ff84047837
2020-10-01 11:17:56 -04:00
John Sully 69fecd6fc2 Fix module test failures due to locking
Former-commit-id: 18aec70640ec81502bf1b5101e6032e3c31fbd69
2020-10-01 00:08:54 +00:00
John Sully af1dd6da3b Fix TLS test failure due to bad merge
Former-commit-id: 580e4ce876e29bcd6caa3e1a886d592c9334753f
2020-09-30 20:21:40 +00:00
John Sully fec0732050 Keep redis-cli.c C89 compatible
Former-commit-id: 2818216e401e659899436630f34798e3cf4ee875
2020-09-30 20:17:51 +00:00
John Sully 3934e60a19 Mac build break fix
Former-commit-id: 84ea1b14d32eddbe725d167c53c1c37170eb7a17
2020-09-30 20:17:02 +00:00
John Sully 194abc9a3a Fix stream replication failure with active replication, issue #238
Former-commit-id: 6f5a84f80bd1e85d1aa3f70c5a3ff6728e14ee3d
2020-09-30 20:12:54 +00:00
John Sully 12f40f1be5 Merge tag '6.0.8' into unstable
Former-commit-id: 137a30a99134e8655d36e7e5f462219cee68680c
2020-09-30 19:47:55 +00:00
John Sully 6cfa9d5539 Test RDB merge on load with active replication
Former-commit-id: 7355488e2bbfd0587e0ba39e925e802ee676e458
2020-09-29 03:26:06 +00:00
Ben Schermel 712532ada9 update deb changelog
Former-commit-id: 63c47a09e9
2020-09-28 23:42:54 +00:00
Ben Schermel c4c848ad7d update deb changelog
Former-commit-id: 087af94c22
2020-09-28 20:51:31 +00:00
John Sully 81a526039c Drop min-clients-per-thread to a more reasonable number
Former-commit-id: bf3a3225fc
2020-09-28 19:19:47 +00:00
John Sully 27e3cd1e31 Drop min-clients-per-thread to a more reasonable number
Former-commit-id: 7458885bc5d3a37314f29eb30e2d41052fa9727d
2020-09-28 19:17:36 +00:00
John Sully d4c986e90c bump version 6.0.16
Former-commit-id: dab9296d7c
2020-09-28 19:14:17 +00:00
John Sully f689c0002f Merge branch 'unstable' into RELEASE_6
Former-commit-id: a6f5a391a1
2020-09-28 18:55:24 +00:00
John Sully 50942877fc Merge branch 'unstable' into keydbpro
Former-commit-id: d1986d9fcdfd56f2c30ee95edef6d5260e0aa777
2020-09-24 22:02:30 +00:00
John Sully 4e24db3b4f Merge branch 'unstable' into keydbpro
Former-commit-id: d1986d9fcdfd56f2c30ee95edef6d5260e0aa777
2020-09-24 22:02:30 +00:00
John Sully ed66d8e3dc Support read only replicas attaching to active replicas (Bug #229)
Former-commit-id: 18e5082286fbe33762d7b24454c2c66e64dafac0
2020-09-23 04:16:08 +00:00
John Sully 222c6ab5c1 Active replicas memory leak
Former-commit-id: efaf186286d2d05180f3bc00a5286094490e4528
2020-09-22 21:38:35 +00:00
John Sully 885301272e Merge branch 'unstable' of https://github.com/JohnSully/KeyDB into unstable
Former-commit-id: 9429c71d556c3fb3239c5fcb228899a8c24b65aa
2020-09-21 04:42:46 +00:00
Dmitry Dorofeev 07b94102a9 Fix to support FreeBSD pthread_getthreadid_np call
Former-commit-id: 631d1016d7aca127420c7dda820648dbf3a5708e
2020-09-21 00:41:41 -04:00
John Sully a8dea1bede Fix TSAN errors in fastlock
Former-commit-id: 6ab52458c0f3d367f53a7c3332bcc09c3fa61c9b
2020-09-21 03:26:50 +00:00
John Sully 7a071c14b2 Fix issue #222
Former-commit-id: 4c64071d62ebbb1a5dc568b6329a0c1b5193b3df
2020-09-21 01:09:58 +00:00
John Sully 5a760e15f0 Make multimaster replication info statelessly paresable
Former-commit-id: 8cfa8a1843fa0de18e87ddcd24ea3b7fb713e621
2020-09-20 23:57:06 +00:00
John Sully 9b9bf54f6e Dramatically improve the performance of subkey expires
Former-commit-id: 7004777a4be7a6c45076fce36e231a03081b8d94
2020-09-20 23:30:21 +00:00
John Sully 6923878c2d Reduce test noise
Former-commit-id: 752b647601cc281e4d9463e03920d04c537c12b2
2020-09-19 22:00:17 +00:00
John Sully 5173e88d36 Fix CI failure due to apt host changes
Former-commit-id: 2a41c6c5a4a015ecd09c005cadca68cb069eab54
2020-09-19 21:49:59 +00:00
John Sully 442247ec7d Avoid memory overhead in situations it won't be used (active rep only)
Former-commit-id: af404d639a1d41fd5e2e2ad5f217ec4beb9d30e7
2020-09-19 21:44:59 +00:00
John Sully 8466136c13 Update endurance test for ubuntu 20
Former-commit-id: d4b0def50606ba6f3fc61cc205563502ae82d68c
2020-09-17 02:10:18 +00:00
John Sully 2f17048470 Fix build break
Former-commit-id: 2a67483f81ce02acc9601e26740bef768b9331fd
2020-09-17 00:53:56 +00:00
John Sully 32e738f2a4 master_global_link_status should respect the quorum
Former-commit-id: 355fc22192b63679744c3119c35758d194c9de43
2020-09-17 00:31:10 +00:00
John Sully e9f5cd22a1 Allow reads during an active replica load, optionally allow writes as an experimental feature
Former-commit-id: 863531789ebc1fd7835fed9bf899ce7375a4c73c
2020-09-17 00:13:03 +00:00
John Sully 840db3cc6d Implement replica-quorum config
Former-commit-id: 4e6bbab1dc22a088c843b4dba34c6274b02903a7
2020-09-16 03:26:31 +00:00
Yossi Gottlieb a891d570f3 TLS: Session caching configuration support. (#7420)
* TLS: Session caching configuration support.
* TLS: Remove redundant config initialization.


Former-commit-id: c1da835e7d5216896275b560e97777e88c34a1a4
2020-09-16 02:10:29 +00:00
John Sully 883a30a68d Protocol error in client command
Former-commit-id: 3e7d004d88f2c1e0c9a3c4bcd981aefba66d7138
2020-09-11 20:48:18 +00:00
John Sully b3446a5e12 Fix more protocol errors
Former-commit-id: 61ec82c74d42ce347167f84662d853f127f93ae0
2020-09-11 20:47:27 +00:00
John Sully 19c824e18c Fix protocol difference with Redis
Former-commit-id: 7cacdec5f8396dedc7e8f185a8c705aed29aa3e9
2020-09-11 20:08:26 +00:00
John Sully 9ffd2bd39f Fix whitespace
Former-commit-id: fd4fc08016bf3c3d045cb82754ba285f4a0fb1fa
2020-09-07 03:35:46 +00:00
John Sully 6f4c157d0e Dramatically improve perf by blocking commands
Former-commit-id: 9f4b410c9ac2275a1e4ff9e5f187730913cd574d
2020-09-07 00:49:53 +00:00
John Sully 1cb9a3aea9 Implement use-fork config (fails with diskless repl)
Former-commit-id: f2d5c2bca22e9fd506db123c47b7f60cdded7e2c
2020-08-24 03:17:59 +00:00
John Sully ce20b04add Implement use-fork config (fails with diskless repl)
Former-commit-id: f2d5c2bca22e9fd506db123c47b7f60cdded7e2c
2020-08-24 03:17:59 +00:00
John Sully 5211e734b5 Implement use-fork config (fails with diskless repl)
Former-commit-id: 4e941b8d30612c1051a9dde67effaf8c5a86456f
2020-08-24 03:17:31 +00:00
John Sully 178bf55335 Implement use-fork config (fails with diskless repl)
Former-commit-id: 4e941b8d30612c1051a9dde67effaf8c5a86456f
2020-08-24 03:17:31 +00:00
John Sully a9e4a5058a Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: ed98be0ba81ffdc501847ea0d2486f5f01391319
2020-08-17 02:26:51 +00:00
John Sully 64b68999dc Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: ed98be0ba81ffdc501847ea0d2486f5f01391319
2020-08-17 02:26:51 +00:00
John Sully 725ff75179 Fix ARM build of RocksDB
Former-commit-id: 7301d6d5e76b65115e2610a5fc5afee443782d7c
2020-08-17 02:25:45 +00:00
John Sully 07d0154797 Fix ARM build of RocksDB
Former-commit-id: 7301d6d5e76b65115e2610a5fc5afee443782d7c
2020-08-17 02:25:45 +00:00
John Sully 2c2d22fe65 Fast cleanup of snapshots without leaving them forever
Former-commit-id: fdd83b2b49244ed2988b080892ee5cffe9fd2684
2020-08-17 00:33:37 +00:00
John Sully 49c1c3c7de Fast cleanup of snapshots without leaving them forever
Former-commit-id: fdd83b2b49244ed2988b080892ee5cffe9fd2684
2020-08-17 00:33:37 +00:00
John Sully 407a62ae67 Allow garbage collection of generic data
Former-commit-id: feadb7fb1845027422bcfca43dbcb6097409b8dc
2020-08-17 00:32:48 +00:00
John Sully 7d6394466c Allow garbage collection of generic data
Former-commit-id: feadb7fb1845027422bcfca43dbcb6097409b8dc
2020-08-17 00:32:48 +00:00
John Sully 58bb557624 Add snapshot depth to info string
Former-commit-id: 66aef678e9d6d7ab6c28622d54ada0ea8cdd2a99
2020-08-16 00:27:10 +00:00
John Sully f6c7a99743 Add snapshot depth to info string
Former-commit-id: 66aef678e9d6d7ab6c28622d54ada0ea8cdd2a99
2020-08-16 00:27:10 +00:00
John Sully a2d01828ad Don't try and consolidate snapshots with a depth of 1
Former-commit-id: 26c298bd9bc4e2c6981de5c20284120ea54580c3
2020-08-16 00:26:05 +00:00
John Sully 85e82d2513 Don't try and consolidate snapshots with a depth of 1
Former-commit-id: 26c298bd9bc4e2c6981de5c20284120ea54580c3
2020-08-16 00:26:05 +00:00
John Sully 2e5a715106 Only save MVCC tstamps if its an active replica
Former-commit-id: 5aded7dbad055308dc3932f7797fc71684b60966
2020-08-16 00:24:18 +00:00
John Sully e1270df8ea Only save MVCC tstamps if its an active replica
Former-commit-id: 5aded7dbad055308dc3932f7797fc71684b60966
2020-08-16 00:24:18 +00:00
John Sully 0fc392ceeb Don't free snapshot objects in a critical path (under the AE lock)
Former-commit-id: d0da3d3cb74334cc8a2d14f4bdaef7935181700a
2020-08-16 00:13:19 +00:00
John Sully 0167db6ef7 Don't free snapshot objects in a critical path (under the AE lock)
Former-commit-id: d0da3d3cb74334cc8a2d14f4bdaef7935181700a
2020-08-16 00:13:19 +00:00
John Sully 3089ecdc70 BUG: Cannot have an EMBSTR bigger than 255
Former-commit-id: e2d6e2d9d585cb7a73f469a8580f9cb0ec71a429
2020-08-15 23:30:22 +00:00
John Sully cd1212e238 BUG: Cannot have an EMBSTR bigger than 255
Former-commit-id: e2d6e2d9d585cb7a73f469a8580f9cb0ec71a429
2020-08-15 23:30:22 +00:00
John Sully cc5c98fa4a remove unnecessary allocation in rdb save
Former-commit-id: dfa76f04fd862e0cc7b4d3284b3922e3a5e5549d
2020-08-15 23:27:32 +00:00
John Sully cd426294a4 remove unnecessary allocation in rdb save
Former-commit-id: dfa76f04fd862e0cc7b4d3284b3922e3a5e5549d
2020-08-15 23:27:32 +00:00
John Sully a8ab467d8d Remove unnecessary key comparisons in perf critical snapshot paths
Former-commit-id: 40f8a8d102fdca9443399ef03a47df609b146d58
2020-08-15 23:25:58 +00:00
John Sully 00b5d3b9b1 Remove unnecessary key comparisons in perf critical snapshot paths
Former-commit-id: 40f8a8d102fdca9443399ef03a47df609b146d58
2020-08-15 23:25:58 +00:00
John Sully 61601fbaa2 dictMerge perf improvements
Former-commit-id: 48401ec369c5693689ef658cca518dc94ab1402e
2020-08-15 23:14:29 +00:00
John Sully ed3537fff8 dictMerge perf improvements
Former-commit-id: 48401ec369c5693689ef658cca518dc94ab1402e
2020-08-15 23:14:29 +00:00
John Sully 815d8ce117 Rehash efficiency
Former-commit-id: fab383156626ec683881101c22eb2f6c2cea4c5d
2020-08-15 23:05:56 +00:00
John Sully e277ed7d86 Rehash efficiency
Former-commit-id: fab383156626ec683881101c22eb2f6c2cea4c5d
2020-08-15 23:05:56 +00:00
John Sully c1455619b1 Prevent unnecessary copy when overwriting a value from a snapshot
Former-commit-id: 654a7bc6ea82f4ac45a1c1a25c794e1c27c0d902
2020-08-15 22:59:01 +00:00
John Sully 24663b22c1 Prevent unnecessary copy when overwriting a value from a snapshot
Former-commit-id: 654a7bc6ea82f4ac45a1c1a25c794e1c27c0d902
2020-08-15 22:59:01 +00:00
John Sully 98d1f913fa Merge branch 'unstable' into keydbpro
Former-commit-id: ae482585f0dc470efd73833f74111c2f87a172c5
2020-08-15 21:29:00 +00:00
John Sully 8fd2f6d1bb Merge branch 'unstable' into keydbpro
Former-commit-id: ae482585f0dc470efd73833f74111c2f87a172c5
2020-08-15 21:29:00 +00:00
John Sully d1705498ff Prehash the tombstone for cleanup
Former-commit-id: c9d97a7c7448fc769486175bea1648589487c87c
2020-08-14 16:05:39 +00:00
John Sully b65d18fa64 Prehash the tombstone for cleanup
Former-commit-id: c9d97a7c7448fc769486175bea1648589487c87c
2020-08-14 16:05:39 +00:00
benschermel 9b318a264b update changelog
Former-commit-id: 6709f3c8b776921fafd59046c646283f383cab71
2020-08-11 04:39:08 +00:00
benschermel 63843fe9ac update changelog
Former-commit-id: 6709f3c8b776921fafd59046c646283f383cab71
2020-08-11 04:39:08 +00:00
John Sully 1347ef8fc1 6.0.15 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 05140de5a46d05e39815472f96be526868800f30
2020-08-11 00:27:31 -04:00
John Sully 1d9ce839da 6.0.15 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 05140de5a46d05e39815472f96be526868800f30
2020-08-11 00:27:31 -04:00
John Sully 00ed7731df Add build flag to disable MVCC tstamps
Former-commit-id: 1ff2f20de5e41920043480d099e2b3fb16b1dc89
2020-08-10 06:10:24 +00:00
John Sully 6729f2f31a Fix lock after free in module API
Former-commit-id: afbe6c6553e4c2456f6259a2cea2ee66aab268eb
2020-08-10 06:10:24 +00:00
John Sully 5a13b0ff35 MVCC Perf fixes
Former-commit-id: 5a4afe5fb4231bec34d434f9e3214a7320842091
2020-08-10 05:45:56 +00:00
John Sully 1ca8945354 MVCC Perf fixes
Former-commit-id: 5a4afe5fb4231bec34d434f9e3214a7320842091
2020-08-10 05:45:56 +00:00
John Sully f5778f24e7 Fix assert caused by freeTombstoneObjects and null check in consolidate_children
Former-commit-id: 8565a02b331cd2bba2a1c7c6693dfb3f6e61c845
2020-08-10 05:01:36 +00:00
John Sully 2fcb94298e Fix assert caused by freeTombstoneObjects and null check in consolidate_children
Former-commit-id: 8565a02b331cd2bba2a1c7c6693dfb3f6e61c845
2020-08-10 05:01:36 +00:00
John Sully 3eb20eef14 RocksDB Read Performance Improvements
Former-commit-id: 80cca4869888e048e10e11f1f20796c482c3e5b3
2020-08-09 23:36:20 +00:00
John Sully 8cdef55843 RocksDB Read Performance Improvements
Former-commit-id: 80cca4869888e048e10e11f1f20796c482c3e5b3
2020-08-09 23:36:20 +00:00
John Sully 1f469446b9 Ensure we use the SSE CRC32 instruction
Former-commit-id: 78ef8976e86d07d4c1fa7c4631a610babf2f4776
2020-08-09 01:47:53 +00:00
John Sully 1724efaac3 Ensure we use the SSE CRC32 instruction
Former-commit-id: 78ef8976e86d07d4c1fa7c4631a610babf2f4776
2020-08-09 01:47:53 +00:00
John Sully 1b23e1b29f Start off storage cache with a larger size
Former-commit-id: 5f6fb970a81cc73586ba595b35564e7865e7262d
2020-08-09 00:57:56 +00:00
John Sully 65b61c9c63 Start off storage cache with a larger size
Former-commit-id: 5f6fb970a81cc73586ba595b35564e7865e7262d
2020-08-09 00:57:56 +00:00
John Sully 52cb1d2a1b Disable compression it destroys read perf
Former-commit-id: d3fffc12ae5339886f54c064127497f277393b00
2020-08-06 22:30:56 +00:00
John Sully f65108c650 Disable compression it destroys read perf
Former-commit-id: d3fffc12ae5339886f54c064127497f277393b00
2020-08-06 22:30:56 +00:00
John Sully c43d5c5b27 keydbpro unstable version should be 0.0.0
Former-commit-id: 4a6e0772f36d5dd721ad2e9b83f9fccce2e38ff0
2020-08-06 02:13:23 +00:00
John Sully 10b34326d7 keydbpro unstable version should be 0.0.0
Former-commit-id: 4a6e0772f36d5dd721ad2e9b83f9fccce2e38ff0
2020-08-06 02:13:23 +00:00
John Sully a68d233d47 Latency normalization with SCAN
Former-commit-id: 237f25d854e70d4d7a3095fdf56aaa80770e492e
2020-08-04 04:37:16 +00:00
John Sully 0b8a79e781 Latency normalization with SCAN
Former-commit-id: 237f25d854e70d4d7a3095fdf56aaa80770e492e
2020-08-04 04:37:16 +00:00
John Sully dc704f8d93 Bump version
Former-commit-id: 76c557e9f3c15094aa4f2c5f8a4484f73c7a96a4
2020-07-16 22:45:13 +00:00
John Sully b662876d6e Bump version
Former-commit-id: 76c557e9f3c15094aa4f2c5f8a4484f73c7a96a4
2020-07-16 22:45:13 +00:00
John Sully cc032f1d38 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 9bc0cb29f1c8dc8258603ea1c353fe495c1228ae
2020-07-16 22:42:48 +00:00
John Sully f800d02573 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 9bc0cb29f1c8dc8258603ea1c353fe495c1228ae
2020-07-16 22:42:48 +00:00
John Sully f4d2f3761e Fix memory leak in MVCC scan
Former-commit-id: 3acf80f8dd5ebc311670398745ef3400333a1fcb
2020-07-16 22:42:24 +00:00
John Sully 271f6e8a57 Fix memory leak in MVCC scan
Former-commit-id: 3acf80f8dd5ebc311670398745ef3400333a1fcb
2020-07-16 22:42:24 +00:00
John Sully 9bf1751b96 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: eb00c2dddc385dad4b0695d64b4f99f7a003c208
2020-07-14 04:34:56 +00:00
John Sully 47fc7f81c8 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: eb00c2dddc385dad4b0695d64b4f99f7a003c208
2020-07-14 04:34:56 +00:00
John Sully 2b8f614676 Fix test failure
Former-commit-id: 05d84f5fc184676d32c4bb61ac5957f1787cd4f8
2020-07-14 04:34:40 +00:00
John Sully a3ea2c8204 Fix test failure
Former-commit-id: 05d84f5fc184676d32c4bb61ac5957f1787cd4f8
2020-07-14 04:34:40 +00:00
John Sully 12b6655aa4 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 08264b4e755cee34704c85b191606a2b28d6d883
2020-07-14 04:25:05 +00:00
John Sully 79b22dcb8e Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 08264b4e755cee34704c85b191606a2b28d6d883
2020-07-14 04:25:05 +00:00
John Sully 86a95936ff Add new storage-provider-options config
Former-commit-id: 195a28beecc6094f959ddafef7fe33f5b55e4047
2020-07-14 04:24:46 +00:00
John Sully eea5c63dcd Add new storage-provider-options config
Former-commit-id: 195a28beecc6094f959ddafef7fe33f5b55e4047
2020-07-14 04:24:46 +00:00
John Sully 4c8b095fe9 Remove gitter, we don't check it often enough
Former-commit-id: 0fff96c31717cfef333e0b6e5e2b88b55a7beca5
2020-07-13 21:14:03 -04:00
John Sully d6626d8b68 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 86eb3f5c5ea3c17d798e74126e08114a2dd2449e
2020-07-13 18:16:05 +00:00
John Sully 7018fdb105 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 86eb3f5c5ea3c17d798e74126e08114a2dd2449e
2020-07-13 18:16:05 +00:00
John Sully 4cc6ad30aa Merge branch 'keydbpro' of https://github.com/JohnSully/KeyDB-Pro into keydbpro
Former-commit-id: 7ce91d858f298d6172df7152fcf49188ca8251f3
2020-07-13 18:15:15 +00:00
John Sully 049c8decb8 Merge branch 'keydbpro' of https://github.com/JohnSully/KeyDB-Pro into keydbpro
Former-commit-id: 7ce91d858f298d6172df7152fcf49188ca8251f3
2020-07-13 18:15:15 +00:00
John Sully 88f1f84299 Perf fixes on expire lock
Former-commit-id: 7f23ac087720317f54a0bc0e0c4774e7b0ef4337
2020-07-13 18:14:52 +00:00
John Sully 067d28ced5 Perf fixes on expire lock
Former-commit-id: 7f23ac087720317f54a0bc0e0c4774e7b0ef4337
2020-07-13 18:14:52 +00:00
John Sully 20fafa9248 Build fixes from cherry-pick
Former-commit-id: 70efd87cf71bb230e8b53d1c4ed3dd91997b4d23
2020-07-13 16:09:03 +00:00
John Sully 36faa5a3af Build fixes from cherry-pick
Former-commit-id: 70efd87cf71bb230e8b53d1c4ed3dd91997b4d23
2020-07-13 16:09:03 +00:00
John Sully ad7c5dbb25 unoredered_map is faster, reduce latency with the switch
Former-commit-id: f241e435ed0fd2988ada887f02e19884fd82be51
2020-07-13 16:04:00 +00:00
John Sully 712f10d8dd unoredered_map is faster, reduce latency with the switch
Former-commit-id: f241e435ed0fd2988ada887f02e19884fd82be51
2020-07-13 16:04:00 +00:00
John Sully 957673729e Remove unnecessary work from critical path (Latency Fixes)
Former-commit-id: 096a90deb7afe489875d3186f3f8f43e41fea329
2020-07-13 16:03:52 +00:00
John Sully 6f616418e5 Remove unnecessary work from critical path (Latency Fixes)
Former-commit-id: 096a90deb7afe489875d3186f3f8f43e41fea329
2020-07-13 16:03:52 +00:00
benschermel 0ef21f011b updating deb changelog
Former-commit-id: ea03d462ceddfbece66099304a91cc706fc93411
2020-07-13 01:41:18 -04:00
benschermel 0f1e830f53 updating deb changelog
Former-commit-id: ea03d462ceddfbece66099304a91cc706fc93411
2020-07-13 01:41:18 -04:00
benschermel dfa951d1f8 update deb changelog
Former-commit-id: a6782a3c0d
2020-07-13 01:35:25 -04:00
John Sully 3315d6f467 Bump version
Former-commit-id: 297f50e491030c2a65448aa80ec543263e28c298
2020-07-13 04:00:24 +00:00
John Sully 3785b293ed Bump version
Former-commit-id: 297f50e491030c2a65448aa80ec543263e28c298
2020-07-13 04:00:24 +00:00
John Sully 7188b28749 Bump version
Former-commit-id: f7d7baccc9
2020-07-13 03:59:16 +00:00
John Sully 61c37dcd5c Merge branch 'flash_cache' into keydbpro
Former-commit-id: 2a721ef645921d62b39f1374c0a3f5c92b00fae5
2020-07-13 03:53:34 +00:00
John Sully 10496feceb Merge branch 'flash_cache' into keydbpro
Former-commit-id: 2a721ef645921d62b39f1374c0a3f5c92b00fae5
2020-07-13 03:53:34 +00:00
John Sully 18a6f285be Merge branch 'PRO_RELEASE_6' into keydbpro
Former-commit-id: bffe010ea5279bee869bc61cc6d933979e10bbea
2020-07-13 03:32:14 +00:00
John Sully 33207b7f5e Merge branch 'PRO_RELEASE_6' into keydbpro
Former-commit-id: bffe010ea5279bee869bc61cc6d933979e10bbea
2020-07-13 03:32:14 +00:00
John Sully 835f0c0537 Merge branch 'unstable' into keydbpro
Former-commit-id: 0dafbc254a0efd5ee302d5c58fb2ca0a85110104
2020-07-13 03:31:47 +00:00
John Sully b3b424cddf Merge branch 'unstable' into keydbpro
Former-commit-id: 0dafbc254a0efd5ee302d5c58fb2ca0a85110104
2020-07-13 03:31:47 +00:00
John Sully 190e307920 Merge branch 'unstable' into RELEASE_6
Former-commit-id: eff294e374
2020-07-13 01:05:36 +00:00
John Sully ec4dded408 Merge branch 'unstable' of https://github.com/JohnSully/KeyDB into unstable
Former-commit-id: b20436e8f078cc93eaa0191705060871d34001b4
2020-07-13 01:05:17 +00:00
John Sully 295c7f6979 Merge branch 'unstable' into RELEASE_6
Former-commit-id: f7c2006bf6
2020-07-13 01:04:49 +00:00
John Sully 0612dba980 Merge tag '6.0.5' into unstable
Redis 6.0.5


Former-commit-id: 2b3238403742f3ab047c62ee7fc3d6be8d05e56f
2020-07-13 00:55:23 +00:00
benschermel 5f10be5635 update rpm permissions
Former-commit-id: 7aec1e5c6463ea77d27833c66e124e8184c4a123
2020-07-12 18:08:29 -04:00
benschermel 30214509f0 update rpm permissions
Former-commit-id: 7aec1e5c6463ea77d27833c66e124e8184c4a123
2020-07-12 18:08:29 -04:00
benschermel 8b690bfda0 Merge branch 'unstable' of https://github.com/JohnSully/KeyDB into unstable
Former-commit-id: 4c434ddd4ec61386c9ebed895f7ac56fe9bc2363
2020-07-12 18:04:40 -04:00
benschermel a63c8da562 update rpm permissions
Former-commit-id: e4d94022df4f9d39602b63c35e7e9efd5678dbd0
2020-07-12 18:03:21 -04:00
John Sully b3c0d517a9 Add the KEYDB.MEXISTS command, see issue #203
Former-commit-id: bbdf2f794529cdd2969c9b21be9d009b6554d6d2
2020-07-12 21:42:11 +00:00
John Sully 821f47e501 Add multi-master-no-forward command to reduce bus traffic with multi-master
Former-commit-id: 607ebd474f33085108e9e2ffeb3475941b7f8c13
2020-07-12 19:25:19 +00:00
John Sully c30ad7c92f Document min-clients-per-thread
Former-commit-id: 5b94e051cdc678700b2281d60a9510190e85a0b0
2020-07-12 18:49:02 +00:00
John Sully e506455480 Prevent deadlock in RM_ThreadSafeContextLock() when triggered as part of a module callback in a server thread
Former-commit-id: 61119d6c18fe39e93e961985120214c6b263b747
2020-07-12 18:17:53 +00:00
John Sully 79d933cd08 Fix CLI crash on arch with hostname
Former-commit-id: 55fd37e8d6c3775d0b1bd13966ca033f63945d7e
2020-07-12 05:38:08 +00:00
John Sully a07d19f2eb Fix CLI crash on arch with hostname
Former-commit-id: 55fd37e8d6c3775d0b1bd13966ca033f63945d7e
2020-07-12 05:38:08 +00:00
John Sully 7f2e3ebea4 Fix CLI crash on arch with hostname
Former-commit-id: a5b584d7d36c60cbbcf815572229b6c80a3a3dce
2020-07-12 05:37:43 +00:00
John Sully 2f4b772cba Fix CLI crash on arch with hostname
Former-commit-id: a5b584d7d36c60cbbcf815572229b6c80a3a3dce
2020-07-12 05:37:43 +00:00
John Sully 2a5fcf271e Fix failure to replicate with license key
Former-commit-id: d34723c567b36f8222c93fac6f0ed1f79104f33e
2020-07-12 05:15:22 +00:00
John Sully 48b91791a6 Fix failure to replicate with license key
Former-commit-id: d34723c567b36f8222c93fac6f0ed1f79104f33e
2020-07-12 05:15:22 +00:00
John Sully c2aab0c9a2 Fix failure to replicate with license key
Former-commit-id: 41a72a795ade90b1aea509e9e3ebad819a997acf
2020-07-12 05:14:59 +00:00
John Sully 237aa9e752 Fix failure to replicate with license key
Former-commit-id: 41a72a795ade90b1aea509e9e3ebad819a997acf
2020-07-12 05:14:59 +00:00
John Sully 918fe46caf Fix failure to merge databases on active replica sync, due to bad merge with Redis 6
Former-commit-id: a04988583580bbe9c709163bab0719345abce1c0
2020-07-12 01:13:22 +00:00
John Sully 4de18de7e1 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 507b791211b4b0c3251dc538fa385cd95a189e80
2020-07-11 22:27:32 +00:00
John Sully fcacb7422b Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 507b791211b4b0c3251dc538fa385cd95a189e80
2020-07-11 22:27:32 +00:00
John Sully 52f6d76588 Add KeyDB Pro info section
Former-commit-id: d73015fae36ece6db7b088cc55843385688b1866
2020-07-11 22:21:12 +00:00
John Sully 38ea14246f Add KeyDB Pro info section
Former-commit-id: d73015fae36ece6db7b088cc55843385688b1866
2020-07-11 22:21:12 +00:00
John Sully b6acd18ffa Sentinel doesn't need a license key
Former-commit-id: bc2d8c18255214b873bf45d8db8af3727ebc4723
2020-07-11 22:13:07 +00:00
John Sully fdb01a2a6d Sentinel doesn't need a license key
Former-commit-id: bc2d8c18255214b873bf45d8db8af3727ebc4723
2020-07-11 22:13:07 +00:00
John Sully 52a1a415c2 Fix failure to replicate with non-pro server when license key is set
Former-commit-id: a69beef7d92223c8dcebb9c39ca2409183571e57
2020-07-11 22:09:27 +00:00
John Sully 71d79296b8 Fix failure to replicate with non-pro server when license key is set
Former-commit-id: a69beef7d92223c8dcebb9c39ca2409183571e57
2020-07-11 22:09:27 +00:00
John Sully 657d261760 Support missing Redis 6 config options
Former-commit-id: 86a5f37fb14623400fec22f52bf530dc7be1d0cd
2020-07-11 21:39:20 +00:00
John Sully 11455692ad Support missing Redis 6 config options
Former-commit-id: d467701c6cd8ebe2937c6fda816a706a6b17182a
2020-07-11 21:38:17 +00:00
John Sully 3c808e3e08 Support missing Redis 6 config options
Former-commit-id: d467701c6cd8ebe2937c6fda816a706a6b17182a
2020-07-11 21:38:17 +00:00
John Sully ae2afc082a Implement storage key cache, and writeback memory model
Former-commit-id: 732bd9c153459f1174475ad67de36c399ddbe359
2020-07-11 21:23:48 +00:00
John Sully f3cba11f79 Implement storage key cache, and writeback memory model
Former-commit-id: 732bd9c153459f1174475ad67de36c399ddbe359
2020-07-11 21:23:48 +00:00
John Sully 2601b3936b Eliminate eviction loops. And don't OOM so often with storage providers set
Former-commit-id: 6e61cd33b4366f008b07aae88f49fd0ac9cbcaec
2020-07-11 06:51:08 +00:00
John Sully 39fe60fff8 Eliminate eviction loops. And don't OOM so often with storage providers set
Former-commit-id: 6e61cd33b4366f008b07aae88f49fd0ac9cbcaec
2020-07-11 06:51:08 +00:00
John Sully caa35a48ed Eliminate eviction loops. And don't OOM so often with storage providers set
Former-commit-id: 189674aea74c483bf0869050ecf7bf2b0b49f34e
2020-07-11 04:23:35 +00:00
John Sully e14ac88246 Eliminate eviction loops. And don't OOM so often with storage providers set
Former-commit-id: 189674aea74c483bf0869050ecf7bf2b0b49f34e
2020-07-11 04:23:35 +00:00
John Sully a3f416c9d5 Bump version
Former-commit-id: ee5a281ed0012aca359b9448df5236bef719f4a7
2020-07-10 04:13:42 +00:00
John Sully 62a8d9b336 Bump version
Former-commit-id: ee5a281ed0012aca359b9448df5236bef719f4a7
2020-07-10 04:13:42 +00:00
John Sully 6332395792 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 243dcb3853cc965109cb24a940229db7844cdd11
2020-07-10 04:11:57 +00:00
John Sully 6d2e560a3e Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 243dcb3853cc965109cb24a940229db7844cdd11
2020-07-10 04:11:57 +00:00
John Sully 66a931c85f Merge branch 'mvcc_scan' into keydbpro
Former-commit-id: f0a3f491b61a9bb7ee4ab86098958cb161b75f59
2020-07-10 03:44:20 +00:00
John Sully 4a47df12fe Merge branch 'mvcc_scan' into keydbpro
Former-commit-id: f0a3f491b61a9bb7ee4ab86098958cb161b75f59
2020-07-10 03:44:20 +00:00
John Sully 1216fd8457 MVCC scan support filtering by type on the async thread
Former-commit-id: 14f8c0ff686b93976eead5fa6bf526c2eecb5ae0
2020-07-10 03:43:56 +00:00
John Sully f52d3a3892 MVCC scan support filtering by type on the async thread
Former-commit-id: 14f8c0ff686b93976eead5fa6bf526c2eecb5ae0
2020-07-10 03:43:56 +00:00
John Sully c97dace784 Fix issue where SCAN misses elements while snapshot is in flight
Former-commit-id: ce005d748ebf0e116d674a96f74d698d17394010
2020-07-10 01:43:51 +00:00
John Sully 685f549b32 Fix issue where SCAN misses elements while snapshot is in flight
Former-commit-id: ce005d748ebf0e116d674a96f74d698d17394010
2020-07-10 01:43:51 +00:00
John Sully bfff449ef9 Disable MVCC GET, the overhead is not worth it
Former-commit-id: 8c7e1001e98be0d0e6fe0079fc9406d5d65366ff
2020-07-10 01:43:32 +00:00
John Sully feddce79fa Disable MVCC GET, the overhead is not worth it
Former-commit-id: 8c7e1001e98be0d0e6fe0079fc9406d5d65366ff
2020-07-10 01:43:32 +00:00
John Sully 33385a0a63 Fix issue where we fail to return all data
Former-commit-id: 7341c9ed14d13386a045afd6deda9c0db422cd5f
2020-07-10 00:18:10 +00:00
John Sully ea094a8ca4 Fix issue where we fail to return all data
Former-commit-id: 7341c9ed14d13386a045afd6deda9c0db422cd5f
2020-07-10 00:18:10 +00:00
John Sully 90270193e6 Graceful shutdown running async jobs
Former-commit-id: 2ce5b94741d384b2dfd6d3b347fa1582cd45df8f
2020-07-10 00:17:39 +00:00
John Sully f774fcb704 Graceful shutdown running async jobs
Former-commit-id: 2ce5b94741d384b2dfd6d3b347fa1582cd45df8f
2020-07-10 00:17:39 +00:00
John Sully 184f22e502 Fix race in db iterators in scan
Former-commit-id: a6444870660c0d3f52cd7b1dc0b80223f0d58e70
2020-07-09 22:29:27 +00:00
John Sully 7ccd312069 Fix race in db iterators in scan
Former-commit-id: a6444870660c0d3f52cd7b1dc0b80223f0d58e70
2020-07-09 22:29:27 +00:00
John Sully 86533f3c52 Do actual filtering on the async thread
Former-commit-id: 64b17139b7b5ff55bb52f27dc6f91cb81adde031
2020-07-09 21:58:06 +00:00
John Sully 6f676ba0a2 Do actual filtering on the async thread
Former-commit-id: 64b17139b7b5ff55bb52f27dc6f91cb81adde031
2020-07-09 21:58:06 +00:00
John Sully cf4c38f0df Initial scan implementation (not tested)
Former-commit-id: 0f3911d56e6878d91b6e3cacc7d637934ffe6099
2020-07-09 12:57:35 -04:00
John Sully cee8118242 Initial scan implementation (not tested)
Former-commit-id: 0f3911d56e6878d91b6e3cacc7d637934ffe6099
2020-07-09 12:57:35 -04:00
John Sully 2b503c0660 Latency fixes
Former-commit-id: d8c43b48b847ad9abd4d288930ca73388c95fb14
2020-07-01 21:59:38 -04:00
Muhammad Zahalqa 6fd951d785 replace memcpy with cctor on objects
Former-commit-id: 8534c02c5fb22f00d7a0746d79cbfd6d3186c586
2020-06-24 23:20:59 -04:00
Muhammad Zahalqa 047731d2e7 unique lock used with cv.wait already owns mutex
Former-commit-id: 91ad3e8df3ab1c1db8d6a46ccffb75bac1369494
2020-06-24 23:18:53 -04:00
Muhammad Zahalqa a6fbb5ff23 Fix bug in condition_variabe.wait usage
consition variable wait should always be called with a locked mutex.
This code break the pre-conditions of using wait.


Former-commit-id: 8981f96ca559b2bb885d0a67887854d6c42e8fef
2020-06-24 23:18:53 -04:00
Muhammad Zahalqa 0cf47603c4 fixes for robj_sharedptr
1. fix cases where null pointer might be accessed
2. make assignmnet op safe
3. make operator bool explicit (safe bool idiom)
4. make comparison operators symetric

fix robj_sharedptr use in rdb.cpp


Former-commit-id: 882b71a1fdd76a3b7dc32b21561c3625ff4dbcef
2020-06-24 23:18:27 -04:00
Muhammad Zahalqa 497ddf1525 aeCommand objects no need for memset and missing init of some memebers.
Former-commit-id: 1c9d1e6ca957174ffb5d66a1d8cafab2948e08d8
2020-06-24 23:15:29 -04:00
benschermel 9e328524b5 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 6e9ec7ae3ca49a6054f012e567eb74307227c330
2020-06-24 00:34:35 -04:00
benschermel 821dc2dab3 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 6e9ec7ae3ca49a6054f012e567eb74307227c330
2020-06-24 00:34:35 -04:00
benschermel 1b7aaeb69c update deb changelog
Former-commit-id: 85fe16238fdb692067f77f631b0589366823ba34
2020-06-24 00:32:10 -04:00
benschermel 32406500bf update deb changelog
Former-commit-id: 85fe16238fdb692067f77f631b0589366823ba34
2020-06-24 00:32:10 -04:00
John Sully 2a8ced1e1a Merge PKG files from unstable
No code change


Former-commit-id: 42c4d85d72
2020-06-24 00:16:21 -04:00
Ben Schermel 9c7ba6b408 bump version after merge
Former-commit-id: 59279d36e9337ca89518c4d1edef6c26911ea190
2020-06-16 14:17:20 -04:00
Ben Schermel 7a5ae1a6af bump version after merge
Former-commit-id: 59279d36e9337ca89518c4d1edef6c26911ea190
2020-06-16 14:17:20 -04:00
Ben Schermel 85dcc6d3bb Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: cf7ed118553af55a27c3a57c121bc26e18e0ab7e
2020-06-16 14:16:03 -04:00
Ben Schermel 7c8f260b38 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: cf7ed118553af55a27c3a57c121bc26e18e0ab7e
2020-06-16 14:16:03 -04:00
Ben Schermel b27c7bfb6f Merge branch 'PRO_RELEASE_6' of https://github.com/JohnSully/KeyDB-Pro into PRO_RELEASE_6
Former-commit-id: ff7ec3ec39d692ed59c945ace5c9a4ec140f5e52
2020-06-16 14:15:51 -04:00
Ben Schermel 65bedabe7d Merge branch 'PRO_RELEASE_6' of https://github.com/JohnSully/KeyDB-Pro into PRO_RELEASE_6
Former-commit-id: ff7ec3ec39d692ed59c945ace5c9a4ec140f5e52
2020-06-16 14:15:51 -04:00
John Sully a4a4b7ec9f Fix crash in async delete when storage provider is not set and key doesn't actually exist
Former-commit-id: 4a4828390118ab52851d8bf229c4ae853100053c
2020-06-15 19:47:06 -04:00
John Sully cda77594e5 Fix crash in async delete when storage provider is not set and key doesn't actually exist
Former-commit-id: 4a4828390118ab52851d8bf229c4ae853100053c
2020-06-15 19:47:06 -04:00
Ben Schermel 3b1f7103c4 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 97280cec291bca779739e008b9467fbb40a19a5f
2020-06-10 17:35:21 -04:00
Ben Schermel 129d3b7441 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 97280cec291bca779739e008b9467fbb40a19a5f
2020-06-10 17:35:21 -04:00
Ben Schermel a22512bd45 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: f70e34b999ba842617ed39b88a7f5bb453d570c5
2020-06-10 17:27:34 -04:00
Ben Schermel 58c6a7a0cd Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: f70e34b999ba842617ed39b88a7f5bb453d570c5
2020-06-10 17:27:34 -04:00
John Sully f2e8329509 Fix failure to find expire during rehash
Former-commit-id: b66269865cb71a5e1dd33588b012206da2765824
2020-06-10 12:48:54 -04:00
John Sully 0b9091b999 Fix failure to find expire during rehash
Former-commit-id: b66269865cb71a5e1dd33588b012206da2765824
2020-06-10 12:48:54 -04:00
John Sully f3b5a90626 Bump version
Former-commit-id: c7b16835b1c52e9d8a4859a5b6e42ea5f6a31df2
2020-06-09 21:03:11 -04:00
John Sully 9916e303c2 Bump version
Former-commit-id: c7b16835b1c52e9d8a4859a5b6e42ea5f6a31df2
2020-06-09 21:03:11 -04:00
John Sully c55351cb93 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 9d8d3a54fdb9eaad0a7cfc3d938fa35d2819fa93
2020-06-09 21:02:55 -04:00
John Sully 5a9ef1e81b Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 9d8d3a54fdb9eaad0a7cfc3d938fa35d2819fa93
2020-06-09 21:02:55 -04:00
John Sully 9411a40a5b Fix assert false alarm when freeTombstoneObjects is called
Former-commit-id: e21a011072505cfa0a37afefb94f7270e80625c5
2020-06-09 20:59:09 -04:00
John Sully 50d44e01c4 Fix assert false alarm when freeTombstoneObjects is called
Former-commit-id: e21a011072505cfa0a37afefb94f7270e80625c5
2020-06-09 20:59:09 -04:00
John Sully 8d1d303643 Fix lock inversion
Former-commit-id: 430cf88623fce8f0675ea19f73d98f6cafe9070f
2020-06-09 20:58:03 -04:00
John Sully 4f6c1efc55 Fix lock inversion
Former-commit-id: 430cf88623fce8f0675ea19f73d98f6cafe9070f
2020-06-09 20:58:03 -04:00
John Sully 303b58cf2f COW pointer is not thread safe so we need a global expire lock
Former-commit-id: ac12eef75301564d920e622a08e4f586486fd395
2020-06-09 19:58:42 -04:00
John Sully ebe0b3ece1 COW pointer is not thread safe so we need a global expire lock
Former-commit-id: ac12eef75301564d920e622a08e4f586486fd395
2020-06-09 19:58:42 -04:00
John Sully ec4e2a680c keys command should look at the snapshots expire datastructure
Former-commit-id: 70563afab48e607e127c07d637660d94d1eede6d
2020-06-09 18:57:36 -04:00
John Sully d99594a3a5 keys command should look at the snapshots expire datastructure
Former-commit-id: 70563afab48e607e127c07d637660d94d1eede6d
2020-06-09 18:57:36 -04:00
John Sully 220bd27930 Implement replicaof remove as requested in issue #192
Former-commit-id: f0a32351c50fac79727a1be28f03fb527cf580de
2020-06-09 12:43:58 -04:00
Ben Schermel d0c29a2756 fix issues from rebase
Former-commit-id: 5d7cc28208bbe7b49eed0d1b1c2bb1c31e65e865
2020-06-09 00:10:58 -04:00
Ben Schermel 2dd3f584cc fix issues from rebase
Former-commit-id: 5d7cc28208bbe7b49eed0d1b1c2bb1c31e65e865
2020-06-09 00:10:58 -04:00
Ben Schermel 8627d75aef update Dockerfile
Former-commit-id: 3f8dcfdf865ca0857bf2d5261b858cc3daa22f3f
2020-06-09 00:10:58 -04:00
Ben Schermel 2c58377168 update Dockerfile
Former-commit-id: 3f8dcfdf865ca0857bf2d5261b858cc3daa22f3f
2020-06-09 00:10:58 -04:00
Ben Schermel 9b42437630 updating changelog
Former-commit-id: 5affe6dd268bb333214f70f5f809050e4b00b28b
2020-06-09 00:10:58 -04:00
Ben Schermel e82831f35e updating changelog
Former-commit-id: 5affe6dd268bb333214f70f5f809050e4b00b28b
2020-06-09 00:10:58 -04:00
Ben Schermel 0d3e590022 dh9 for stretch deb pkg
Former-commit-id: 5cf02197ba418b5302759c14195ffa33a1db70fe
2020-06-09 00:10:58 -04:00
Ben Schermel 3bf75d133c dh9 for stretch deb pkg
Former-commit-id: 5cf02197ba418b5302759c14195ffa33a1db70fe
2020-06-09 00:10:58 -04:00
Ben Schermel 9c058fa7b2 fix missing sentinel
Former-commit-id: 01fe9274e8cb73a065d8550f220d07e5eacd0156
2020-06-09 00:10:58 -04:00
Ben Schermel bd94fcb152 fix missing sentinel
Former-commit-id: 01fe9274e8cb73a065d8550f220d07e5eacd0156
2020-06-09 00:10:58 -04:00
Ben Schermel b1bff21085 update changelog
Former-commit-id: e2be81157e9cd1f57b9d734c5536dc0f4d5dbb0b
2020-06-09 00:10:58 -04:00
Ben Schermel 977e1722e0 update changelog
Former-commit-id: e2be81157e9cd1f57b9d734c5536dc0f4d5dbb0b
2020-06-09 00:10:58 -04:00
Ben Schermel 8c71a36cb4 update changelog
Former-commit-id: f0fe6c6b3f249a919ad5f4a233049c7a931bf5cc
2020-06-09 00:10:58 -04:00
Ben Schermel 2712c4d2af update changelog
Former-commit-id: f0fe6c6b3f249a919ad5f4a233049c7a931bf5cc
2020-06-09 00:10:58 -04:00
Ben Schermel e6a031d342 update changelog
Former-commit-id: 5acb71ac79be4b0404fc56e82485a28f9664a017
2020-06-09 00:10:58 -04:00
Ben Schermel 4fa31ea86e update changelog
Former-commit-id: 5acb71ac79be4b0404fc56e82485a28f9664a017
2020-06-09 00:10:58 -04:00
Ben Schermel 53a11d7f5b update changelog
Former-commit-id: adb5f42d945960cbe153e3614a1126972c8ce841
2020-06-09 00:10:58 -04:00
Ben Schermel 75d895be43 update changelog
Former-commit-id: adb5f42d945960cbe153e3614a1126972c8ce841
2020-06-09 00:10:58 -04:00
Ben Schermel 80fd1c23ea include support for dists < dh11
Former-commit-id: 1930b759a9acce126342709acfb7884649023f3d
2020-06-09 00:10:58 -04:00
Ben Schermel 8c1313c28e include support for dists < dh11
Former-commit-id: 1930b759a9acce126342709acfb7884649023f3d
2020-06-09 00:10:58 -04:00
Ben Schermel f8edaba613 enable source build from dh9 where applicable
Former-commit-id: 9e8ea41f73674fb836f89e5d53474b271abf10d8
2020-06-09 00:10:58 -04:00
Ben Schermel e0676e4a9e enable source build from dh9 where applicable
Former-commit-id: 9e8ea41f73674fb836f89e5d53474b271abf10d8
2020-06-09 00:10:58 -04:00
Ben Schermel 9be6f8ee54 update rpm versioning
Former-commit-id: a3ccaeee78279356ec70b136df07026a9fdd43d7
2020-06-09 00:10:58 -04:00
Ben Schermel 40da05d8e4 update rpm versioning
Former-commit-id: a3ccaeee78279356ec70b136df07026a9fdd43d7
2020-06-09 00:10:58 -04:00
Ben Schermel 5f9b73d490 fix rpmbuild dirs
Former-commit-id: 2cf077e6d3bc98cf75120185c7985030b0aa4040
2020-06-09 00:10:58 -04:00
Ben Schermel aa30526242 fix rpmbuild dirs
Former-commit-id: 2cf077e6d3bc98cf75120185c7985030b0aa4040
2020-06-09 00:10:58 -04:00
Ben Schermel 8cbcea4cd6 fix rpmbuild directories
Former-commit-id: 185b6459b065c740990ca503fad880e87d15c436
2020-06-09 00:10:58 -04:00
Ben Schermel b187bc5250 fix rpmbuild directories
Former-commit-id: 185b6459b065c740990ca503fad880e87d15c436
2020-06-09 00:10:58 -04:00
Ben Schermel b5a018a2c0 fix rpmbuild directories
Former-commit-id: 314639460f4959ad6f9d4342d5baa6ad4446e7d4
2020-06-09 00:10:58 -04:00
Ben Schermel 2f72982905 fix rpmbuild directories
Former-commit-id: 314639460f4959ad6f9d4342d5baa6ad4446e7d4
2020-06-09 00:10:58 -04:00
Ben Schermel 61dde8f3ae use dh_installsystemd
Former-commit-id: 9d6d4fba41550442bf04153dc6d6f19a42afb207
2020-06-09 00:10:58 -04:00
Ben Schermel a9b1cffa82 use dh_installsystemd
Former-commit-id: 9d6d4fba41550442bf04153dc6d6f19a42afb207
2020-06-09 00:10:58 -04:00
Ben Schermel bd028278b5 adding dh_installsystemd
Former-commit-id: 39817055d85b4f6a0d575b94737f1b1b2c952708
2020-06-09 00:10:58 -04:00
Ben Schermel 9797bc0679 adding dh_installsystemd
Former-commit-id: 39817055d85b4f6a0d575b94737f1b1b2c952708
2020-06-09 00:10:58 -04:00
Ben Schermel 1c58a9ce3e fix pkg errors
Former-commit-id: 91ef1a50fb8602c7f09156a84eca17dca70b3d2e
2020-06-09 00:10:58 -04:00
Ben Schermel d7fc33e23f fix pkg errors
Former-commit-id: 91ef1a50fb8602c7f09156a84eca17dca70b3d2e
2020-06-09 00:10:58 -04:00
Ben Schermel d395ea54fc adding packaging
Former-commit-id: 108c58ba5333129eabf64f775e69f5cb7b6cbdf9
2020-06-09 00:10:58 -04:00
Ben Schermel d16e0c47d2 adding packaging
Former-commit-id: 108c58ba5333129eabf64f775e69f5cb7b6cbdf9
2020-06-09 00:10:58 -04:00
John Sully 06265aa260 Merge branch 'unstable' into keydbpro
Former-commit-id: ca3a50537e987bd30aec38265be535d89bb260f3
2020-06-08 16:51:16 -04:00
John Sully c77dbfaff2 Merge branch 'unstable' into keydbpro
Former-commit-id: ca3a50537e987bd30aec38265be535d89bb260f3
2020-06-08 16:51:16 -04:00
John Sully ef51cfa877 Update gcov for C++
Former-commit-id: e75cdb20ace406e50a5772160995de4ec62465aa
2020-06-08 16:48:44 -04:00
Ben Schermel fca621dcc2 update Dockerfile
Former-commit-id: 3002959ad2c21173a7652a22a27b65b512e3b791
2020-06-08 15:34:22 -04:00
Ben Schermel 64804ceeb1 updating changelog
Former-commit-id: 5b0fc93119cc758667f7853ba5c9e8b9f0130ada
2020-06-08 15:34:22 -04:00
Ben Schermel cc6e6c4558 dh9 for stretch deb pkg
Former-commit-id: 3d9e61097bfc244b3d2490597447c00293ecf5d5
2020-06-08 15:34:22 -04:00
Ben Schermel e1845f15cf fix missing sentinel
Former-commit-id: a04840112fcae10769a67051d79d6fdaaafa6726
2020-06-08 15:34:22 -04:00
Ben Schermel 13a6464bf5 update changelog
Former-commit-id: 36ba366c1084377b895031efc9bee5b0a54dbc04
2020-06-08 15:34:22 -04:00
Ben Schermel 0f4ebade13 update changelog
Former-commit-id: e4b3980f18a16204a2d9700de887cd122754e5c9
2020-06-08 15:34:22 -04:00
Ben Schermel dcde6ffe51 update changelog
Former-commit-id: a9791dd089830e86c863d2a04109dea26b609a1c
2020-06-08 15:34:22 -04:00
Ben Schermel 19c6643a1f include support for dists < dh11
Former-commit-id: 00c29d05e4a51b55bbf823b21adedb4afeae535a
2020-06-08 15:34:22 -04:00
Ben Schermel 96b183e7d0 fix rpmbuild dirs
Former-commit-id: bc962bd572ab2bd7170ff53c89497c661502c3de
2020-06-08 15:34:22 -04:00
Ben Schermel 526f2bf78d fix rpmbuild dirs
Former-commit-id: 703816e419c37b55904ab700cbd2ac40b50e3915
2020-06-08 15:34:22 -04:00
Ben Schermel bda8f4c3c0 adding dh_installsystemd
Former-commit-id: 1f81b5f2418dfe4f1d74ed3d1be3fe22c410f61d
2020-06-08 15:34:22 -04:00
Ben Schermel bc68456e35 strip unused from deb source
Former-commit-id: 2917754a62e7e8b94753abf70dd31e5c1b889ee0
2020-06-08 15:34:22 -04:00
benschermel 546445576a add deb/rpm/docker support
Former-commit-id: 8f2a32b35df5646ddf95d4ac19e22b3af8bebada
2020-06-08 15:34:22 -04:00
benschermel b1d51e3a3f add deb/rpm/docker support
Former-commit-id: 450a71fb2bda16ca10778d3c9bf68d9e3ef50377
2020-06-08 15:34:22 -04:00
benschermel ea81e82400 update github CI for deb
Former-commit-id: df00307ceb2e2aa2e77d3ee558bfe429797cce0c
2020-06-08 15:34:22 -04:00
Ben Schermel a2426c7fba update rpm versioning
Former-commit-id: c884b90a09dbb7b584785769b6421420cd431be6
2020-06-08 15:34:22 -04:00
benschermel bfcb563dfc add package utilities
Former-commit-id: 64b6ea01378ba57cc8dc1d8f9caa4b53b0f7ce73
2020-06-08 15:34:22 -04:00
John Sully 4531a364e0 Some valgrind fixes
Former-commit-id: fdebdfd82d8f51a98ec27ce409e30edf0fe93ae7
2020-06-07 23:20:10 -04:00
John Sully b1d7a7eeb5 fix valgrind false error
Former-commit-id: beb0f7b8c0f0cd25c97867ca1124a68dd7330c6e
2020-06-07 20:17:47 -04:00
John Sully 492ac4074e fix valgrind false error
Former-commit-id: 887d8bdd110e04b30ffb215726e8aade39f0387a
2020-06-07 20:17:32 -04:00
John Sully 8765dd3890 fix valgrind false error
Former-commit-id: 887d8bdd110e04b30ffb215726e8aade39f0387a
2020-06-07 20:17:32 -04:00
John Sully b62d877494 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 3106f60e0ebdba5db944e704d4b148ea81c806f6
2020-06-07 17:05:00 -04:00
John Sully ea91e43281 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 3106f60e0ebdba5db944e704d4b148ea81c806f6
2020-06-07 17:05:00 -04:00
John Sully 1c6ea53dd8 Fix merge bug
Former-commit-id: cc03c32271997d26ce7f07f96588f126c5939e69
2020-06-07 17:04:46 -04:00
John Sully 3cdf98c591 Fix merge bug
Former-commit-id: cc03c32271997d26ce7f07f96588f126c5939e69
2020-06-07 17:04:46 -04:00
John Sully 19b4f7a280 Endurance mode for tests ignore flaky ones
Former-commit-id: 55778b0483fd0e9043617326772ae7def164966b
2020-06-07 16:59:59 -04:00
John Sully 138021b840 Bump version
Former-commit-id: 4a3e1f3b9b
2020-06-07 16:43:07 -04:00
John Sully 498042cf98 Solo tests should work with loopn
Former-commit-id: 575fc98010
2020-06-07 16:43:07 -04:00
John Sully 6b4d7fd1a9 Stream tests rely on deferring clients, mitigate races caused by them
Former-commit-id: eb18345a61
2020-06-07 16:43:07 -04:00
John Sully a61ef31de4 replication test race
Former-commit-id: d528c5c2c2
2020-06-07 16:43:07 -04:00
John Sully 3ce98133c4 fix race in test
Former-commit-id: fa03a539f3
2020-06-07 16:43:07 -04:00
John Sully 1fc733538f Make lazyfree more reliable
Former-commit-id: 9646b1d944
2020-06-07 16:43:07 -04:00
John Sully 00ddb7162e Detect issues like #189
Former-commit-id: cc5e906ebd
2020-06-07 16:43:07 -04:00
John Sully 326d75bd73 Ensure CRON jobs run in a clean environment
Former-commit-id: b0e14683b2
2020-06-07 16:43:07 -04:00
John Sully 093dc88488 Undecorated new is OK to use
Former-commit-id: 8d5cc4cf0c
2020-06-07 16:43:07 -04:00
John Sully cb29195184 Bump version
Former-commit-id: 52a0556ba15b26d84ca9b5c804eb8fe438c9c888
2020-06-07 16:41:59 -04:00
John Sully 1612360610 Bump version
Former-commit-id: 52a0556ba15b26d84ca9b5c804eb8fe438c9c888
2020-06-07 16:41:59 -04:00
John Sully d025e27c0e Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 6495fe1c7878f96dffa25a2879cb2b825c9e10b2
2020-06-07 16:41:36 -04:00
John Sully e53779229d Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 6495fe1c7878f96dffa25a2879cb2b825c9e10b2
2020-06-07 16:41:36 -04:00
John Sully d14d49df7c Merge branch 'unstable' into keydbpro
Former-commit-id: 461eea07260a31cd75753d5b7be691f5793a6f1b
2020-06-07 16:41:21 -04:00
John Sully b7da76d1f5 Merge branch 'unstable' into keydbpro
Former-commit-id: 461eea07260a31cd75753d5b7be691f5793a6f1b
2020-06-07 16:41:21 -04:00
John Sully e371677389 Report flash disk usage
Former-commit-id: 8e4a71ccd31e3c643a6f7b5154d8f2a65d2de76f
2020-06-07 16:40:03 -04:00
John Sully 8c08aefa57 Report flash disk usage
Former-commit-id: 8e4a71ccd31e3c643a6f7b5154d8f2a65d2de76f
2020-06-07 16:40:03 -04:00
John Sully d544739f9e Solo tests should work with loopn
Former-commit-id: f298b6f0ab7ce9ff5fdad16bab1aa703af90ed95
2020-06-07 15:06:50 -04:00
John Sully f3a3fd90b6 Stream tests rely on deferring clients, mitigate races caused by them
Former-commit-id: 9278a4fdc349787df4932aa41f79856f7396c3d6
2020-06-07 13:59:41 -04:00
John Sully 7d4fe370c6 replication test race
Former-commit-id: 1b7b58e958c48e011b4114b030f205b8b1a20197
2020-06-07 01:14:57 -04:00
John Sully 4c8f684ffc fix race in test
Former-commit-id: 6a1b5f0bb75f047d30e0457da3542b639064d29b
2020-06-07 00:44:11 -04:00
John Sully 9efff548ac Make lazyfree more reliable
Former-commit-id: fea7d8bb7681c52342c977c5424b61a7e5b88a06
2020-06-07 00:40:58 -04:00
John Sully c3eeb4448f Detect issues like #189
Former-commit-id: 0bc38d6ad4e49dc432b86894c07a24e47d44c757
2020-06-05 22:18:28 -04:00
John Sully c35bc52c67 Ensure CRON jobs run in a clean environment
Former-commit-id: 87bcccd08fa0b4e6d45fb4d07423b3804e8e77c1
2020-06-05 21:35:47 -04:00
John Sully 23b7f8dc70 We need to search snapshots before deciding to not save a key
Former-commit-id: 357b09c500eecfe61970e121644a7200ac2387b9
2020-06-05 00:39:58 -04:00
John Sully 9b6871198a We need to search snapshots before deciding to not save a key
Former-commit-id: 357b09c500eecfe61970e121644a7200ac2387b9
2020-06-05 00:39:58 -04:00
John Sully 78f6d47b53 Fix dangling lock
Former-commit-id: 212e56984edfa3221c73b1d3c083efcd28f0dd25
2020-06-04 22:59:24 -04:00
John Sully 8c5627bee5 Fix dangling lock
Former-commit-id: 212e56984edfa3221c73b1d3c083efcd28f0dd25
2020-06-04 22:59:24 -04:00
John Sully 7a388629a3 Fix race when we free an item before we finish writing to disk making it temporarily unavailable
Former-commit-id: 6139cfee295261d0210f2af6217c2a23eeaf52b8
2020-06-04 22:18:03 -04:00
John Sully b354dc8bb0 Fix race when we free an item before we finish writing to disk making it temporarily unavailable
Former-commit-id: 6139cfee295261d0210f2af6217c2a23eeaf52b8
2020-06-04 22:18:03 -04:00
John Sully ec70f86063 Add latency marker for process changes phase for FLASH
Former-commit-id: 61e20b025d45b0af8ed60aab96246b30e4d0ed3d
2020-06-04 01:29:17 -04:00
John Sully 22ee9de03f Add latency marker for process changes phase for FLASH
Former-commit-id: 61e20b025d45b0af8ed60aab96246b30e4d0ed3d
2020-06-04 01:29:17 -04:00
John Sully f675598138 Latency doctor updated for KeyDB Pro
Former-commit-id: a2690fca4a74e92eb44d5e38f886b08363a6d7b0
2020-06-04 01:28:52 -04:00
John Sully 79ab07e713 Latency doctor updated for KeyDB Pro
Former-commit-id: a2690fca4a74e92eb44d5e38f886b08363a6d7b0
2020-06-04 01:28:52 -04:00
John Sully 46192e2e68 maxmem samples way too high
Former-commit-id: 599cac856d4ec77d59c5f5b4fae5b9f194c202ef
2020-06-04 01:28:34 -04:00
John Sully ee26fe0660 maxmem samples way too high
Former-commit-id: 599cac856d4ec77d59c5f5b4fae5b9f194c202ef
2020-06-04 01:28:34 -04:00
John Sully feb13f7d46 Make snapshot completion faster and add latency monitor
Former-commit-id: 8063be6ee70a652c22c3263dccf318366e208891
2020-06-04 01:07:14 -04:00
John Sully 5d13521a36 Make snapshot completion faster and add latency monitor
Former-commit-id: 8063be6ee70a652c22c3263dccf318366e208891
2020-06-04 01:07:14 -04:00
John Sully 39add8d038 Consolidate snapshots should not consider keys in bulk storage
Former-commit-id: e02a8f503d45daf63150c60a8a8c3751b9b8581e
2020-06-04 00:26:51 -04:00
John Sully 9dc45657c5 Consolidate snapshots should not consider keys in bulk storage
Former-commit-id: e02a8f503d45daf63150c60a8a8c3751b9b8581e
2020-06-04 00:26:51 -04:00
John Sully fc54469faf Disambiguate temp rdb files so its less likely two servers with the same working dir will collide
Former-commit-id: 8fbc5a63c54589bb42aa1b1b53c56f399211605c
2020-06-04 00:25:37 -04:00
John Sully 2f7305c04d Disambiguate temp rdb files so its less likely two servers with the same working dir will collide
Former-commit-id: 8fbc5a63c54589bb42aa1b1b53c56f399211605c
2020-06-04 00:25:37 -04:00
John Sully d01128dce0 Only set tombstone if there is something to mask
Former-commit-id: ea092693f53ff0803c44a851219993a933166cc3
2020-06-04 00:23:37 -04:00
John Sully 8d72639e11 Only set tombstone if there is something to mask
Former-commit-id: ea092693f53ff0803c44a851219993a933166cc3
2020-06-04 00:23:37 -04:00
John Sully 42f5df2a55 Extra debug checks in dictmerge
Former-commit-id: 839b2a151e6bad67017de87d7a637359f6ae63d1
2020-06-04 00:22:59 -04:00
John Sully 338ca5f376 Extra debug checks in dictmerge
Former-commit-id: 839b2a151e6bad67017de87d7a637359f6ae63d1
2020-06-04 00:22:59 -04:00
John Sully 26af5fb15d Clear tombstone dict when clearing database we don't need it
Former-commit-id: a8e1ef075eacfc0b767302f2514ca6f0342982bc
2020-06-04 00:17:19 -04:00
John Sully 3397591fe8 Clear tombstone dict when clearing database we don't need it
Former-commit-id: a8e1ef075eacfc0b767302f2514ca6f0342982bc
2020-06-04 00:17:19 -04:00
John Sully bd1caf1cec Fix crash where tombstone is evicted
Former-commit-id: 1f6ff7cc0fc0173610d77a69076eeaf478c3b701
2020-06-03 23:30:35 -04:00
John Sully f93b92deb4 Fix crash where tombstone is evicted
Former-commit-id: 1f6ff7cc0fc0173610d77a69076eeaf478c3b701
2020-06-03 23:30:35 -04:00
John Sully e068840b2d RocksDB compression is too slow
Former-commit-id: 665a8ff0a0a10ffecc36a8410030abd73879944c
2020-06-03 22:21:03 -04:00
John Sully 4e1a91756d RocksDB compression is too slow
Former-commit-id: 665a8ff0a0a10ffecc36a8410030abd73879944c
2020-06-03 22:21:03 -04:00
John Sully 31fa0c6124 Add DB commit latency samples
Former-commit-id: 557ea8d285045496105e3330f0007e02aa4359d7
2020-06-03 22:06:05 -04:00
John Sully 1c85c103af Add DB commit latency samples
Former-commit-id: 557ea8d285045496105e3330f0007e02aa4359d7
2020-06-03 22:06:05 -04:00
John Sully a7862dbea8 Fix crash when overwriting key stored in FLASH but not in ram during a BGSAVE while clustering is enabled
Former-commit-id: 32967b1d671b151bed976e3d13ce26c7e1496c82
2020-06-02 23:59:24 -04:00
John Sully 0428af1894 Fix crash when overwriting key stored in FLASH but not in ram during a BGSAVE while clustering is enabled
Former-commit-id: 32967b1d671b151bed976e3d13ce26c7e1496c82
2020-06-02 23:59:24 -04:00
John Sully dd4342db5c Endurance not setup for pro
Former-commit-id: 97ad41effac1322a4ad14c441e23838bb20528da
2020-06-02 23:47:13 -04:00
John Sully 8b11a5fa45 Endurance not setup for pro
Former-commit-id: 97ad41effac1322a4ad14c441e23838bb20528da
2020-06-02 23:47:13 -04:00
John Sully 5e98e7e69d Fix unmerged script
Former-commit-id: bb0df646cf4362b7f56b29ded89d167fc0f832a9
2020-06-02 21:16:24 -04:00
John Sully ceace21825 Fix unmerged script
Former-commit-id: bb0df646cf4362b7f56b29ded89d167fc0f832a9
2020-06-02 21:16:24 -04:00
John Sully 9bbd6f8873 Bump maxmemory samples by a lot
Former-commit-id: ae46d64b2e6b16f81df6b4e12ddc9fed63a9785b
2020-06-02 17:22:45 -04:00
John Sully b084b01904 Bump maxmemory samples by a lot
Former-commit-id: ae46d64b2e6b16f81df6b4e12ddc9fed63a9785b
2020-06-02 17:22:45 -04:00
John Sully 6b1e08b99d Merge error, server always flushes on eviction
Former-commit-id: 9b3b0c9a40ab5dcdac9620f0fbad84887cc9c832
2020-06-02 17:21:41 -04:00
John Sully 16e0a80c63 Merge error, server always flushes on eviction
Former-commit-id: 9b3b0c9a40ab5dcdac9620f0fbad84887cc9c832
2020-06-02 17:21:41 -04:00
John Sully ddf9857205 Undecorated new is OK to use
Former-commit-id: 8ec3381695847e1e67a7a815036429dee1f4d836
2020-06-01 23:36:01 -04:00
John Sully 20b385c589 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: a901505e562c0dc341fa939cce502da25642f7ba
2020-06-01 17:42:32 -04:00
John Sully 6c09dd2153 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: a901505e562c0dc341fa939cce502da25642f7ba
2020-06-01 17:42:32 -04:00
John Sully d6d8e6b488 Merge branch 'keydbpro' of https://github.com/JohnSully/KeyDB-Pro into keydbpro
Former-commit-id: dd8cd6a00851b00120db9e52030c0bb85d15b54f
2020-06-01 17:42:09 -04:00
John Sully e5792dea6c Merge branch 'keydbpro' of https://github.com/JohnSully/KeyDB-Pro into keydbpro
Former-commit-id: dd8cd6a00851b00120db9e52030c0bb85d15b54f
2020-06-01 17:42:09 -04:00
John Sully 70cedc5151 Merge branch 'unstable' into keydbpro
Former-commit-id: 08a36155e3db9918048e87c3d691b7317787c9ab
2020-06-01 17:41:37 -04:00
John Sully 51d75ad493 Merge branch 'unstable' into keydbpro
Former-commit-id: 08a36155e3db9918048e87c3d691b7317787c9ab
2020-06-01 17:41:37 -04:00
John Sully ecaa5decfd RELEASE endurance tests should run offset from unstable
Former-commit-id: b608acb349
2020-06-01 17:02:16 -04:00
John Sully ac2f07320e Bump version
Former-commit-id: 8dbea2a050
2020-06-01 17:01:50 -04:00
John Sully 277c67a693 maxmem tests should be run solo for higher reliability
Former-commit-id: adf4198d274b0b3daa7f738cb2c20dc38fb94ae6
2020-06-01 16:50:30 -04:00
John Sully 7f0ec896ad Remove debug logs that shouldn't have been checked in
Former-commit-id: f01fae3ab2fcfbe8e29e600c9c74ebb92126c1cb
2020-06-01 16:34:05 -04:00
John Sully e8b2dc33a9 PSYNC test shouldn't wait forever
Former-commit-id: 95a8b903ee5bbe30f2916996b382a18044be8204
2020-06-01 16:13:58 -04:00
John Sully 3f11b88922 PSYNC test reliability improvements (test only issue)
Former-commit-id: 2fdf3363e9501ca63432c3e5301b0246267fe5be
2020-06-01 16:01:26 -04:00
John Sully 4b1bbb4f25 Fix for issue #187 we need to properly handle the case where a key with a subkey expirey itself expires during load
Former-commit-id: ad8a039563ad4f7ccfdc8d088ad07d5da11eba3c
2020-06-01 15:33:19 -04:00
John Sully f10b7d9424 Update endurance.yml
Former-commit-id: d4d882009b58d748d837832f4f7df92fefe1d750
2020-06-01 00:25:31 -04:00
John Sully 4015a56861 Fix module multithreaded test failures
Former-commit-id: 0752eff73f3f5343d56dc71ffe5cd91ddc596893
2020-05-31 23:46:12 -04:00
John Sully 6e6c7d0c2c sendfile has high latency in some scenarios, don't use it
Former-commit-id: 790cf66e651549a1fedfb72d8abe6cdf521742d7
2020-05-31 23:22:25 -04:00
John Sully 3f48c63cea we must always respect the output of sdscat, also change the string so its not a substring of other config params
Former-commit-id: b8e8ae28324f8a8fab98df59ae1f597b1ad66a06
2020-05-31 23:22:10 -04:00
John Sully d7b4762daa Do another iteration for endurance
Former-commit-id: ef287dfedb38423acb5fe03d98dcf3111903cf08
2020-05-31 22:51:02 -04:00
John Sully e32d3172dc Don't start multimaster tests until all nodes are connected
Former-commit-id: 6740c6373198a8b457400970218572f3a9e153ea
2020-05-31 22:50:30 -04:00
John Sully 8ccc6f8398 Fix client race in test (test only issue)
Former-commit-id: 27b97c698b9a36db8c92f0d924885020c1c77de1
2020-05-31 21:39:50 -04:00
John Sully 0ab6fd023f --loop should run forever
Former-commit-id: a23a1b4a82a23831dd9fdef4b19b2740118477e6
2020-05-31 21:27:15 -04:00
John Sully fc49ce3ea8 PUBSUB test reliability: A client race was erroneously failing tests (test only issue)
Former-commit-id: 720c6f22293383007c606d077da2b40365883cfb
2020-05-31 21:27:15 -04:00
John Sully e914c09eff Update endurance.yml
Former-commit-id: 3a1c745f8b562f7b7150b2204cdb2ba6bb5b94d6
2020-05-31 17:50:02 -04:00
John Sully 0c4af8bb2b Active replicas referencing eachother should connect one at a time
Former-commit-id: c054b7381789bae6d33aba06706f93978042a282
2020-05-31 16:03:50 -04:00
John Sully 8fa2a7c324 Fix race in futex_sleep
Former-commit-id: 34833eb35c56b31aebff6c494b5fc25591825642
2020-05-31 16:03:50 -04:00
John Sully 9fc9800ad7 Update endurance.yml
Former-commit-id: ccb3046ada0ea1086a04be3bc399e28013e220a2
2020-05-31 14:18:12 -04:00
John Sully 0f1871a8cd Update endurance.yml
Former-commit-id: 253f64fd56b8d78ace7264a0cc5e1bcf8555ac87
2020-05-31 03:43:06 -04:00
John Sully 1f7e34e793 Endurance tests need more cores
Former-commit-id: 28b21f1c7716e7423a054e3b761fc038c4da8398
2020-05-30 22:16:56 -04:00
John Sully a1f73aacc9 Update endurance.yml
Former-commit-id: 79142fe5f3e5d58ecc2c339d0c99ef865596870d
2020-05-30 20:03:04 -04:00
John Sully 595ad5f1d7 Auto tune lock for high CPU tension scenarios
Former-commit-id: 46a23b07bc52eb5eb8c65700d0aefa258e8d7dac
2020-05-30 18:22:27 -04:00
John Sully 9e740cea0d Ensure endurance run can complete in an hour
Former-commit-id: 86de8f9fd80d3c58cd6894a35e56df9c3fec9a07
2020-05-30 15:31:54 -04:00
John Sully e60a6fb09e We only want one master connection in progress at a time, ensure that if the connection fails we try a different master
Former-commit-id: 4b8105d7dcedb16c69262b69cd4b76f0e9e8a04c
2020-05-30 15:13:28 -04:00
John Sully ca31cbc543 daily CI config fix
Former-commit-id: 256573ceb4ba5594a17bded3fc22cc73064d14e2
2020-05-30 03:27:37 -04:00
John Sully c3ab9bb8eb More clients for endurance
Former-commit-id: 7fc4a29aef6732ca2663821806c6f8785d04fb46
2020-05-30 03:13:04 -04:00
John Sully 6434e785b6 Endurance tests need to be faster, reduce loops
Former-commit-id: 08877b230dfac90969b1e9f5eaa0bd130fc27454
2020-05-30 02:40:44 -04:00
John Sully 3f84f23a13 Only CI ARM daily
Former-commit-id: d36c33691ecf23eddf6f6d4431770517e0277908
2020-05-30 02:34:37 -04:00
John Sully d614dbb666 Also test with multiple threads
Former-commit-id: fe7fd19626070f1a862044be3585eacd3f38ae3f
2020-05-30 02:10:00 -04:00
John Sully f703967b4e Reduce clients for endurance test
Former-commit-id: eef2ad263397b63df5b71bad150c8ec52134e858
2020-05-30 02:07:30 -04:00
John Sully 1dace57ea6 Fix cron syntax
Former-commit-id: f73d7eebc5a5573febc7dbc7f132809bf47e5424
2020-05-30 01:53:21 -04:00
John Sully 9cb69957a5 Add endurance CI tests
Former-commit-id: b97c41382ff4f577a5eefc787dddd6ed67e313a5
2020-05-30 01:47:26 -04:00
John Sully 9c5269de1b Update daily CI job
Former-commit-id: 4de43c237919f63b6721a7be2714848f1e77b443
2020-05-30 01:21:50 -04:00
John Sully 86ced2e09d TLS requires we explicitly marshal connected sockets when using them on a different thread
Former-commit-id: fdcc6a311b93ba5fc9462e68a1510a4653945821
2020-05-30 01:14:53 -04:00
John Sully 504c251c12 Merge branch 'unstable' of https://github.com/JohnSully/KeyDB into unstable
Former-commit-id: c2770b2e1e01d1a366f2d307b9b9d5c40226fc92
2020-05-30 00:06:23 -04:00
John Sully 1bf20aaf7d Fix memory test failures with multithreading enabled
Former-commit-id: 711d49c6780dd40158aea0de0e9bfb374423e6ca
2020-05-30 00:06:15 -04:00
Ben Schermel 1236e8ef37 centos build fix
Former-commit-id: 74e3be98f5db72c4020f77a2280fc409a46d03f9
2020-05-29 22:23:48 -04:00
Ben Schermel 52184a8a34 centos build fix
Former-commit-id: 6fe4571bf959432127b8741c22d8264fd55969b8
2020-05-29 22:21:01 -04:00
Ben Schermel 46100d4550 centos build fix
Former-commit-id: 6fe4571bf959432127b8741c22d8264fd55969b8
2020-05-29 22:21:01 -04:00
John Sully 4e41517e9a sendFile blocks too long for use with active replication
Former-commit-id: 847654e90056029ed6bda9116bf9b69dbce411d5
2020-05-29 20:27:45 -04:00
John Sully 8e36c09f82 Unify beforeSleep handling
Former-commit-id: 5e875fde17729e271650d16a80c2caee0b5cf82a
2020-05-29 17:44:55 -04:00
John Sully 07f671b473 Cluster crash
Former-commit-id: 73c43940f6d3001da2e8142dc0abb75a0139dd12
2020-05-29 03:40:52 -04:00
John Sully 56c8b4e634 active replica tests on slow computers
Former-commit-id: ae90a2d9488ebdf724214b7f777ddee1efc66bb1
2020-05-29 01:58:15 -04:00
John Sully 306498cb25 Fix test issue with TLS
Former-commit-id: 0bc736b26f48f3a37071447437b024a84a2a5ab9
2020-05-29 01:44:52 -04:00
John Sully 11df226798 Fix CI
Former-commit-id: ed0acfa7b61acc472b5367499ed3856103c25af2
2020-05-29 01:01:41 -04:00
John Sully 53715eb3ca Merge tag '6.0.4' into unstable
Redis 6.0.4.


Former-commit-id: d1ec405f788ec72a9947b48536ec427b21331aba
2020-05-29 00:57:07 -04:00
John Sully 8b883573b3 Fix TLS tests
Former-commit-id: 0175d9ad64f01cc54290198bbced4c07ee1f7566
2020-05-29 00:16:06 -04:00
John Sully 577c6928bc gencert its own step
Former-commit-id: d2ecdb2d9c07bbecaa9bc19e785138df54d0c1ed
2020-05-28 23:49:13 -04:00
John Sully 404b968df5 CI yml syntax error
Former-commit-id: 62c46746b8b910931841e364f5336481aef8e7b8
2020-05-28 23:18:02 -04:00
John Sully d63f44cda8 Fix TLS tests in CI
Former-commit-id: a86d510dd53c7aa14ce87046a3b3f14e900fa674
2020-05-28 23:16:42 -04:00
John Sully f291a1f60f fix TLS test failure
Former-commit-id: b77726e0368e2edfc196c704fbd7a9ba5a795641
2020-05-28 23:16:27 -04:00
John Sully 82cb29b568 Test TLS as part of CI
Former-commit-id: a6ea18b691af1b66aebd56c7701f7481ee7798ee
2020-05-26 01:39:54 -04:00
John Sully 1df23823ac Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: f98c1999f95ec59f7201056781cb89dc465a1461
2020-05-26 01:38:52 -04:00
John Sully c902eb7b2a Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: f98c1999f95ec59f7201056781cb89dc465a1461
2020-05-26 01:38:52 -04:00
John Sully 66216a192f Complete TLS merge
Former-commit-id: 856d23023259d59ce766e9cd00526de0e7d06c2f
2020-05-26 01:38:29 -04:00
John Sully 771c8276b2 Complete TLS merge
Former-commit-id: 856d23023259d59ce766e9cd00526de0e7d06c2f
2020-05-26 01:38:29 -04:00
John Sully c4ed859dd3 Merge branch 'unstable' into keydbpro
Former-commit-id: b0636273806ce323627ce31c1ad7f86ceb39696d
2020-05-26 01:34:19 -04:00
John Sully e827de1fa4 Merge branch 'unstable' into keydbpro
Former-commit-id: b0636273806ce323627ce31c1ad7f86ceb39696d
2020-05-26 01:34:19 -04:00
John Sully b1c5cafd7a Merge branch 'unstable' of https://github.com/JohnSully/KeyDB into unstable
Former-commit-id: 6262faccbb21cf692e6f374146b6d18a5a1a1b0b
2020-05-26 01:29:08 -04:00
John Sully eca966ac91 Fix client tracking, also ensure tracking tests are enabled
Former-commit-id: a46756837de7d5cfa08490ef4cc403a023fb0641
2020-05-26 01:28:52 -04:00
Maxime de Roucy 4300f59229 acl: @replication command group
containing mandatory commands for replication (used by masteruser user)


Former-commit-id: a02047a8af3a082751ffd1f96f2f4ede8c4bc146
2020-05-25 02:35:22 -04:00
John Sully 70ed4fcefe Fix issue #170. Intermittent crash destroying fastlock due to implicit type conversion in assert
Former-commit-id: daa746d189042ab4ce6aec92b7b452e4e2cbb07f
2020-05-25 02:13:57 -04:00
John Sully cdf8525fff Fix infinite logs of Error in rreplay
Former-commit-id: c92ab531fb855e8471a5364b4252205dc1f406fe
2020-05-24 20:05:22 -04:00
John Sully 91412e92ac Enable TLS connections
Former-commit-id: 597c3def933ff3866aae0a88da27a6d9d39204ff
2020-05-24 19:57:16 -04:00
John Sully 830db06cf4 bump version
Former-commit-id: 9353b3aac2ab65120f2ad5caa2f8272ae02df380
2020-05-24 18:35:03 -04:00
John Sully 8066e3e18c bump version
Former-commit-id: 9353b3aac2ab65120f2ad5caa2f8272ae02df380
2020-05-24 18:35:03 -04:00
John Sully 00e6464ae8 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 056c672cf60a00980cb10e97fc5da93d8eada937
2020-05-24 18:34:15 -04:00
John Sully 9e34367a4e Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 056c672cf60a00980cb10e97fc5da93d8eada937
2020-05-24 18:34:15 -04:00
John Sully 558bd135b9 Fix test failures
Former-commit-id: c0b2263478d79f33d04ed409a68caa312884fa4c
2020-05-24 18:33:15 -04:00
John Sully 06d974f319 Fix test failures
Former-commit-id: c0b2263478d79f33d04ed409a68caa312884fa4c
2020-05-24 18:33:15 -04:00
John Sully 916e84cbf7 Fix crash on shutdown with snapshots pending
Former-commit-id: 124e79a81d6995ea7d5ba39d1830b591b705acbf
2020-05-24 17:11:56 -04:00
John Sully 95470886e4 Fix crash on shutdown with snapshots pending
Former-commit-id: 124e79a81d6995ea7d5ba39d1830b591b705acbf
2020-05-24 17:11:56 -04:00
John Sully 0718f2211f Merge branch 'keydbpro' of https://github.com/JohnSully/KeyDB-Pro into keydbpro
Former-commit-id: 9e473a9957f274f641ddad16d67d848f9a3c93c1
2020-05-24 14:47:55 -04:00
John Sully 375f73df98 Merge branch 'keydbpro' of https://github.com/JohnSully/KeyDB-Pro into keydbpro
Former-commit-id: 9e473a9957f274f641ddad16d67d848f9a3c93c1
2020-05-24 14:47:55 -04:00
John Sully 98c33c2c6f Merge branch 'unstable' into keydbpro
Former-commit-id: a830cf85df236885558c5571c0bf23cfb23e3655
2020-05-24 14:41:53 -04:00
John Sully 48c1bf668e Merge branch 'unstable' into keydbpro
Former-commit-id: a830cf85df236885558c5571c0bf23cfb23e3655
2020-05-24 14:41:53 -04:00
John Sully a6ec42c58c don't keep feeding data to clients pending close
Former-commit-id: ddb011dd67966c776220b9417d6b1679d8e76815
2020-05-24 12:46:11 -04:00
John Sully ae0892afd3 Quiet TSAN during exit
Former-commit-id: c8e3fed4dfaad5cf29bb7bd17e9cbcb97fed8cc5
2020-05-24 12:45:10 -04:00
John Sully 5a1479762a Install deps for daily workflow
Former-commit-id: 994cae03f4196c607218105c7ee6de39a1ed275c
2020-05-24 11:19:53 -04:00
John Sully f64d3c7540 Hold the AE lock until we process the repl backlog after a command
Former-commit-id: c6ffae7855b5924cca53ca2378f9913ae2cf96b5
2020-05-24 11:19:23 -04:00
John Sully 7e1cac3340 Add standardized way to post client dependent functions
Former-commit-id: 3326ed3a20885bd03cb5ff4b857bcc187d253f4c
2020-05-24 02:46:39 -04:00
John Sully 25cbc66702 remove unnecessary cplusplus guard
Former-commit-id: 3c7543239498a3029868a9d2ca9ad2bf2dea5135
2020-05-24 02:45:55 -04:00
John Sully d396fed0fd race in connection state when setting a handler on a different thread
Former-commit-id: 35db0819a4462a8109016d0623a0a25883e975d0
2020-05-24 02:45:11 -04:00
John Sully a3755302e3 Fix ASAN races
Former-commit-id: 21f52d4e0fb24c64e098ea362d7e51b9ce4cad54
2020-05-24 01:58:33 -04:00
John Sully 9509a69f25 Incorrect locking in replication error paths
Former-commit-id: 901ba07c49dfadfefbebc97ab9bfdfe5d4d7907f
2020-05-24 01:57:49 -04:00
John Sully aa6ba6ff69 Incorrect memory order on weak ordered architectures
Former-commit-id: 43160ac9533772e69fbe120049ae807a9fe84fa0
2020-05-24 01:57:18 -04:00
John Sully 5041b36f3f If we request shutdown from a client on a different thread than a blocking lua script we fail to actually shutdown until the script completes
Former-commit-id: 3daceb01cbac9e8cdb9bab95f65e359c1a4d0feb
2020-05-24 01:56:23 -04:00
John Sully d34ea78b53 race calculating client overhead
Former-commit-id: 6e6e49b723401ac3f4e28bf582141cc3a525e1fe
2020-05-24 01:53:43 -04:00
John Sully 41312cc823 During RDB load we can only handle clients on the main thread as our workers are not yet created. This change also unifies the accept logic across the socket types
Former-commit-id: ba245e55d2c65e1808bed30d1b43f17965ac7518
2020-05-23 16:03:24 -04:00
John Sully b320436c12 Diskless replication handler needs to run on the main thread
Former-commit-id: ed8a03ab7057eef4d00cd702ead5351078de8c5f
2020-05-23 15:15:42 -04:00
ShooterIT a36535c9ed Fix reply bytes calculation error
Fix #7275.


Former-commit-id: 4c69e0558a34a5e801d5dd3cf91995de400247ab
2020-05-23 13:02:55 -04:00
John Sully cfff87f2e5 Merge tag '6.0.3' into unstable
Redis 6.0.3


Former-commit-id: 04641264240afbbd13cab82e50293e1361419ef1
2020-05-22 16:53:10 -04:00
John Sully 97a50a5318 Merge branch 'unstable' of https://github.com/JohnSully/KeyDB into unstable
Former-commit-id: d8fe04ec6f50481e2695d42306972816b6cc301b
2020-05-22 16:45:27 -04:00
John Sully cee229889e Merge tag '6.0.2' into unstable
Redis 6.0.2


Former-commit-id: a0a5d39b417af1c1aa524f361c47879f4b629d35
2020-05-22 16:45:18 -04:00
John Sully 47fd00082f Merge commit '24075946c77f227b14ffdfde4b10d90a400d12fc' into unstable
Former-commit-id: 1639abe51f073f01bdcf7b1253691fae267791a5
2020-05-22 15:56:35 -04:00
John Sully f9dce8fb7f Merge commit '3843eb300d9da39dbb75d7c9f29d4948d305af8c' into unstable
Former-commit-id: c703897b509bd20aa4d169bf07736640bf093c12
2020-05-22 15:42:50 -04:00
John Sully 79d356e22c Merge commit '5133e970ccdd3495916681f39249fd551b3dd1a4' into unstable
Former-commit-id: a6e6114ffcedc55c36dab16e17b500d09ec4db70
2020-05-22 15:36:44 -04:00
John Sully 03720e5964 Update README.md
Former-commit-id: a6e371ba1b1083639d217919744314cdb1570c2f
2020-05-22 14:03:29 -04:00
John Sully f4323fdb41 Merge tag '6.0.1' into unstable
Redis 6.0.1.


Former-commit-id: 73aa8cb043af65190e2b6a8d9a4990408402bcda
2020-05-21 23:41:36 -04:00
John Sully 614cf01577 Missing noexcept
Former-commit-id: c291623210057bfcc8d58b587638ea37c51c3807
2020-05-21 23:25:50 -04:00
John Sully 96e582cfc9 build failure on macos
Former-commit-id: a71925ab51db0862fcc383150aaca6e5f46c00ed
2020-05-21 23:24:34 -04:00
John Sully 304fbcc206 Fix bad merge in CI.yml
Former-commit-id: 596b656df68eca7bac0aaaa2fbae71c2c47d3e7f
2020-05-21 22:09:06 -04:00
John Sully c61a414b4c Merge commit '97e58ee026675e70fbd8843f7a86e98f53a3c791' into unstable
Former-commit-id: b169f9f9c8a25370d88fcb1d82db8ab360e0a283
2020-05-21 19:37:42 -04:00
John Sully 6cfa757942 Merge commit '3b373fbb0b05ee862dfef32199cfb63459019cd9' into unstable
Former-commit-id: 6f9f4c4aac55c885d7170892e2b90410b7ed32a0
2020-05-21 18:57:28 -04:00
John Sully 9cbe9da4ba Merge commit 'd7b07d3ded06b4cd843baffd3a6d33dd96efd401' into unstable
Former-commit-id: b21357ca23e56a3f90b01f97239ff932d1563f0e
2020-05-21 18:48:49 -04:00
John Sully 4506be6991 Merge commit '87924d673138531cbaf606015ea7b6a9e3ae2465' into unstable
Former-commit-id: b6eb4034ed1ecbe0f7e7986dc52583847d892a10
2020-05-21 17:55:09 -04:00
John Sully 56052c2595 Merge commit 'c5d805f87771581d3f6b29861ed2062c0ae2a688' into unstable
Former-commit-id: 36a1e6ad2d9917c4676f53f3dc033da10e778f83
2020-05-21 17:45:15 -04:00
John Sully babad00e4c Merge commit '7cb94fd6cc9e1ad106964171023457ae3ff0a40b' into unstable
Former-commit-id: d9b2fdb179ee1fdc8fc48a45b2e1c12e372519d0
2020-05-21 17:36:53 -04:00
John Sully 48d92c534c Merge commit '71134e357ffd6ced7c40c145205dbbac173ee181' into unstable
Former-commit-id: 4908da605355f0ada0bb605dc5a5fb8753d4749e
2020-05-21 17:32:53 -04:00
John Sully a43431de7f Merge commit '2535a172c1247d5d32d6f2fefe51b95c27ba8ae1' into unstable
Former-commit-id: ecef43431db59899d1267e69786c347eba7aefd4
2020-05-21 17:30:56 -04:00
John Sully 5a9415ace8 Override missing new, fix new/delete mismatch
Former-commit-id: 9b9d9a72aaf24abe41937efdefb547b4bff7729f
2020-05-20 15:57:08 -04:00
John Sully e807fc470a Remove debugging logs
Former-commit-id: 348fc2c393a7dd786df2a624dba04da157224c7e
2020-05-14 22:18:29 -04:00
John Sully 864fbf8f94 Update ci.yml
Former-commit-id: d4b1d3f755f7c1f6ca4642b5258b4a5157eacb5a
2020-05-12 01:06:08 -04:00
John Sully 330f3dbec0 Update ci.yml
Former-commit-id: d4b1d3f755f7c1f6ca4642b5258b4a5157eacb5a
2020-05-12 01:06:08 -04:00
John Sully ebd82f40fa Update ci.yml
Former-commit-id: d06c6c67ea36a21e515390405a0f947a23ec4b42
2020-05-11 22:09:27 -04:00
John Sully 39bd16dabf Update ci.yml
Former-commit-id: d06c6c67ea36a21e515390405a0f947a23ec4b42
2020-05-11 22:09:27 -04:00
John Sully 15e949d48d Reduce test load for more reliability
Former-commit-id: 3f8f9743c1f6d75647cfbdbc1544a8c8a5142df3
2020-05-11 22:04:52 -04:00
John Sully c1513fd613 Reduce test load for more reliability
Former-commit-id: 3f8f9743c1f6d75647cfbdbc1544a8c8a5142df3
2020-05-11 22:04:52 -04:00
John Sully 5eed12bcd8 limit clients to make tests more reliable
Former-commit-id: 2c130a816647bacaba5d99d76c19e09b9c9875da
2020-05-11 21:56:17 -04:00
John Sully 94a8fd063b limit clients to make tests more reliable
Former-commit-id: 2c130a816647bacaba5d99d76c19e09b9c9875da
2020-05-11 21:56:17 -04:00
John Sully fe40aece72 Update cached time only in main cron
Former-commit-id: 5396dd9587599d6672e8d80967aa1fd8ba16e7ec
2020-05-11 20:31:47 -04:00
John Sully 98cc027dbc Update cached time only in main cron
Former-commit-id: 5396dd9587599d6672e8d80967aa1fd8ba16e7ec
2020-05-11 20:31:47 -04:00
John 46cee0c132 more reliability fixes for multimaster
Former-commit-id: 325788b4fbc2828e6563e672ee63ecb7ca987e3e
2020-05-11 05:38:21 -04:00
John 5298a16322 more reliability fixes for multimaster
Former-commit-id: fd5b541260908423c35227ff9e42a83f96ace6c0
2020-05-11 09:37:42 +00:00
John acc542aec5 more reliability fixes for multimaster
Former-commit-id: fd5b541260908423c35227ff9e42a83f96ace6c0
2020-05-11 09:37:42 +00:00
John e95e40a4c4 Make multimaster tests more reliable
Former-commit-id: f94610dc8415c29265720717bd65484de7b3d069
2020-05-11 05:23:47 -04:00
John 7c8b569e64 Make multimaster tests more reliable
Former-commit-id: 4fe59ba11b720864ea0124885b358cb72127cc2d
2020-05-11 09:22:27 +00:00
John a4036b6c5d Make multimaster tests more reliable
Former-commit-id: 4fe59ba11b720864ea0124885b358cb72127cc2d
2020-05-11 09:22:27 +00:00
John Sully 82be99183a too many clients makes tests unreliable
Former-commit-id: 89b39629980ab3e2930663c2922141e18e2fc38c
2020-05-11 04:54:17 -04:00
John Sully bc9b7604c4 too many clients makes tests unreliable
Former-commit-id: 89b39629980ab3e2930663c2922141e18e2fc38c
2020-05-11 04:54:17 -04:00
John f291a39faf Run tests with more clients if possible
Former-commit-id: 3c73eb41bd904953c1e0e2d655d42599f3e9d2a2
2020-05-11 08:25:13 +00:00
John 03c9a6811e Run tests with more clients if possible
Former-commit-id: 3c73eb41bd904953c1e0e2d655d42599f3e9d2a2
2020-05-11 08:25:13 +00:00
John 140ffc8084 link dependent libs
Former-commit-id: 165eb203f2a64f588b42b765afaafc370c547a25
2020-05-11 08:19:08 +00:00
John 64368aa40d link dependent libs
Former-commit-id: 165eb203f2a64f588b42b765afaafc370c547a25
2020-05-11 08:19:08 +00:00
John Sully c0994a2a37 run on self hosted
Former-commit-id: 51dba847764abc0014ef3be17a03afebd038854d
2020-05-11 03:10:27 -04:00
John Sully 6aa8299cb1 run on self hosted
Former-commit-id: 51dba847764abc0014ef3be17a03afebd038854d
2020-05-11 03:10:27 -04:00
John Sully 0a11773628 update ci.yml
Former-commit-id: 92a31cfd4d5bcf913f55c0f127b28738056f2a0a
2020-05-11 01:08:46 -04:00
John Sully 8cc2badef9 update ci.yml
Former-commit-id: 92a31cfd4d5bcf913f55c0f127b28738056f2a0a
2020-05-11 01:08:46 -04:00
John Sully 5e4b122907 Fix bug merging LFU fix
Former-commit-id: 319099e1cb337d13444c16df1b5e1c300e6f2d15
2020-05-11 01:05:57 -04:00
John Sully 4cb253da0d Fix bug merging LFU fix
Former-commit-id: 319099e1cb337d13444c16df1b5e1c300e6f2d15
2020-05-11 01:05:57 -04:00
John Sully 5c0cc1468c Fix crash during RDB save with module events
Former-commit-id: 0f7eac411eccb853d7e50152e2bbd1ee28e6ee53
2020-05-11 01:02:58 -04:00
John Sully 1ab1557e4f Fix crash during RDB save with module events
Former-commit-id: 0f7eac411eccb853d7e50152e2bbd1ee28e6ee53
2020-05-11 01:02:58 -04:00
John Sully c837f30edb Merge branch 'unstable' into keydbpro
Former-commit-id: d89c15518f984c1d4d4e7638a4e8ac5aa499632a
2020-05-11 00:53:38 -04:00
John Sully effddf64e1 Merge branch 'unstable' into keydbpro
Former-commit-id: d89c15518f984c1d4d4e7638a4e8ac5aa499632a
2020-05-11 00:53:38 -04:00
John Sully a6df8d14db Update access LFU/LRU access times when overwriting key
Former-commit-id: b79dbfd5c6d4f4763f88d9ab0cf1d2a025d3bd34
2020-05-11 00:42:46 -04:00
John Sully 992600fe2f We should still send replies even if an async close is pending
Former-commit-id: f41f9c9fe617f2e6965a8ec9f9eef00da2ea2d58
2020-05-10 23:56:29 -04:00
John Sully c1336af53e Fix race on clients_to_close
Former-commit-id: c6845033bf830e87a94cb0e04427941daf13e89e
2020-05-10 23:14:15 -04:00
John Sully 05e5cbf710 Fix crash in client unblock command
Former-commit-id: a454af96334b318512df92535a01231416684f29
2020-05-10 22:08:50 -04:00
John Sully d0e0752c7c Fix crash during hook module test
Former-commit-id: 182d64458b52ae181df5ac1f277999136ad4999a
2020-05-10 21:57:16 -04:00
John Sully d7ce80c757 Fix crash in module tests
Former-commit-id: b8aea13c4853032d0a8345e17c526927a60a3796
2020-05-10 21:06:38 -04:00
John Sully 2e2e46bbc9 Run sentinel and module tests under CI
Former-commit-id: 156424fd8d9cceb5e5da877e74150d8c7b9ca373
2020-05-10 18:05:05 -04:00
John Sully a5231ab0d6 add help for hrename
Former-commit-id: f1da950a06ab52468be576dc48a9c5536fc63d36
2020-05-10 17:41:01 -04:00
John Sully 84d5e33d88 hrename tests
Former-commit-id: 3eb75f46c8046dda64be3c8dc6da4a342936139e
2020-05-10 17:14:44 -04:00
John Sully b17c47bc08 Implement keydb.hrename command
Former-commit-id: 971b2e373ec349fec0c9fbfa73a1c96ee426c127
2020-05-10 17:04:22 -04:00
John Sully e74b4d6d92 Work around broken package installed on CI machines
Former-commit-id: 3340aaf8ad87fe0f7dd5c53254cd34605a3a8f12
2020-05-08 00:57:39 -04:00
John Sully ed78a6adbe Work around broken package installed on CI machines
Former-commit-id: 3340aaf8ad87fe0f7dd5c53254cd34605a3a8f12
2020-05-08 00:57:39 -04:00
John Sully 785a6e704a Update CI
Former-commit-id: 332900e24a539c694929dd4163a25037ded6b19e
2020-05-08 00:44:00 -04:00
John Sully 446b22bb55 Update CI
Former-commit-id: 332900e24a539c694929dd4163a25037ded6b19e
2020-05-08 00:44:00 -04:00
John Sully ad84e4095e Bump version
Former-commit-id: 88eeb1c13cdf21df274ea9c364f35c4de522d215
2020-05-08 00:25:19 -04:00
John Sully b0d30ebc88 Bump version
Former-commit-id: 88eeb1c13cdf21df274ea9c364f35c4de522d215
2020-05-08 00:25:19 -04:00
John Sully 9d6133e010 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 219d7f3499fd826f039a1490ed3317791b084f94
2020-05-08 00:24:58 -04:00
John Sully 3579abea85 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 219d7f3499fd826f039a1490ed3317791b084f94
2020-05-08 00:24:58 -04:00
John Sully f16e51683a Free memory before we enter a script and may not have a chance
Former-commit-id: 7a3173c74ca617b4d0f9e852ab580731fa92f3df
2020-05-08 00:15:58 -04:00
John Sully c89a08b8ae Free memory before we enter a script and may not have a chance
Former-commit-id: 7a3173c74ca617b4d0f9e852ab580731fa92f3df
2020-05-08 00:15:58 -04:00
John Sully f30f6ea03b Fix bug where we don't correctly process maxmemory during bgsave
Former-commit-id: a0f2694d15784628df5d5ecb72b42c2979100f93
2020-05-08 00:14:55 -04:00
John Sully 20d5dfde38 Fix bug where we don't correctly process maxmemory during bgsave
Former-commit-id: a0f2694d15784628df5d5ecb72b42c2979100f93
2020-05-08 00:14:55 -04:00
John Sully 5bc90defc9 Be *much* more aggressive flushing memory
Former-commit-id: f0bdc4fb5fce02d79c1aa2bcf384aa06580ff9e1
2020-05-07 23:07:31 -04:00
John Sully 92f2463179 Be *much* more aggressive flushing memory
Former-commit-id: f0bdc4fb5fce02d79c1aa2bcf384aa06580ff9e1
2020-05-07 23:07:31 -04:00
John Sully 919fedefe6 Disable cluster tests
They are unreliable on slow hardware.

Former-commit-id: 4345708b9cc7de82fb7cba150ac80861b137e7f2
2020-05-07 01:49:04 -04:00
Diab Neiroukh d76c99c755 Clang requires libatomic to be linked via LDFLAGS
Clang requires the libatomic to be linked via LDFLAGS or else the linker
will fail to recognise __atomic macros.

An error as a result of not passing -latomic to the linker can be seen
below:

ld.lld: error: undefined symbol: __atomic_fetch_add_2
>>> referenced by sds.c:185
>>>               lto.tmp:(sdsdupshared)
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [Makefile:276: keydb-server] Error 1
Former-commit-id: 1bae3f301135367142df3e3939f481ac91eae16b
2020-04-30 15:06:10 -04:00
John Sully 70217d27a6 cluster tests should be a named task
Former-commit-id: dc6290420b4f145f6af05d64590ad56c4799a051
2020-04-29 18:43:55 -04:00
John Sully ae1c2c42db Run cluster tests as part of CI
Former-commit-id: 7e503b3d4d588174010d2c908250b84f7827b2eb
2020-04-29 18:41:51 -04:00
John Sully f785c3bd64 use serverAssert() instead of assert() to get callstacks in fastlock
Former-commit-id: c33ddc059785b2000b9ea5f08711e177a3fc2e0e
2020-04-28 22:41:07 -04:00
John Sully 1d9510a36b Merge branch 'unstable' of https://github.com/JohnSully/KeyDB into unstable
Former-commit-id: c7b288babfc87748b4c5381460fcd676822da4f6
2020-04-28 22:24:45 -04:00
John Sully db2a564c23 Bump version
Former-commit-id: 8e12ff0cd9e50867b42b165af278a7dc91fc17e1
2020-04-28 20:49:39 -04:00
John Sully e52cbad238 Bump version
Former-commit-id: 8e12ff0cd9e50867b42b165af278a7dc91fc17e1
2020-04-28 20:49:39 -04:00
John Sully e0f6b4fcff Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 6e7ffcddfbde8ee310e07b510097b69104f862b8
2020-04-28 20:48:54 -04:00
John Sully 65fcf3b204 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 6e7ffcddfbde8ee310e07b510097b69104f862b8
2020-04-28 20:48:54 -04:00
John Sully c7635f9872 Fix failure to count keys in cluster slots when reloading a FLASH database
Former-commit-id: f6dd863e51f91620f184ff80f08cfe518d29c87f
2020-04-28 20:48:46 -04:00
John Sully bca2c18ff8 Fix failure to count keys in cluster slots when reloading a FLASH database
Former-commit-id: f6dd863e51f91620f184ff80f08cfe518d29c87f
2020-04-28 20:48:46 -04:00
John Sully 599b9cee62 shared pointer comparisons with other pointers
Former-commit-id: e122d036a9ccf5066215ee0bcb04c6f0fad4a6f9
2020-04-24 22:20:26 -04:00
John Sully 8db7c58ef3 EMBSTR size is lower than it needs to be
Former-commit-id: f88dbf66c76e7dfbd49d258ee6e0a8a399639fcf
2020-04-24 22:19:55 -04:00
John Sully 701a5c58c5 Default yes in apt install
Former-commit-id: e399aaeaaaac6d87af81fda4a634f42fe137218d
2020-04-22 02:17:28 -04:00
John Sully fadeb7defb Run arm CI builds
Former-commit-id: 2222db8fe10c7d7b60fe3b962bf2e14cb57a4426
2020-04-22 02:13:02 -04:00
John Sully 331369ffac MacOS Build Break Fix
Former-commit-id: d763e2cf7120dfb6330245569faf12ae9e9a4ce7
2020-04-22 01:21:35 -04:00
John Sully a9a7049444 Add deps to CI yml
Former-commit-id: 29d9fba802a24ba3e29bf5a66ab684c7d9d0959a
2020-04-22 01:11:06 -04:00
John Sully f5ee69dcc3 Add deps to CI yml
Former-commit-id: 29d9fba802a24ba3e29bf5a66ab684c7d9d0959a
2020-04-22 01:11:06 -04:00
John Sully 910762a3b7 Bump version
Former-commit-id: f527649f156147f29efb81a7a20057909fe43748
2020-04-22 01:07:14 -04:00
John Sully 69c3cc4172 Bump version
Former-commit-id: f527649f156147f29efb81a7a20057909fe43748
2020-04-22 01:07:14 -04:00
John Sully cc1a33583d Merge branch 'PRO_RELEASE_6' of https://github.com/JohnSully/KeyDB-Pro into PRO_RELEASE_6
Former-commit-id: 859540b68c54f86f97c33c87802d8c3e74437325
2020-04-22 01:06:43 -04:00
John Sully b4edee06a4 Merge branch 'PRO_RELEASE_6' of https://github.com/JohnSully/KeyDB-Pro into PRO_RELEASE_6
Former-commit-id: 859540b68c54f86f97c33c87802d8c3e74437325
2020-04-22 01:06:43 -04:00
John Sully 3a84b29434 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 6b6a1c711dbb7786e30be29e2d1930582037f7f9
2020-04-22 01:06:24 -04:00
John Sully f178aaae80 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 6b6a1c711dbb7786e30be29e2d1930582037f7f9
2020-04-22 01:06:24 -04:00
John Sully 0fce4240c5 Merge branch 'keydbpro' of https://github.com/JohnSully/KeyDB-Pro into keydbpro
Former-commit-id: 9004ecf11e31be1b0d43a0d8c6e8263636b3bac4
2020-04-22 01:06:06 -04:00
John Sully 343eb0b9b8 Merge branch 'keydbpro' of https://github.com/JohnSully/KeyDB-Pro into keydbpro
Former-commit-id: 9004ecf11e31be1b0d43a0d8c6e8263636b3bac4
2020-04-22 01:06:06 -04:00
John Sully e49628c373 Don't CI build Pro on MacOS
Former-commit-id: aaed87516ea9f428ebea286dd936dd219691b4f6
2020-04-22 01:05:24 -04:00
John Sully 5accc03018 Don't CI build Pro on MacOS
Former-commit-id: aaed87516ea9f428ebea286dd936dd219691b4f6
2020-04-22 01:05:24 -04:00
John Sully 7c293a7226 Don't show trial warning on license disabled builds
Former-commit-id: 08fd74360d1e0196db7a6b52717500325533576c
2020-04-22 01:04:29 -04:00
John Sully a8d42607db Don't show trial warning on license disabled builds
Former-commit-id: 08fd74360d1e0196db7a6b52717500325533576c
2020-04-22 01:04:29 -04:00
John Sully a1ac2a34ce Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 8ff5c0baef1d7ec8f225c3e115f37731e4ee8593
2020-04-22 00:56:43 -04:00
John Sully cd81b7aa09 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 8ff5c0baef1d7ec8f225c3e115f37731e4ee8593
2020-04-22 00:56:43 -04:00
John Sully c618586588 CI syntax error fix
Former-commit-id: 0845620384c08a3f937655931775a20728b19526
2020-04-22 00:55:31 -04:00
John Sully f0e62a1bfa CI syntax error fix
Former-commit-id: 0845620384c08a3f937655931775a20728b19526
2020-04-22 00:55:31 -04:00
John Sully fb8e58b9bd CI enable submodules
Former-commit-id: f57611e82fa7a63bd554568748338e8a116534b5
2020-04-22 00:53:31 -04:00
John Sully dc5d289ac6 CI enable submodules
Former-commit-id: f57611e82fa7a63bd554568748338e8a116534b5
2020-04-22 00:53:31 -04:00
John Sully 7f2c40e6b4 RDB load performance, eliminate useless reads
Former-commit-id: 68e5d1850dbba89a87710968d314cb8c0d3cb562
2020-04-22 00:47:49 -04:00
John Sully d62d5972b6 RDB load performance, eliminate useless reads
Former-commit-id: 68e5d1850dbba89a87710968d314cb8c0d3cb562
2020-04-22 00:47:49 -04:00
John Sully ac014e4503 Be more aggressive evicting when a storage provider is set
Former-commit-id: 4d1cabe2ab383939670e5ff0a2b91aa758f4e15e
2020-04-22 00:47:24 -04:00
John Sully 93970e91cf Be more aggressive evicting when a storage provider is set
Former-commit-id: 4d1cabe2ab383939670e5ff0a2b91aa758f4e15e
2020-04-22 00:47:24 -04:00
John Sully 703d69df53 Periodically FLASH flush write queues during RDB load
Former-commit-id: 721129b18263eabfc2a29556a2b7a9a861110953
2020-04-21 21:39:36 -04:00
John Sully d9381e27b8 Periodically FLASH flush write queues during RDB load
Former-commit-id: 721129b18263eabfc2a29556a2b7a9a861110953
2020-04-21 21:39:36 -04:00
John Sully 501cf1b5c3 don't swap iterators when swapping DB contents
Former-commit-id: 4971518d42218a63cf86919e91af54462f6dc8c0
2020-04-21 21:38:24 -04:00
John Sully 6d5c172ee3 don't swap iterators when swapping DB contents
Former-commit-id: 4971518d42218a63cf86919e91af54462f6dc8c0
2020-04-21 21:38:24 -04:00
John Sully 1a3e524e97 Merge branch 'unstable' of https://github.com/JohnSully/KeyDB into unstable
Former-commit-id: e3fa69e2e5c816408deee3e4e317d0546aa0245c
2020-04-16 20:12:14 -04:00
John Sully f892c5b698 Fix some clang warnings
Former-commit-id: 0f02a6d740a2a776ba73c9d00f3f5229a396e5fe
2020-04-16 20:12:05 -04:00
John Sully 18e926de94 Always link libatomic
Former-commit-id: 982e9a8a7b0971b00d4f384ffe8339ad4301f977
2020-04-16 20:01:24 -04:00
John Sully 1abce5e8bc Fix warning in cluster.cpp
Former-commit-id: 0de0b0707c4c248f0c2712aabce58d2a28616eee
2020-04-16 20:01:13 -04:00
John Sully 4b11e80a2d Merge branch 'unstable' into keydbpro
Former-commit-id: 642719cef20a88d23af84a16d3f6757088c23b1a
2020-04-16 17:06:33 -04:00
John Sully 67f7e9a97e Merge branch 'unstable' into keydbpro
Former-commit-id: 642719cef20a88d23af84a16d3f6757088c23b1a
2020-04-16 17:06:33 -04:00
John Sully 310018aba0 quiet TSAN in serverLog
Former-commit-id: ecff16adda1f5317643ad268ead850c61be14556
2020-04-16 17:06:25 -04:00
John Sully a20caa5735 Initial merge of unstable 6
Former-commit-id: aac140de199646914cc02997a45111c9c695e55d
2020-04-16 16:36:16 -04:00
John Sully 4c34a9b7d4 Initial merge of unstable 6
Former-commit-id: aac140de199646914cc02997a45111c9c695e55d
2020-04-16 16:36:16 -04:00
John Sully fee6e70fd0 Update Readme to use github CI badge
Former-commit-id: 733f1e29654b1a856d6026b5719ea13b31fe8e58
2020-04-15 23:21:10 -04:00
John Sully 6942f6b317 update TLS readme for KeyDB
Former-commit-id: f61de948df0c460b0c06a950303dca776cabfd97
2020-04-15 23:19:05 -04:00
John Sully 70fd085442 Deprecate travis and finish setting up github CI
Former-commit-id: 78996fa03cf544655403d8cf628dc05712f5d8e2
2020-04-15 23:04:04 -04:00
John Sully 7197db2a95 Merge branch 'unstable' into redis_6_merge
Former-commit-id: 08ae82da4e6e43e3348e5abf1e9ea6353b741989
2020-04-15 23:00:13 -04:00
Ubuntu 4008ecad23 updating version
Former-commit-id: f994436486b2e8b4eb63f8ce29ab9c8595e1a694
2020-04-16 02:56:49 +00:00
Ubuntu a8934daba7 updating version
Former-commit-id: f994436486b2e8b4eb63f8ce29ab9c8595e1a694
2020-04-16 02:56:49 +00:00
John Sully adb3af3da8 OS X build break
Former-commit-id: 1b8dfed8871c4cb37cf0470dc321654db52060a9
2020-04-15 22:43:40 -04:00
John Sully 570f9769db more dependencies for CI
Former-commit-id: 8ae6204dbd7446aa1eaa58ebc6e57effb9709ec7
2020-04-15 22:39:47 -04:00
John Sully 11e3973260 Add CI dependency
Former-commit-id: 98f0ebf5be8060a5aa7c1d42d8a5e3e610819715
2020-04-15 22:36:16 -04:00
John Sully f503c5a745 During AOF reload we can erroneously read incorrect aof_state values, so this variable must be read with the global lock acquired
Former-commit-id: 67d46f50ab748afdc15382fa211fef3a6ef0115e
2020-04-15 22:30:19 -04:00
John Sully c9d77fad6c Quiet test only ASAN fd race
Former-commit-id: a985fd90d4c5b6d5be5154b4b250224d2ec510ba
2020-04-15 22:27:45 -04:00
John Sully cb9756e085 Run all KeyDB instances in testmode during tests
Former-commit-id: c07b5524fb927dd558287c839b86f216bf791ac1
2020-04-15 22:27:04 -04:00
John Sully f85243553b Fix race in sendBulk
Former-commit-id: 5d7cfcfffd354a28e17c7aa5aca35d5e16588f1b
2020-04-15 22:26:00 -04:00
John Sully 9392d20165 Convert variables accessed outside lock to atomics
Former-commit-id: f0938073b59844f2ed5da0054801fb4f8c68b863
2020-04-15 22:25:17 -04:00
John Sully 1e31671a0b ASAN races in leak checker
Former-commit-id: aa4c1157b6bcf385f8766b80ba1914d74b484e85
2020-04-15 22:24:12 -04:00
John Sully 9e1ae7e7aa Multithreading reliability, force single thread for test relying on internal behavior
Former-commit-id: ce5dfd1e944f43f95a740a390f2b513dd149a0db
2020-04-15 20:52:25 -04:00
John Sully 2682b7bbd2 rename to KeyDB (merge)
Former-commit-id: a5c6b565ca2e76d04b8c02b3c929df50c4128792
2020-04-15 16:44:06 -04:00
John Sully 9aca25be21 Log stdout and stderr for cluster tests
Former-commit-id: eb7a75f6985f1fd47620eecbbfcc93d6f61258d0
2020-04-15 16:35:24 -04:00
John Sully 856f85df7e Fix TSAN race
Former-commit-id: 9d1e489e83268b887ab2f417cf09a800dfc58f5b
2020-04-15 16:34:38 -04:00
John Sully 1f9e811344 Fix incorrect cluster slot tracking (regression from merge)
Former-commit-id: 21205779282301958849b3fdb98b0f7cfed3867b
2020-04-15 16:34:07 -04:00
John Sully 5d1465f4c1 Merge tag '6.0-rc3' into redis_6_merge
Redis 6.0 RC3.


Former-commit-id: 0ebb1956eca0cc6797dd2e3fdf1f79e068ace701
2020-04-14 22:56:19 -04:00
John Sully 4286104b63 Fix merge issues and move timeout to C++
Former-commit-id: 45c4245eb81bf1539007c05cbf117006423793d6
2020-04-14 22:37:26 -04:00
John Sully addfa273ac Merge commit '2a820251c8ffba152e00ef7b1ca5e7a477087d33' into redis_6_merge
Former-commit-id: 95f3a79b8b87aa99094b182a0e4aa5f1605da5e9
2020-04-14 22:25:44 -04:00
John Sully 141d060729 Merge commit '454e12cb8961f21c9dd8502dc82ae6ffd7e22fe0' into redis_6_merge
Former-commit-id: b2ca29453b61c10c03f2c405ffa221b2eb9e2716
2020-04-14 22:19:29 -04:00
John Sully 3ac4fa36a9 Merge commit '714ae38ee1fc260df6fc5708463accd74a93c215' into redis_6_merge
Former-commit-id: 2aec8a1bb2a2fe3e867c054628feaedb2a0bfbca
2020-04-14 21:26:51 -04:00
John Sully 4d45697d99 Merge commit 'd3491c5182b97535cfdf2c3d4f9d0762c608e1ff' into redis_6_merge
Former-commit-id: 6306b4730bee3524f1f4e524f1ccbdd07350d431
2020-04-14 21:16:38 -04:00
John Sully 509f5c2d90 Merge commit '07c75f60f3fe0b300fd7913bab3d2d7e612afb03' into redis_6_merge
Former-commit-id: 10187865f710fc9a381a5ae11d27369909362e53
2020-04-14 21:13:42 -04:00
John Sully ffc006d322 Merge commit 'c609bf3f2c7f0982f632f82623ee4802868b8ef1' into redis_6_merge
Former-commit-id: e9eeee2780d7af8d983c489fcbbe758b4f613b65
2020-04-14 21:04:42 -04:00
John Sully 5ba73dfbc5 Merge commit 'c208956fbe077e8249d2965dec2ea1b9b7588d6d' into redis_6_merge
Former-commit-id: 3ff9428f2b10cd98df8ce751a81119f6beff2c42
2020-04-14 20:55:29 -04:00
John Sully 5b446c8a05 Merge commit '00e53fb140fb67d329aff6cd2200f1eaf9e80cf5' into redis_6_merge
Former-commit-id: e4656724b7bda4e242a8614e810b347bca524e60
2020-04-14 20:44:27 -04:00
John Sully 0046a5625b Merge commit 'e91ca9fee9c56ef319b407b104afc435be0c53cb' into redis_6_merge
Former-commit-id: 01bc534c56416f6a7b109bc38a97e108015729d8
2020-04-14 20:42:48 -04:00
John Sully f9cf6c1060 Merge commit '6718d5d37517bd927635649708913affb98f67c9' into redis_6_merge
Former-commit-id: 315e4ec2bb0f18ce72973f6f80f6fc638c547284
2020-04-14 20:19:48 -04:00
John Sully f747c84bd4 Merge commit '79e8b17d7b44c793d8b22668b8583a297ee1b387' into redis_6_merge
Former-commit-id: b718dd6aef175d4a1f046ca761e7dfde294eba1d
2020-04-14 20:09:53 -04:00
John Sully 8fbe6a68dd Merge commit '13fbdf970660b15011c4312f31137e58bbda5b2c' into redis_6_merge
Former-commit-id: e919dc40ba5e77f2413923bcf18d7c62a18c6cc1
2020-04-14 19:43:04 -04:00
John Sully 3a4ce7fdb4 Merge commit 'a8e2bbe8f6a3f4833f286cc5049e6b52c87de1a9' into redis_6_merge
Former-commit-id: 84ffc4de4feea69d934f741502e0f51821800246
2020-04-14 19:22:44 -04:00
John Sully 923f772e52 Merge commit '491949ee5bf4ffbfc746ea4ed5a6d673b0e2fb81' into redis_6_merge
Former-commit-id: 98bf4812570727290d1c16153c79c1bbcd548258
2020-04-14 18:44:42 -04:00
John Sully e2a19693b8 Merge commit '2ad427f862084e0e18fbd6c313af35ccdb6c68f7' into redis_6_merge
Former-commit-id: 2f6e9f3f34cb97f3dae524f7403c46865ea148d0
2020-04-14 18:30:26 -04:00
John Sully f39d16a664 Merge commit '9a39a227fff45baa0f1532dba017f31ac71b68e5' into redis_6_merge
Former-commit-id: 76d51d9aa5eee874a8683bc57af23c0cc661820c
2020-04-14 18:29:03 -04:00
John Sully 2370756fb9 Merge commit 'dff5370c8be0dcef1728b95b17906d2494ce9bf2' into redis_6_merge
Former-commit-id: 0d7b8297b597b7acdca596e465ea88430f6f22be
2020-04-14 18:05:10 -04:00
John Sully 96f93355f8 Merge commit '87d059a7454aad2c3a9810ddafd33c3a9e4be383' into redis_6_merge
Former-commit-id: 2d8538780b7eaaaac44e445b946d9e740009e589
2020-04-14 18:04:51 -04:00
antirez 6d86fc09db Jump to right label on AOF parsing error.
Related to #6054.


Former-commit-id: cb29dc0c3518f78258bf5470f4615d3e403835a9
2020-04-14 18:03:22 -04:00
antirez 22db8c7f4f PSYNC2: meaningful offset implemented.
A very commonly signaled operational problem with Redis master-replicas
sets is that, once the master becomes unavailable for some reason,
especially because of network problems, many times it wont be able to
perform a partial resynchronization with the new master, once it rejoins
the partition, for the following reason:

1. The master becomes isolated, however it keeps sending PINGs to the
replicas. Such PINGs will never be received since the link connection is
actually already severed.
2. On the other side, one of the replicas will turn into the new master,
setting its secondary replication ID offset to the one of the last
command received from the old master: this offset will not include the
PINGs sent by the master once the link was already disconnected.
3. When the master rejoins the partion and is turned into a replica, its
offset will be too advanced because of the PINGs, so a PSYNC will fail,
and a full synchronization will be required.

Related to issue #7002 and other discussion we had in the past around
this problem.


Former-commit-id: 1f81a9bfddac312f9a883344f02167f3caa50ba4
2020-04-14 17:56:09 -04:00
Oran Agra 23af0fda33 reduce repeated calls to use_diskless_load
this function possibly iterates on the module list


Former-commit-id: 76b379bc103bfc4e124bbf46f667836d1ada6cf0
2020-04-14 17:34:36 -04:00
John Sully 48505d6fcc Fix merge conflicts from cherry-pick
Former-commit-id: a5634bfea02691ffb2f133572cd40cf1a087c56f
2020-04-14 17:33:54 -04:00
antirez d3892f6cd3 Remove RDB files used for replication in persistence-less instances.
Former-commit-id: 322b608f5ae2ef87a6553e44c42704dde2ec0006
2020-04-14 17:27:05 -04:00
Johannes Truschnigg ca657398e8 Signal systemd readiness atfer Partial Resync
"Partial Resynchronization" is a special variant of replication success
that we have to tell systemd about if it is managing redis-server via a
Type=Notify service unit.


Former-commit-id: 2132afe898d94143175a9c49e5f11b48bca2f8a6
2020-04-14 17:22:30 -04:00
Guy Benoish 9169b04b4d Diskless-load emptyDb-related fixes
1. Call emptyDb even in case of diskless-load: We want modules
   to get the same FLUSHDB event as disk-based replication.
2. Do not fire any module events when flushing the backups array.
3. Delete redundant call to signalFlushedDb (Called from emptyDb).


Former-commit-id: e18003ee20e9eb0b5d5a0d35834213da3da541cb
2020-04-14 17:21:10 -04:00
John Sully 489f8c9e48 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 1dd55bec28e7bba38ff9fbd7c6b22b23b911a4eb
2020-04-14 01:01:20 -04:00
John Sully 433a990fc7 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 1dd55bec28e7bba38ff9fbd7c6b22b23b911a4eb
2020-04-14 01:01:20 -04:00
John Sully 47cb2d2f5b Cache fake client in replicaFeedSlaves
Former-commit-id: e4da31f5e23ccb5132faa067ea1939db9fcd47b8
2020-04-13 22:45:15 -04:00
John Sully 807e3832cb Don't do active replica work if we're not an active replica
Former-commit-id: d6fe0d9f48b38d48e3cde71e855285836f12427e
2020-04-13 22:35:06 -04:00
John Sully 49db3652bd Optimize replicaFeedSlaves by removing use of snprintf
Former-commit-id: c5fabc3a69e7d61e995aa918400bfeef47f1990c
2020-04-13 22:11:34 -04:00
John Sully fb2e772e30 Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: 8d8115ff59f5838e13e911416eff7dfe2c0d92dc
2020-04-06 01:25:15 -04:00
John Sully c49689a53d Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: 8d8115ff59f5838e13e911416eff7dfe2c0d92dc
2020-04-06 01:25:15 -04:00
John Sully 6c24e34de5 Fix failure to AUTH with master when masterauth is set last
Former-commit-id: 7e1d4ff8d0fa72bb86d29076476ab802d8aebb87
2020-04-06 01:24:59 -04:00
John Sully 4bce3e3cf7 Add the ability to set a starting core # when setting thread affinity
Former-commit-id: e050768b25c87c5c0e6a7f24a58bbf6c9e94ff66
2020-04-04 22:58:17 -04:00
John Sully 6594fded8d Fix issue #164
Former-commit-id: 619d06aa33005c3fd98628ac601a57dc0ba4aff5
2020-04-04 22:45:12 -04:00
John Sully 04bfcc987c Role command protocol corruption with multiple masters
Former-commit-id: 5b7cf1b03da2578d3b7c3a730f0ba8f7102740fd
2020-04-04 22:32:15 -04:00
John Sully 74102d1980 Fix subkey expires not replicating correctly, and AOF issues
Former-commit-id: c9bb7ff37be4f91e8746ed5804443fd30b596139
2020-04-04 21:52:27 -04:00
John Sully d119f90431 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: e6c8a157e136ac5e5b44b5ea60c619ad4e55942b
2020-03-30 00:58:38 -04:00
John Sully a58ba09fb2 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: e6c8a157e136ac5e5b44b5ea60c619ad4e55942b
2020-03-30 00:58:38 -04:00
John Sully 957ad2872f Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: 86f7292ed375d509645458704828e72fdbfea936
2020-03-30 00:57:58 -04:00
John Sully cce3c1b5ef Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: 86f7292ed375d509645458704828e72fdbfea936
2020-03-30 00:57:58 -04:00
John Sully d0be850e70 Merge branch 'redis_6_merge' of https://github.com/JohnSully/KeyDB into redis_6_merge
Former-commit-id: 4b72f106a4dc16cdfc11e501ee0455de2aaaf6cb
2020-03-30 00:52:43 -04:00
John Sully 5306b94a63 Merge branch 'unstable' into redis_6_merge
Former-commit-id: c3cdb8c4f560f71d3203d50c0a5a9029fafc1c99
2020-03-30 00:52:12 -04:00
John Sully 96cb83dac7 Allow active replicas to connect to each other when replica-serve-stale-data is set
Former-commit-id: 94597709207b53c5213000e78177519e311d3688
2020-03-30 00:51:40 -04:00
John Sully 65710c2bef Don't send build log to stderr
Former-commit-id: eacdf1d9ffe22ecb0501ab7b2c9faffa7b0a9aa5
2020-03-28 23:36:57 -04:00
John Sully 6225a65911 Merge branch 'unstable' into redis_6_merge
Former-commit-id: 5fa8922fdde8f7ed20d8043eaea658783f36c4bf
2020-03-27 14:50:37 -04:00
John Sully 24cf761bf7 Raspberry Pi fixes (compile and replication)
Former-commit-id: 11a7ecc5f66f39a7d9b82737676d99ecfef0044b
2020-03-27 12:46:25 -04:00
John Sully a6448f7abe OS X Build break fix
Former-commit-id: 98da479d9241c077d3c11787800075dea91e989e
2020-03-26 15:20:55 -04:00
John Sully c0f10ae230 OS X Build break fix
Former-commit-id: 98da479d9241c077d3c11787800075dea91e989e
2020-03-26 15:20:55 -04:00
John Sully 523708e150 bump version
Former-commit-id: 8e855c4568fd555f6df9a5b00bab2e42248127e3
2020-03-26 01:18:21 -04:00
John Sully 5e2531251e bump version
Former-commit-id: 8e855c4568fd555f6df9a5b00bab2e42248127e3
2020-03-26 01:18:21 -04:00
John Sully fbf097afa5 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: a5d8a93a476366ef2aa6fe9c248f33288b322ff6
2020-03-26 01:17:56 -04:00
John Sully c0d73c69ee Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: a5d8a93a476366ef2aa6fe9c248f33288b322ff6
2020-03-26 01:17:56 -04:00
John Sully 1bb4b72208 merge
Former-commit-id: 187773190f153f8a7236bc2e4f42bffe6885f727
2020-03-26 01:16:36 -04:00
John Sully 4658af1c8f merge
Former-commit-id: 187773190f153f8a7236bc2e4f42bffe6885f727
2020-03-26 01:16:36 -04:00
John Sully a82e819618 Fix merge issues
Former-commit-id: 02a6bec80eca5b4cd641f67a1ddf86c9efa578e5
2020-03-25 22:26:27 -04:00
John Sully 1c2ae22fae Merge branch 'unstable' into redis_6_merge
Former-commit-id: 21f879b4f78af231428d2755d6b80b7d58bbb600
2020-03-25 22:12:22 -04:00
John Sully fa2c741aba Fix issue #143
Former-commit-id: ae914a413cd6ea38aeb0aaef159ced174f17b337
2020-03-25 21:55:31 -04:00
John Sully 37c7675d3e Give a better error when handling std::terminate
Former-commit-id: d374cc8773d16cc304bd062ae03897e6d47b9578
2020-03-25 16:27:24 -04:00
John Sully 0cd0ecf62a Fix breaks from merge
Former-commit-id: fa76d19bee9df21967c4d8554128eebdd19021fa
2020-03-25 16:22:32 -04:00
John Sully 0af4bd220e Fix breaks from merge
Former-commit-id: fa76d19bee9df21967c4d8554128eebdd19021fa
2020-03-25 16:22:32 -04:00
John Sully f76d14e493 Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: 44f1b065ed6d3b0ad2a62f093432743b98fad6be
2020-03-25 15:47:24 -04:00
John Sully 91bcc2b375 Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: 44f1b065ed6d3b0ad2a62f093432743b98fad6be
2020-03-25 15:47:24 -04:00
John Sully 4336995cfb Merge branch 'unstable' into redis_6_merge
Former-commit-id: 26f870486313ab459de5fb2f8feacc1aca475d9d
2020-03-25 15:47:12 -04:00
John Sully 5fc388c32d Add roundtrip test for subkey expires
Former-commit-id: 4b6367e1c74187cb4d779105bf57ac58c031e91f
2020-03-25 15:34:30 -04:00
John Sully d9993e300b Fix failure to load subkey expires
Former-commit-id: 51bd7c22ce5b2995d5b3419f13b2232165331b82
2020-03-25 01:38:58 -04:00
John Sully 12ddffffa0 Expire entry needs to be resorted after a subkey expires
Former-commit-id: dda4222845042a768dffdea883b042dbd94f575f
2020-03-25 01:06:40 -04:00
John Sully ce48c53719 Evict on load if we have a storage provider
Former-commit-id: bb091796c3da7282e040c7b72a28ec1c5f5ecfb7
2020-03-24 14:49:43 -04:00
John Sully b1d3c3c928 Evict on load if we have a storage provider
Former-commit-id: bb091796c3da7282e040c7b72a28ec1c5f5ecfb7
2020-03-24 14:49:43 -04:00
John Sully 9046105860 Prevent issue where count can be out of sync temporarily, causing crashes where we expect the count to be perfect
Former-commit-id: 77c9f36413c6f0cbb0b13a7ec746746c97faadcd
2020-03-24 00:21:12 -04:00
John Sully e0bdd1f203 Prevent issue where count can be out of sync temporarily, causing crashes where we expect the count to be perfect
Former-commit-id: 77c9f36413c6f0cbb0b13a7ec746746c97faadcd
2020-03-24 00:21:12 -04:00
John Sully 41de0056d6 Fix OOM errors during forkless bgsave
Former-commit-id: c31c64b13409c741e8d52ad06add78300c39fce2
2020-03-23 23:12:10 -04:00
John Sully ec3e22d7b7 Fix OOM errors during forkless bgsave
Former-commit-id: c31c64b13409c741e8d52ad06add78300c39fce2
2020-03-23 23:12:10 -04:00
John Sully de10b7eb69 Fix incorrect prefix comparison
Former-commit-id: 1ef167546be0678edd457d65a5368e8706fde0a3
2020-03-23 22:51:46 -04:00
John Sully 0dd85d1038 Fix incorrect prefix comparison
Former-commit-id: 1ef167546be0678edd457d65a5368e8706fde0a3
2020-03-23 22:51:46 -04:00
John Sully f30a9da9af Fix incorrect count when loading FLASH
Former-commit-id: 38ee9c0df144621f7ca750527e9efb16e754ef40
2020-03-23 19:47:48 -04:00
John Sully 6f2e3657a5 Fix incorrect count when loading FLASH
Former-commit-id: 38ee9c0df144621f7ca750527e9efb16e754ef40
2020-03-23 19:47:48 -04:00
John Sully 03e844ba72 Prevent bookkeeping keys from leaking through
Former-commit-id: 1a5af28e115fc123bf250b4a80ac69232bb3add0
2020-03-23 18:06:47 -04:00
John Sully 59c256ba29 Prevent bookkeeping keys from leaking through
Former-commit-id: 1a5af28e115fc123bf250b4a80ac69232bb3add0
2020-03-23 18:06:47 -04:00
John Sully 5681f4d8e7 Unstable branch should always be version 0.0.0
Former-commit-id: 9e2ff638a0464973f520d59dd0f731e261b76265
2020-03-19 15:52:24 -04:00
John Sully 2e2e958823 Merge branch 'RELEASE_5' into unstable
Former-commit-id: 94b9793ba9821d1b431bd5505f1c5bc2a70aac26
2020-03-19 15:38:16 -04:00
John Sully 9e95bffea8 Print stack traces of other threads in the deadlock detector
Former-commit-id: 10f4ed8478e852264643ccc738f77c3d646d37b1
2020-03-19 15:37:49 -04:00
John Sully 73c7b9c67f Log which thread a message came from
Former-commit-id: c4c0c6f22703f238f712602f549334e08634f6f3
2020-03-19 15:37:24 -04:00
John Sully 54db27b816 Fix lock inversion in processEventsWhileBlocked
Former-commit-id: 8af2e757ea80620896db0c53dd84f83891a9ebe1
2020-03-19 15:28:39 -04:00
John Sully 3e4cad3801 Prevent dangling lock when we can't free the client
Former-commit-id: bad4fd835ab496c7c581880ea8babab490972240
2020-03-19 14:34:23 -04:00
John Sully f8746a4d45 Merge branch 'PRO_RELEASE_6' of https://github.com/JohnSully/KeyDB-Pro into PRO_RELEASE_6
Former-commit-id: 1c1f3c920411ee94eb8b81922189b98c9631b3de
2020-03-17 17:48:27 -04:00
John Sully 1ff28922b9 Merge branch 'PRO_RELEASE_6' of https://github.com/JohnSully/KeyDB-Pro into PRO_RELEASE_6
Former-commit-id: 1c1f3c920411ee94eb8b81922189b98c9631b3de
2020-03-17 17:48:27 -04:00
John Sully a374fae9a6 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 23c3316c10f2771bc26e50698b48934ec7549bcd
2020-03-17 17:47:55 -04:00
John Sully 45f0bcc4fb Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 23c3316c10f2771bc26e50698b48934ec7549bcd
2020-03-17 17:47:55 -04:00
John Sully 1b5eac86a7 Special case version 0.0.0 which is equal to any version
Former-commit-id: 869d037490b6905674f75a8552898aed72148558
2020-03-17 17:25:36 -04:00
John Sully 5f5d665212 Special case version 0.0.0 which is equal to any version
Former-commit-id: 869d037490b6905674f75a8552898aed72148558
2020-03-17 17:25:36 -04:00
John Sully 578ea0e8ec Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: dd8339da10c17f0e2f238310a10e97395f8f12ac
2020-03-17 17:11:51 -04:00
John Sully 5c73fbadd7 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: dd8339da10c17f0e2f238310a10e97395f8f12ac
2020-03-17 17:11:51 -04:00
John Sully ab316128eb Cache count of keys in database
Former-commit-id: 7cd266030ad82b5fddd4668d666adc95e1bed475
2020-03-17 17:11:41 -04:00
John Sully 3f7785dc0b Cache count of keys in database
Former-commit-id: 7cd266030ad82b5fddd4668d666adc95e1bed475
2020-03-17 17:11:41 -04:00
John Sully 2a7daf93ae Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: ff3190cac5c5d222904aa2d57d97c752c1b7e554
2020-03-17 00:10:09 -04:00
John Sully 18cbe8086f Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: ff3190cac5c5d222904aa2d57d97c752c1b7e554
2020-03-17 00:10:09 -04:00
John Sully 0038355778 Merge branch 'unstable' into redis_6_merge
Former-commit-id: 02764735c23aab2ec53a02cd291587fce7a8e487
2020-03-17 00:09:48 -04:00
John Sully 8ec4a2b31e Fix issue #153: Config get replicaof returns a corrupt response
Former-commit-id: 4cb18b9d25e35923dfea9f00eb38ea98c6b6c93c
2020-03-16 20:43:46 -04:00
John Sully 5d370e6387 Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: aea8413a15001e2c27cf03dd41fa15151b0d3ccb
2020-03-15 18:48:45 -04:00
John Sully 703b097e3a Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: aea8413a15001e2c27cf03dd41fa15151b0d3ccb
2020-03-15 18:48:45 -04:00
John Sully bdb8254785 Merge branch 'unstable' into redis_6_merge
Former-commit-id: 799e7a8ff9af948105de6d06820de6b0c23b92d5
2020-03-15 18:47:27 -04:00
John Sully 76c0d8309a Handle HTTP error codes with MOTD
Former-commit-id: f8627c60bb6f542b35458dc95dfab635f554d5b4
2020-03-15 18:47:01 -04:00
John Sully 16a7dfd27c Update MOTD url for Pro
Former-commit-id: feed518042f3046016c26beda1c08cc721914943
2020-03-15 18:34:42 -04:00
John Sully 97e8ed71fd Update MOTD url for Pro
Former-commit-id: feed518042f3046016c26beda1c08cc721914943
2020-03-15 18:34:42 -04:00
John Sully 5a93298bca Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: 2765895981196adf6a8300eb4a704d60ec651f56
2020-03-15 18:34:15 -04:00
John Sully 3e13c03d40 Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: 2765895981196adf6a8300eb4a704d60ec651f56
2020-03-15 18:34:15 -04:00
John Sully 3951d50540 Merge branch 'unstable' into redis_6_merge
Former-commit-id: 505c981659c5101d1caaf160857ed88fbef02930
2020-03-15 18:33:24 -04:00
John Sully 6c0f3fd479 Update MOTD URL
Former-commit-id: 707b66ec35bda5f0c35b71fbd7f2c2e0dddf874c
2020-03-15 18:32:05 -04:00
John Sully c7870a6b36 Merge branch 'keydbpro' of https://github.com/JohnSully/KeyDB-Pro into keydbpro
Former-commit-id: c70edb09d33b746fa6893488327f301aff455b58
2020-03-15 18:28:00 -04:00
John Sully d4804d6b05 Merge branch 'keydbpro' of https://github.com/JohnSully/KeyDB-Pro into keydbpro
Former-commit-id: c70edb09d33b746fa6893488327f301aff455b58
2020-03-15 18:28:00 -04:00
John Sully 2dfd7fc738 Add fallback if we fail to evict normally with FLASH (flush everything)
Former-commit-id: 66ee85a8d5e24514083aa3478dcf0cf3da86520e
2020-03-15 18:27:10 -04:00
John Sully 8bec9fa199 Add fallback if we fail to evict normally with FLASH (flush everything)
Former-commit-id: 66ee85a8d5e24514083aa3478dcf0cf3da86520e
2020-03-15 18:27:10 -04:00
John Sully 36b0e932a3 Change the default for maxmemory samples to 10 to reduce issues with FLASH storage and eviction failure
Former-commit-id: 8571d8aca9b462d600b78854c0795c8b33520088
2020-03-15 18:26:46 -04:00
John Sully ab9a67f76b Change the default for maxmemory samples to 10 to reduce issues with FLASH storage and eviction failure
Former-commit-id: 8571d8aca9b462d600b78854c0795c8b33520088
2020-03-15 18:26:46 -04:00
John Sully 14cee36abe Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 1982bf26a5d24327389676031ecc599a5a6d88a7
2020-03-04 17:24:51 -05:00
John Sully 738aff3d91 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 1982bf26a5d24327389676031ecc599a5a6d88a7
2020-03-04 17:24:51 -05:00
John Sully 731bf62e2b Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: b0a3bb848937d24dd74de63032306fd92c61dd7b
2020-03-04 17:24:36 -05:00
John Sully 8ad16b6d00 Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: b0a3bb848937d24dd74de63032306fd92c61dd7b
2020-03-04 17:24:36 -05:00
John Sully f56f4b810a Fix CLANG build break
Former-commit-id: 103db9d0d2af98369805bd708ac2eac56ad54c2b
2020-03-04 17:24:17 -05:00
John Sully 095a07d827 Fix CLANG build break
Former-commit-id: 3ef5e2f068a5118e448351f79eb35a7e84ecf629
2020-03-04 17:24:00 -05:00
John Sully f4d478b1bc Fix CLANG build break
Former-commit-id: 91fb771bf061d9412dc7d8378572848d09cfd59e
2020-03-04 17:23:40 -05:00
John Sully 0f84d8cb26 finish merge
Former-commit-id: 66063a19f6cdbc87ead8ecbd4887134438ee1ccd
2020-03-04 17:22:57 -05:00
John Sully cc7bbd57d2 finish merge
Former-commit-id: 66063a19f6cdbc87ead8ecbd4887134438ee1ccd
2020-03-04 17:22:57 -05:00
John Sully c7896fcb77 Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: bef19fefeb293e44e31dfefe383eef99e4cd7721
2020-03-04 17:15:54 -05:00
John Sully 6d62c66f2b Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: bef19fefeb293e44e31dfefe383eef99e4cd7721
2020-03-04 17:15:54 -05:00
John Sully d8cf6facf7 Merge branch 'unstable' into redis_6_merge
Former-commit-id: 08b0eadcf1063f2fa7026821e05125d488f9aa18
2020-03-04 17:13:50 -05:00
John Sully 7ac53e849d Merge branch 'unstable' into RELEASE_5
Former-commit-id: a857966259890f391fcc5fbcd1132d7e457e2ee3
2020-03-04 17:13:32 -05:00
John Sully e04b332b51 Add missing files from last checkin
Former-commit-id: ad6161d9356c27b14de31998180571eb72901aa8
2020-03-04 17:13:18 -05:00
John Sully 5e6ae3118c Merge branch 'unstable' into redis_6_merge
Former-commit-id: 36e706a6e1a9977c86a3ec1864d4706b22d0169c
2020-03-04 17:13:01 -05:00
John Sully 1be1aaeafe Merge branch 'unstable' into RELEASE_5
Former-commit-id: 61b49ca1a751a5ca3a0073dd7e69abec1f7d65ed
2020-03-04 17:09:29 -05:00
John Sully 334d72b033 Add extra logging when reporting errors from masters - especially in rreplay
Former-commit-id: a543a353d129c57fbbc46f9652fd0fdae5ca5a84
2020-03-04 17:09:12 -05:00
John Sully ebfe3a9e11 MOTD refactor
Former-commit-id: 6959390c6875704482cb751d9415b6107db3147c
2020-03-04 16:22:55 -05:00
John Sully 9033e0f675 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 5b89b51192154e66e8ad87ce342a9cd4ab7a0130
2020-03-04 15:34:27 -05:00
John Sully bfe6b9fc4f Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 5b89b51192154e66e8ad87ce342a9cd4ab7a0130
2020-03-04 15:34:27 -05:00
John Sully 3f3fedb910 Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: a14d1d5b55a507a83cf5b85920607a0d013e7037
2020-03-04 15:33:59 -05:00
John Sully 75f590de02 Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: a14d1d5b55a507a83cf5b85920607a0d013e7037
2020-03-04 15:33:59 -05:00
John Sully 944a7352be min-clients-per-thread needs to use the new config code
Former-commit-id: 5003fcc878426a1552c978fb39882708ea44862d
2020-03-04 15:14:41 -05:00
John Sully ea1eec38b5 Update README.md
Former-commit-id: 792c717949a91d0b58f33066bbe050b08f455ebb
2020-03-03 13:58:48 -08:00
John Sully ddea8b80ef Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 51e889277c59adb25a8724b25706631e6adca366
2020-03-01 22:17:04 -05:00
John Sully fc353a346b Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 51e889277c59adb25a8724b25706631e6adca366
2020-03-01 22:17:04 -05:00
John Sully 57fcd6a44c Add option to build pro without license checks
Former-commit-id: 0713518d2f34559a06db31a9023228b91ce60af3
2020-03-01 22:16:25 -05:00
John Sully aa636eb0fd Add option to build pro without license checks
Former-commit-id: 0713518d2f34559a06db31a9023228b91ce60af3
2020-03-01 22:16:25 -05:00
John Sully 75aba7e297 Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: 656bacd614f359742f6bd2df3fd2009c44c3d788
2020-03-01 21:49:21 -05:00
John Sully 5a5b0428a5 Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: 656bacd614f359742f6bd2df3fd2009c44c3d788
2020-03-01 21:49:21 -05:00
John Sully 6813a97738 Merge branch 'unstable' into redis_6_merge
Former-commit-id: 59aea09bf8a6b97b77135280ada704b7f05f93f0
2020-03-01 21:48:51 -05:00
John Sully 50be560e1d Merge branch 'unstable' into RELEASE_5
Former-commit-id: 3545feee4ba77a85afd324abb188c65d01fc2bef
2020-03-01 21:43:21 -05:00
John Sully 5d2cf7f92e Update tests to reflect new CRON name (keydb.cron)
Former-commit-id: d9b1e93cc456574c282825b5eefd877660ed3cf1
2020-03-01 21:42:01 -05:00
benschermel b97fd0d451 Merge branch 'unstable' into RELEASE_5
Former-commit-id: 62e79218f21e05b6e8760613f0d2c489f9656480
2020-03-01 19:53:32 -05:00
John Sully b4fe96d23c Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 197022aa76949664dfd866e0e71602bf23cbc3a0
2020-03-01 19:18:56 -05:00
John Sully 16163959c4 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 197022aa76949664dfd866e0e71602bf23cbc3a0
2020-03-01 19:18:56 -05:00
John Sully 8de67206af Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: 4e8000d43cd4e23c90bf7e262835fae5ae6da34d
2020-03-01 19:18:34 -05:00
John Sully bb4f2182fc Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: 4e8000d43cd4e23c90bf7e262835fae5ae6da34d
2020-03-01 19:18:34 -05:00
John Sully 44f235bfb0 Rename cron command to KEYDB.CRON and add help
Former-commit-id: e42e1f966e6bc57cf72cb4d01d6d1a630f58ab77
2020-03-01 19:18:21 -05:00
John Sully c99deff07c Rename cron command to KEYDB.CRON and add help
Former-commit-id: 0fb35811d77e53a5b8ad4624220b80834b925cb1
2020-03-01 19:17:58 -05:00
John Sully da1ec11aae Bump version
Former-commit-id: e5776fd1a05b329c3113b94d26fba9e39816644f
2020-02-29 00:04:24 -05:00
John Sully 7f3fedc59a Bump version
Former-commit-id: e5776fd1a05b329c3113b94d26fba9e39816644f
2020-02-29 00:04:24 -05:00
John Sully c63fbef58a Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: e559a947e6d233146416e68a7c69d4e9b2eadd6c
2020-02-29 00:03:55 -05:00
John Sully 8ed3293a98 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: e559a947e6d233146416e68a7c69d4e9b2eadd6c
2020-02-29 00:03:55 -05:00
John Sully 8c28a61436 Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: a60d71e13335bdf231b5f1bec61b457056dc5e0a
2020-02-28 23:57:45 -05:00
John Sully 8096c76bc1 Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: a60d71e13335bdf231b5f1bec61b457056dc5e0a
2020-02-28 23:57:45 -05:00
John Sully 37d89d7cd3 Merge branch 'unstable' into redis_6_merge
Former-commit-id: 916a31b927f3242643c364e0ad0f1abc9cd98286
2020-02-28 23:56:26 -05:00
John Sully a2cc65d256 Bump version
Former-commit-id: 0c1f7ae344a7d5372f85f8f20137d1b78a70755d
2020-02-28 23:53:54 -05:00
John Sully 3c4238b5de Merge branch 'unstable' into RELEASE_5
Former-commit-id: 3b704ec8a42b082b4c8e1b5ca935fad8932d6158
2020-02-28 23:53:00 -05:00
John Sully 796f611e55 Fix compile failure on raspberry pi machines, issue #141
Former-commit-id: 4560f7f78db38cac87971fcc4041069c4022b633
2020-02-28 23:49:17 -05:00
John Sully f978a8be31 Fix not respecting max clients config, issue #147
Former-commit-id: 6ad76d6f15262973153a2437e4611be8b2306a31
2020-02-28 22:04:42 -05:00
John Sully 29794fec2e Fix issue #146
Former-commit-id: 6e373dcb91f82814c858ca3d270b8c47e60a7256
2020-02-28 21:21:05 -05:00
John Sully 4fd0513530 Fix crash propogating stale keys
Former-commit-id: eaca39530a8eb1ddb1049b5f982550a1cf6d63b8
2020-02-26 21:49:40 -05:00
John Sully 7ee536d084 Change Redis to KeyDB
Former-commit-id: ee5f026eea133ad851bfb3e8788a15ac798ca7e6
2020-02-17 23:46:29 -05:00
John Sully 961273878a Change Redis to KeyDB
Former-commit-id: ee5f026eea133ad851bfb3e8788a15ac798ca7e6
2020-02-17 23:46:29 -05:00
John Sully 7de1af9a83 Change Redis to KeyDB
Former-commit-id: e6316c8106caa9103d2bef6af35721a0be87aae0
2020-02-17 23:46:17 -05:00
John Sully 65ba802a36 Change Redis to KeyDB
Former-commit-id: e6316c8106caa9103d2bef6af35721a0be87aae0
2020-02-17 23:46:17 -05:00
John Sully 36c5d506ad Change Redis to KeyDB
Former-commit-id: 96030cf2d6b90fe1e09dcd593999ac011b82158b
2020-02-17 23:46:01 -05:00
John Sully 0eca83807b Change Redis to KeyDB
Former-commit-id: 795c6efcc2e09c681c3e17490ae96589e634547f
2020-02-17 23:45:40 -05:00
John Sully b99af0f882 C++14 build fix
Former-commit-id: b45f50efa2fb56aa995ee6ceb6bd91380c28187c
2020-02-17 23:29:23 -05:00
John Sully 63c79593c0 C++14 build fix
Former-commit-id: b45f50efa2fb56aa995ee6ceb6bd91380c28187c
2020-02-17 23:29:23 -05:00
John Sully 3d9aaaa034 C++14 build fix
Former-commit-id: 5a3e3c9fe20dabe294c439cd2b22e929a228f596
2020-02-17 23:29:03 -05:00
John Sully a513f24841 C++14 build fix
Former-commit-id: 5a3e3c9fe20dabe294c439cd2b22e929a228f596
2020-02-17 23:29:03 -05:00
John Sully 3c9d25ede0 Bump version
Former-commit-id: 7f84d6d6301303a3277910bf93e5d8dc900908c1
2020-02-17 22:27:50 -05:00
John Sully f14fd30ef0 Bump version
Former-commit-id: 7f84d6d6301303a3277910bf93e5d8dc900908c1
2020-02-17 22:27:50 -05:00
John Sully 24c77a7c8b Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 5db2ab0ef538391eb2e20cce6a6af6b750458db0
2020-02-17 22:27:11 -05:00
John Sully eac97291b3 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 5db2ab0ef538391eb2e20cce6a6af6b750458db0
2020-02-17 22:27:11 -05:00
John Sully 30e3d2cfa2 override eviction policy for flash
Former-commit-id: 48a4f967e66ba765be96c9f8e113f808a4390f88
2020-02-17 22:26:48 -05:00
John Sully 9508aa04a2 override eviction policy for flash
Former-commit-id: 48a4f967e66ba765be96c9f8e113f808a4390f88
2020-02-17 22:26:48 -05:00
John Sully 37acc0fa9d Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: ad5a015388a3180bcbfefebf106a1a56e304e380
2020-02-17 22:03:54 -05:00
John Sully cf4231ad44 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: ad5a015388a3180bcbfefebf106a1a56e304e380
2020-02-17 22:03:54 -05:00
John Sully 4badba8e37 We should give a nice error message when we can't init a storage provider
Former-commit-id: 6c5acd8fe926d9f66fa5b13a2b962e5632f148de
2020-02-17 22:03:35 -05:00
John Sully 728a854b35 We should give a nice error message when we can't init a storage provider
Former-commit-id: 6c5acd8fe926d9f66fa5b13a2b962e5632f148de
2020-02-17 22:03:35 -05:00
John Sully 3f617f45bd Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 50127eec445cb8d7abceb683f2afbd7aad90a3ae
2020-02-17 21:51:02 -05:00
John Sully 9d481824c0 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 50127eec445cb8d7abceb683f2afbd7aad90a3ae
2020-02-17 21:51:02 -05:00
John Sully 204bf7e131 Tune rocksdb
Former-commit-id: 95d91b1ff8c8080dfcbf59e51d3eff73d27dcfb5
2020-02-17 21:50:45 -05:00
John Sully 310d2e7857 Tune rocksdb
Former-commit-id: 95d91b1ff8c8080dfcbf59e51d3eff73d27dcfb5
2020-02-17 21:50:45 -05:00
John Sully 1ff01bd1cd Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: bc4b0ff8c18410ae1d1b029410580c96c430510f
2020-02-17 19:56:38 -05:00
John Sully 3243d9342e Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: bc4b0ff8c18410ae1d1b029410580c96c430510f
2020-02-17 19:56:38 -05:00
John Sully a8d1483dd9 Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: 82b957be47c828238554ba8b365e2d0a45994bc2
2020-02-17 19:56:07 -05:00
John Sully 21698048c4 Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: 82b957be47c828238554ba8b365e2d0a45994bc2
2020-02-17 19:56:07 -05:00
John Sully 8a9371dbef Merge branch 'unstable' into redis_6_merge
Former-commit-id: 4add47b244a28e4cfecfcc65e47c42e99325bf80
2020-02-17 19:55:29 -05:00
John Sully 0e06b4d5b9 Add double unlock detection and improve fastlock_unlock assmebly
Former-commit-id: 539c81daf2a87f947eea2340c617f4ebf94f9efe
2020-02-17 19:54:05 -05:00
John Sully 23ce33c7ef Incorrect use of std::atomic
Former-commit-id: 7a679cdd8a43fcebc6125a35afb0574ab6523fed
2020-02-17 19:07:13 -05:00
John Sully 896f716678 processEventsWhileBlocked not exception safe
Former-commit-id: adcb12ba8789c7a1a372358b15341455b0863b95
2020-02-17 19:04:11 -05:00
John Sully 4cf851fb4b processEventsWhileBlocked not exception safe
Former-commit-id: 765c81894d52f24436f2f8681b7f82aaf3c75c16
2020-02-17 19:03:49 -05:00
John Sully 0d54d36f64 Fix race condition with IStorage batches
Former-commit-id: a2eabd044c9048662a63ff0f980ed947dc145912
2020-02-17 19:00:31 -05:00
John Sully 7f7e252602 Fix race condition with IStorage batches
Former-commit-id: a2eabd044c9048662a63ff0f980ed947dc145912
2020-02-17 19:00:31 -05:00
John Sully fbfa450ecf processEventsWhileBlocked not exception safe
Former-commit-id: 432543956c74351a12af2cb258a7a0ba5daa9b27
2020-02-17 18:57:13 -05:00
John Sully efa2f6a95a processEventsWhileBlocked not exception safe
Former-commit-id: 432543956c74351a12af2cb258a7a0ba5daa9b27
2020-02-17 18:57:13 -05:00
John Sully 2479f676f0 Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: b16090958d392a6de908562dee65a02c851f07ae
2020-02-16 20:07:03 -05:00
John Sully e8c3503a06 Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: b16090958d392a6de908562dee65a02c851f07ae
2020-02-16 20:07:03 -05:00
John Sully 7bffa38dc3 Merge branch 'unstable' into redis_6_merge
Former-commit-id: 878f505e69291d84ad1fbedac06420f447b0b17b
2020-02-16 19:14:51 -05:00
John Sully c63d565b9a Support C++14 and remove dependency on future standard 2a
Former-commit-id: 7646a9215be9a10c7610e50f4c59ae1881932307
2020-02-16 19:04:56 -05:00
John Sully 2e4f160e0a Graceful shutdown of server threads when quit is requested
Former-commit-id: ee1d24855eb90eb59da9cddcd7dfeb09c8f57592
2020-02-16 18:53:46 -05:00
John Sully de1baf7306 Virtual dtor for DB base class
Former-commit-id: 953b1cb3a2fec808751d2e7507efe8896f671921
2020-02-16 18:43:36 -05:00
John Sully 2d3d8b71e3 Virtual dtor for DB base class
Former-commit-id: 953b1cb3a2fec808751d2e7507efe8896f671921
2020-02-16 18:43:36 -05:00
John Sully a52d41a611 Fix memory leak in RDB load
Former-commit-id: f9d21017a7a5d078db721ca2705ffed8befcaac4
2020-02-16 18:42:14 -05:00
John Sully d65593f6a0 Fix memory leak in RDB load
Former-commit-id: f0c3959cd90e62c69d10dbc1f5ff38cc8a397cfb
2020-02-16 18:41:50 -05:00
John Sully f4ab585412 Fix memory leak in RDB load
Former-commit-id: a424194f42e61a324489464a0fed14837b8191e4
2020-02-16 18:41:29 -05:00
John Sully ad69834f09 Fix memory leak in RDB load
Former-commit-id: a424194f42e61a324489464a0fed14837b8191e4
2020-02-16 18:41:29 -05:00
John Sully 000b00ad8b Fix leak deserializing expire
Former-commit-id: 1a7e14d8ef96f7849ecdb120f3339b2423ca25d8
2020-02-16 18:40:00 -05:00
John Sully 104b8429ea Fix leak deserializing expire
Former-commit-id: 1a7e14d8ef96f7849ecdb120f3339b2423ca25d8
2020-02-16 18:40:00 -05:00
John Sully ef4f8932ae Merge branch 'keydbpro' of https://github.com/JohnSully/KeyDB-Pro into keydbpro
Former-commit-id: 770941923d183c0dfed8d5bf8f2299fc4fadf9c6
2020-02-16 18:38:15 -05:00
John Sully 323cf15d94 Merge branch 'keydbpro' of https://github.com/JohnSully/KeyDB-Pro into keydbpro
Former-commit-id: 770941923d183c0dfed8d5bf8f2299fc4fadf9c6
2020-02-16 18:38:15 -05:00
John Sully 08f1f5c535 Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: 8456e92d6e446f1cc20d9cea2328998da0a4d7d5
2020-02-16 18:28:45 -05:00
John Sully b49a49983c Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: 8456e92d6e446f1cc20d9cea2328998da0a4d7d5
2020-02-16 18:28:45 -05:00
John Sully e3cbd04cf6 Merge branch 'unstable' into redis_6_merge
Former-commit-id: 22aef51551f87dc59ad9a3d04844904986fa807c
2020-02-16 18:18:24 -05:00
John Sully d5e6289845 Merge branch 'unstable' of https://github.com/JohnSully/KeyDB into unstable
Former-commit-id: 7fb842fab5c69280eace2e56f1febfbdae35c7a1
2020-02-16 18:12:11 -05:00
John Sully 4c1b44e92e Memory leak fix on config, and redisDb dtor
Former-commit-id: d150dc7a9a852d9f6f8b0df7444f6a485741739b
2020-02-16 17:08:00 -05:00
John Sully 5771140d67 Add GC shutdown command
Former-commit-id: 28e8f68016b554f3d410502c2af1641368c2bb92
2020-02-16 16:49:04 -05:00
John Sully 78840c9fc2 Add GC shutdown command
Former-commit-id: 28e8f68016b554f3d410502c2af1641368c2bb92
2020-02-16 16:49:04 -05:00
John Sully c46de94df5 Merge branch 'unstable' into keydbpro
Former-commit-id: f3457e2a9a8464bac656b57256316bbddb65d9e9
2020-02-16 04:04:34 -05:00
John Sully efd0b80fc2 Merge branch 'unstable' into keydbpro
Former-commit-id: f3457e2a9a8464bac656b57256316bbddb65d9e9
2020-02-16 04:04:34 -05:00
John Sully b3e68a7c13 Fix memory leak of ReplicaNestState on shutdown
Former-commit-id: 6d71b78cd314135cd280bb31d2dd92391cc27b39
2020-02-16 03:43:29 -05:00
John Sully d8d3f65736 Fix leak when tombstone exists
Former-commit-id: 3d0ccdf6d2ddc523a3532c46cf905023d207b8cb
2020-02-16 03:36:47 -05:00
John Sully d4a28250d0 Fix leak when tombstone exists
Former-commit-id: 3d0ccdf6d2ddc523a3532c46cf905023d207b8cb
2020-02-16 03:36:47 -05:00
John Sully a9a857b127 aeDeleteEventLoop use after free and leak fixes
Former-commit-id: 89e666a3d469288d7c34648772059dd39c9ed092
2020-02-16 03:34:25 -05:00
John Sully 782fd3117e aeDeleteEventLoop use after free and leak fixes
Former-commit-id: 77820e5d50e0426570285a2c740c47b05a7c6c2f
2020-02-16 03:33:45 -05:00
John Sully 93a58fd7ab aeDeleteEventLoop use after free and leak fixes
Former-commit-id: 77820e5d50e0426570285a2c740c47b05a7c6c2f
2020-02-16 03:33:45 -05:00
John Sully 872800f347 Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: 4bd4159e2d8a7cdd0af9719776dca3e7d161d166
2020-02-11 03:48:24 -05:00
John Sully c077c06a23 Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: 4bd4159e2d8a7cdd0af9719776dca3e7d161d166
2020-02-11 03:48:24 -05:00
John Sully ac1c88082d Merge branch 'unstable' into redis_6_merge
Former-commit-id: d0a4a55aa9cd64e5a27b3084800a83c6e12f97ff
2020-02-11 03:48:08 -05:00
John Sully d4d6f3ee4a Fix race condition in allocating connections to threads
Former-commit-id: 3f581b513992ec75bb370e9f986b649fcc807d77
2020-02-11 03:44:28 -05:00
John Sully 751f5fa199 Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: 4091800e499cade8bc188c9e6f52f535c500f282
2020-02-11 02:54:24 -05:00
John Sully 851457a4c1 Merge branch 'redis_6_merge' into keydbpro
Former-commit-id: 4091800e499cade8bc188c9e6f52f535c500f282
2020-02-11 02:54:24 -05:00
John Sully 8297831a9e Merge branch 'unstable' into redis_6_merge
Former-commit-id: 17dc5b554c9a6587a92f7dc9cb8f1dd80447422a
2020-02-11 02:39:08 -05:00
John Sully d1ab769064 Implement an error handler so bug #125 can't happen
Former-commit-id: 21b0d162d66d3a7ed8e7825dd0a70d9ff9c65a98
2020-02-11 01:41:00 -05:00
John Sully dd0932e5d3 Fix higher latency at low load by grouping clients to threads. This fixes slow perf in cluster benchmarks mentioned in issue #102
Former-commit-id: 3a8a5a425a6983e1677f329c6291b21e0b70f350
2020-02-11 01:00:21 -05:00
John Sully a006de84d6 Fix cases where duplicate RREPLAY is applied
Former-commit-id: c92a59006a3baa0f36192bf4e4dd763a475ea336
2020-02-11 00:59:07 -05:00
John Sully 1f421aead6 Fix issue #119
Former-commit-id: 870da155d7aa8b4738eab342dfa369d9ef032c91
2020-02-10 19:52:57 -05:00
John Sully ed099122a4 Fix memory leak in cron
Former-commit-id: 5919483f8347925046f503ccaf94b8bba493a196
2020-02-10 18:26:04 -05:00
John Sully 4e89d280f4 Add missing test file
Former-commit-id: ccec4d9c2ed6be9986818df53d5bd5ce44572b41
2020-02-10 18:15:29 -05:00
John Sully dcddf47c48 CLANG build fix
Former-commit-id: cd4be50e184318ea1f61bfee93330027a98ea61d
2020-02-10 00:29:26 -05:00
John Sully a053fc196e Ensure multi-master works for ring topologies
Former-commit-id: c75229b82ebec8fb883750ead7ba83186c640e78
2020-02-10 00:25:03 -05:00
John Sully 1175091ac5 Merge branch 'unstable' of https://github.com/JohnSully/KeyDB into unstable
Former-commit-id: a453cbc9868a400be2d50b766b770600897244fe
2020-02-09 02:25:20 -05:00
John Sully 172a787f03 Addmissing test file
Former-commit-id: 34aea2c641532dc44f37ace9094d9cb3a78635bc
2020-02-08 16:49:41 -05:00
John Sully bc41cf58e6 Merge branch 'unstable' into keydbpro
Former-commit-id: fec8209c1996112976d927d65dbc2b4492131681
2020-02-07 16:46:13 -05:00
John Sully 8c404b9e6c Merge branch 'unstable' into keydbpro
Former-commit-id: fec8209c1996112976d927d65dbc2b4492131681
2020-02-07 16:46:13 -05:00
John Sully e030476029 merge 5.0 unstable
Former-commit-id: a176c149fa170dcfb4846d8f07734ad80a59a626
2020-02-07 16:45:59 -05:00
John Sully dcf19edcbe Fix issue #137 and #132
Former-commit-id: 55e031372393746beb1c1a10d67d816e5a4e8a89
2020-02-06 23:31:31 -05:00
John Sully d3ca658194 Add test to detect issue #137 and #132
Former-commit-id: a0569106ac57f0ced69ce8667ff7f06172bff141
2020-02-06 23:31:12 -05:00
John Sully 7b24f77d5c module fixes
Former-commit-id: e167bfa4c060393983ec277607757a3dce82c652
2020-02-04 01:22:25 -05:00
John Sully 9ea7b161f5 rename to pro binary
Former-commit-id: a8854bfd83de72d6aa418ee6d9b44fae1f622787
2020-02-04 00:30:13 -05:00
John Sully d88fb1ebd6 rename to pro binary
Former-commit-id: a8854bfd83de72d6aa418ee6d9b44fae1f622787
2020-02-04 00:30:13 -05:00
John Sully 7a9f15733e Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 055eaa99ab918609f4ac6b533da3067e5e32a170
2020-02-03 20:16:20 -05:00
John Sully 9adf145760 Merge branch 'keydbpro' into PRO_RELEASE_6
Former-commit-id: 055eaa99ab918609f4ac6b533da3067e5e32a170
2020-02-03 20:16:20 -05:00
John Sully 72f6912a64 Ensure create-cluster launches pro
Former-commit-id: 8b3773805d2208070e807ede219821c524495c34
2020-02-03 20:15:59 -05:00
John Sully 3a888e4a85 Ensure create-cluster launches pro
Former-commit-id: 8b3773805d2208070e807ede219821c524495c34
2020-02-03 20:15:59 -05:00
John Sully db759ee483 Bump version
Former-commit-id: ac84153f61b213d42ad503ac38948f9740a5f923
2020-02-03 20:01:53 -05:00
John Sully 960d0cfe3e Bump version
Former-commit-id: ac84153f61b213d42ad503ac38948f9740a5f923
2020-02-03 20:01:53 -05:00
John Sully 271e6bf675 Merge branch 'unstable' into keydbpro
Former-commit-id: 0db79c793e30ab268cb0f771928468e477e3b8da
2020-02-03 20:00:16 -05:00
John Sully 1fb4ab60bd Merge branch 'unstable' into keydbpro
Former-commit-id: 0db79c793e30ab268cb0f771928468e477e3b8da
2020-02-03 20:00:16 -05:00
John Sully 078392c79a Fix cluster test failures from Redis 6 merge
Former-commit-id: 761cab753abd66f2ddda3360bf9707d7072ada96
2020-02-03 20:00:09 -05:00
John Sully 003c54d90e Build portable rocksdb binaries
Former-commit-id: e94db969f8ac584b75b2ad015b65c1d0d73d0776
2020-02-03 17:33:15 -05:00
John Sully b45ea6effa Build portable rocksdb binaries
Former-commit-id: e94db969f8ac584b75b2ad015b65c1d0d73d0776
2020-02-03 17:33:15 -05:00
John Sully f28e671b46 Fix failure to save RDB on shutdown
Former-commit-id: 1a8331c88a17deaa5faf34c7ea65957c57530546
2020-02-03 16:00:01 -05:00
John Sully 7ad24969b9 Fix failure to save RDB on shutdown
Former-commit-id: 1a8331c88a17deaa5faf34c7ea65957c57530546
2020-02-03 16:00:01 -05:00
John Sully cc62d52f05 Optimize bgsave snapshotting
Former-commit-id: 15b4bf003537fe6fd926146f46d38203683846be
2020-02-02 23:42:44 -05:00
John Sully 6fd3ccf33e Optimize bgsave snapshotting
Former-commit-id: 15b4bf003537fe6fd926146f46d38203683846be
2020-02-02 23:42:44 -05:00
John Sully 472a97eb13 3 fixes, 0 array access on boot, getAsync is useless on single theaded, and don't print COW info for BG thread work since it will be inaccurate
Former-commit-id: 09362ff44afed8525816437aead84f215eb59c36
2020-02-02 23:30:42 -05:00
John Sully 917e9dec3a 3 fixes, 0 array access on boot, getAsync is useless on single theaded, and don't print COW info for BG thread work since it will be inaccurate
Former-commit-id: 09362ff44afed8525816437aead84f215eb59c36
2020-02-02 23:30:42 -05:00
John Sully 2e059023a9 RDB thread cleanup fixes
Former-commit-id: 3e30cf6de930c40c3a1c63a761b2018836d4ae52
2020-02-02 23:29:20 -05:00
John Sully 94ecf30dfc RDB thread cleanup fixes
Former-commit-id: 3e30cf6de930c40c3a1c63a761b2018836d4ae52
2020-02-02 23:29:20 -05:00
John Sully eb10cd8115 Handle case where src dict is larger in dictMerge
Former-commit-id: c750fdb381f5dd3e92d251a82bd86533eb2cadf5
2020-02-02 23:27:25 -05:00
John Sully 77147804da Handle case where src dict is larger in dictMerge
Former-commit-id: c750fdb381f5dd3e92d251a82bd86533eb2cadf5
2020-02-02 23:27:25 -05:00
John Sully 60ab0ad3f3 endSnapshotAsync implementation (fails tests w/ multithreading)
Former-commit-id: b401e9fcae40cf1d4e4c1584f57e760d9adf36a9
2020-02-01 22:28:24 -05:00
John Sully e10eaadc02 endSnapshotAsync implementation (fails tests w/ multithreading)
Former-commit-id: b401e9fcae40cf1d4e4c1584f57e760d9adf36a9
2020-02-01 22:28:24 -05:00
John Sully 48569b5482 Merge branch 'unstable' into keydbpro
Former-commit-id: 53b36801cede2dbebbf33ec665af69f810b438d5
2020-02-01 21:52:26 -05:00
John Sully 56b8c173a5 Merge branch 'unstable' into keydbpro
Former-commit-id: 53b36801cede2dbebbf33ec665af69f810b438d5
2020-02-01 21:52:26 -05:00
John Sully 7e4eb9869b addRef memory model too restrictive
Former-commit-id: c8bc7799b65e54bdf57d7a80f4ce6a67d3adbb89
2020-02-01 21:52:17 -05:00
John Sully 5516241df8 use dictMerge() in endSnapshot for speed and cleaner code
Former-commit-id: ed8e10234e4499506f2557b0858dba86c30c9dc0
2020-02-01 21:08:26 -05:00
John Sully 18a417bdc6 use dictMerge() in endSnapshot for speed and cleaner code
Former-commit-id: ed8e10234e4499506f2557b0858dba86c30c9dc0
2020-02-01 21:08:26 -05:00
John Sully 6a8a5d93a4 Allow rehashing if RDB thread is active, it doesn't suffer from COW madness
Former-commit-id: 2f1f2eaa9d160701f45eed52fc7903fcccd7656b
2020-02-01 20:28:17 -05:00
John Sully 99ffa068d0 Allow rehashing if RDB thread is active, it doesn't suffer from COW madness
Former-commit-id: 2f1f2eaa9d160701f45eed52fc7903fcccd7656b
2020-02-01 20:28:17 -05:00
John Sully 0a8505df51 Fix spurious error messages trying to join the RDB save thread
Former-commit-id: 775f3477655207a4df2b0b3609f3ee83d41098af
2020-02-01 20:26:09 -05:00
John Sully e4dfd96d59 Fix spurious error messages trying to join the RDB save thread
Former-commit-id: 775f3477655207a4df2b0b3609f3ee83d41098af
2020-02-01 20:26:09 -05:00
John Sully aadd52b823 Add new faster dictionary merging for use by snapshotting code
Former-commit-id: b6f120b3d401c92ef5cf1cc6f5e77da139e33a97
2020-02-01 20:17:40 -05:00
John Sully 909e30cf93 Add new faster dictionary merging for use by snapshotting code
Former-commit-id: b6f120b3d401c92ef5cf1cc6f5e77da139e33a97
2020-02-01 20:17:40 -05:00
John Sully ec92c8a5f9 Increase trial timeout to 2 hours
Former-commit-id: 2614f902e4292c84b9bc473c8d3a5bba9dfdbc2d
2020-01-31 23:35:13 -05:00
John Sully 5c89ab20e2 Increase trial timeout to 2 hours
Former-commit-id: 2614f902e4292c84b9bc473c8d3a5bba9dfdbc2d
2020-01-31 23:35:13 -05:00
John Sully d06d13b661 snapshot optimizations
Former-commit-id: 642f67376a480497554f2891ebfbe7639583c6f1
2020-01-31 17:32:48 -05:00
John Sully b18a941f14 snapshot optimizations
Former-commit-id: 642f67376a480497554f2891ebfbe7639583c6f1
2020-01-31 17:32:48 -05:00
John Sully a94172299b Initialize the storage provider after daemonize
Former-commit-id: 5910af623b024b087c69b17ec32ce351fc4d00c2
2020-01-30 22:26:44 -05:00
John Sully decd4743de Initialize the storage provider after daemonize
Former-commit-id: 5910af623b024b087c69b17ec32ce351fc4d00c2
2020-01-30 22:26:44 -05:00
John Sully 905b69db90 build break non-TLS
Former-commit-id: 72e455b94739625a217a664b61f4a4b7ae98f7f1
2020-01-30 21:19:08 -05:00
John Sully e10187f5b2 build break non-TLS
Former-commit-id: 72e455b94739625a217a664b61f4a4b7ae98f7f1
2020-01-30 21:19:08 -05:00
John Sully 652be9d3e3 Merge branch 'unstable' into keydbpro
Former-commit-id: aca1a6605685811833729d746df85781177d5a78
2020-01-30 21:15:42 -05:00
John Sully 0812f4b77c Merge branch 'unstable' into keydbpro
Former-commit-id: aca1a6605685811833729d746df85781177d5a78
2020-01-30 21:15:42 -05:00
John Sully de22e714c9 RDB memory leaks
Former-commit-id: 487c0693f75e0cf3ed6cdde263b81a8fb6a42084
2020-01-30 17:57:10 -05:00
John Sully debe3079ef replication memory leaks
Former-commit-id: f5e52bb1ae426d29f5dc0af53dca26a3e48f8c7c
2020-01-30 17:56:24 -05:00
John Sully ab4fb38960 Fix memory leak in cron
Former-commit-id: 1f16bbeeee45a3b5d993102d8a86621ae2d350f3
2020-01-30 17:55:48 -05:00
John Sully e904904101 Merge branch 'redis_merge' into unstable
Former-commit-id: 81ca9ed0d64ce4cb6de33eaa23cc845a960b5f1c
2020-01-30 16:05:40 -05:00
John Sully f524c5ad9a Merge branch 'redis_merge' into keydb_pro_merge
Former-commit-id: 2a760ac3b2cf12e45a9db9d0c2efe6efc4dc2aed
2020-01-29 21:30:20 -05:00
John Sully ad4bc5d943 Merge branch 'redis_merge' into keydb_pro_merge
Former-commit-id: 2a760ac3b2cf12e45a9db9d0c2efe6efc4dc2aed
2020-01-29 21:30:20 -05:00
John Sully 3e632d80da TLS Thread Safety fixes
Former-commit-id: e98a5fc108c5448307a8cc38182c79263f01102a
2020-01-29 21:21:47 -05:00
John Sully 476ed25b4c fix leak in cron
Former-commit-id: c1f4e344bdaf21bc74fae6e1b0cb7fc1ce687e62
2020-01-29 19:03:18 -05:00
John Sully 91b61b8d7d Merge branch 'redis_merge' into keydb_pro_merge
Former-commit-id: e4f455a991b468a7abea169e5672d3039a8645f9
2020-01-29 15:57:43 -05:00
John Sully cc44673870 Merge branch 'redis_merge' into keydb_pro_merge
Former-commit-id: e4f455a991b468a7abea169e5672d3039a8645f9
2020-01-29 15:57:43 -05:00
John Sully 7d51657b73 TLS compile fixes
Former-commit-id: 0516809832cf22557592d15f39d64162fcd5083d
2020-01-29 15:57:25 -05:00
John Sully 9889ff22a9 Merge branch 'redis_merge' into keydb_pro_merge
Former-commit-id: e10d9de29059f42193560712991df0950eeef679
2020-01-29 13:43:45 -05:00
John Sully 417c99f963 Merge branch 'redis_merge' into keydb_pro_merge
Former-commit-id: e10d9de29059f42193560712991df0950eeef679
2020-01-29 13:43:45 -05:00
John Sully 6e1aefc675 Fix active rep not merging on sync and add tests
Former-commit-id: fcb77d0431b195553eb1cd563286e5441f0c94cd
2020-01-29 13:26:04 -05:00
John Sully 035ed9712c Merge KeyDB 6
Former-commit-id: 9129b98c12b0da856bbda3eb68b4ddc7530693c9
2020-01-29 12:55:23 -05:00
John Sully ee520d4f7f Merge KeyDB 6
Former-commit-id: 9129b98c12b0da856bbda3eb68b4ddc7530693c9
2020-01-29 12:55:23 -05:00
John Sully 1e465a7ac8 Yet more multithreading fixes
Former-commit-id: 9f23062ebdf389f0c95e1f4ab22c36ca96060e1f
2020-01-28 21:42:55 -05:00
John Sully 4021faa713 failure to post a function is not fatal unless we wrote part of a command (should be impossible)
Former-commit-id: e1c642a033ab0157a66571189e81817cb84fd421
2020-01-28 21:41:56 -05:00
John Sully f5e5c13762 CRON jobs were running half as often as required
Former-commit-id: cc6df8ce9ee6697807a3c1e3d62c0b1a8463f039
2020-01-28 21:40:40 -05:00
John Sully f4ba29a73d CRON jobs were running half as often as required
Former-commit-id: a8f758144b8d79f9816ede3ae86c5c2d5d7d10dd
2020-01-28 21:39:56 -05:00
John Sully f3e2377839 Support C++14 and remove dependency on future standard 2a
Former-commit-id: 7ba1920069821bf369cae40926e0ac82923ad784
2020-01-28 19:06:33 -05:00
John Sully 3a4e936a80 More threading fixes from merge
Former-commit-id: 1542b06ddf6cfd52061a90c2e59b80f455298ffe
2020-01-28 17:54:00 -05:00
John Sully aba9864c16 reenable multithreading after merge
Former-commit-id: e3bde46b8a071327ba4381fad96fe5975cd759c5
2020-01-27 19:59:04 -05:00
John Sully 70fadafd49 cron reliability
Former-commit-id: 325857f684b3f6512a36946271593567244d0470
2020-01-27 18:31:02 -05:00
John Sully fb7e05e4c3 fix expire test failures during overwrite
Former-commit-id: 452e1ee9335801fd85e6b6cedbf2d4fe4abeb8de
2020-01-27 18:26:23 -05:00
John Sully 1bfe7d0804 Fix most tests (still some failures)
Former-commit-id: 5a7b9a3b1e3b6cb8e2aa2b18e96b5c0c13a59c8a
2020-01-27 18:16:19 -05:00
John Sully d815f5e0b5 Merge remote-tracking branch 'redis/6.0' into redis_merge
Former-commit-id: 6c77453720e0451158376df5511ed8c121d47d35
2020-01-27 02:55:48 -05:00
John Sully 60d8d53f7a Missing cron files
Former-commit-id: 2e2dbe83a072873392ce4b3b7fe65efe5b0f6a4d
2020-01-21 19:51:16 -05:00
John Sully bc59c77c7a Initial implementation of the CRON command
Former-commit-id: 252be9ef448c7d702ca30f24df684bffb427b317
2020-01-21 19:50:28 -05:00
John Sully 39bff104c9 Bump version
Former-commit-id: db165cadc280d6e9220ba451701e65bb8ae71b00
2020-01-20 19:20:50 -05:00
John Sully eef595ed2d Fix build break for X64
Former-commit-id: 76590fdce3ccf7bf3124832f6034c31caf7a8269
2020-01-12 01:28:30 -05:00
John Sully 5523e73b64 Fix build break for X64
Former-commit-id: 76590fdce3ccf7bf3124832f6034c31caf7a8269
2020-01-12 01:28:30 -05:00
John Sully bc84e6ca67 Merge branch 'keydbpro' of https://github.com/JohnSully/KeyDB-Pro into keydbpro
Former-commit-id: 4f39ca139f15a5f585f829937a46a56f20644db0
2020-01-12 01:27:22 -05:00
John Sully b86875766f Merge branch 'keydbpro' of https://github.com/JohnSully/KeyDB-Pro into keydbpro
Former-commit-id: 4f39ca139f15a5f585f829937a46a56f20644db0
2020-01-12 01:27:22 -05:00
John Sully 3d652e8c09 Fix snapshot consolidation bugs and reduce log noise
Former-commit-id: 7f3cb2981529277d3f02dceb2f60e7aa8385847d
2020-01-12 01:22:44 -05:00
John Sully 423f462c88 Fix snapshot consolidation bugs and reduce log noise
Former-commit-id: 7f3cb2981529277d3f02dceb2f60e7aa8385847d
2020-01-12 01:22:44 -05:00
John Sully 4fbc2c8076 remove debug printfs
Former-commit-id: 3dbd455321e4a2ee47a24662e164eac0e5614965
2020-01-12 01:20:52 -05:00
John Sully 59f32f2e6f remove debug printfs
Former-commit-id: 3dbd455321e4a2ee47a24662e164eac0e5614965
2020-01-12 01:20:52 -05:00
John Sully 2a80007451 Merge branch 'moar_perf' into keydbpro_moarperf
Former-commit-id: d0990a465c3c5c29b71f239d84a875af40699281
2020-01-11 22:06:20 -05:00
John Sully 63c374627a Merge branch 'moar_perf' into keydbpro_moarperf
Former-commit-id: d0990a465c3c5c29b71f239d84a875af40699281
2020-01-11 22:06:20 -05:00
John Sully bbba342da8 Avoid locking as late as possible
Former-commit-id: 0d647af1f0844dc5277ae4bd5992d4380ecffc73
2020-01-11 19:28:13 -05:00
John Sully ba6270c4ee Merge branch 'unstable' of https://github.com/JohnSully/KeyDB into unstable
Former-commit-id: bc4121777f92e1730c11a5f0d735c066697fc79b
2020-01-11 16:35:06 -05:00
John Sully 017468577b Avoid crash due to excessive posted functions for AOF rewrite
Former-commit-id: eb0246382fcd9e4091966f0138aa1f01938ab9a6
2020-01-11 16:34:30 -05:00
John Sully 0e67292d01 Avoid crash due to excessive posted functions for AOF rewrite
Former-commit-id: 777129934e6d4e8f3cc189ad8607283f5b13cf2c
2020-01-11 16:34:09 -05:00
John Sully 71c926ecc0 Merge branch 'unstable' into RELEASE_5
Former-commit-id: dbbd20bcef39a7580afce09969e8112dee8d08fe
2020-01-10 17:46:23 -05:00
John Sully 345e66cc37 Ignore other flags after pro is enabled since we won't understand them
Former-commit-id: 9bbb5fdb3d3e2b40fc9536dde78e380db6867408
2020-01-10 17:46:02 -05:00
John Sully 8c7930daa8 Update README.md
Former-commit-id: 51c522152786d003b26c17f4dcb4c2b73548b559
2020-01-10 14:21:11 -05:00
John Sully d0b2b67836 Update graphs
Former-commit-id: 583dc7ef668d5855c1037800385c52180f96a497
2020-01-10 14:19:44 -05:00
John Sully c99154e3af Merge branch 'unstable' into RELEASE_5
Former-commit-id: 5edbc2b2fc8b051ffb45941a8163f0e34a12ac0b
2020-01-06 14:24:49 -05:00
John Sully 9d17d6a0bb pro launch should respect KEYDB_PRO_DIRECTORY
Former-commit-id: 76c596884c8e291eacf6188fcd839d416b9b3aa8
2020-01-06 14:24:37 -05:00
John Sully 40d52e3611 Add license key lib for aarch64
Former-commit-id: 8b804d91e3dc810b6d8cc585dd3747ba962ead18
2020-01-06 19:16:48 +00:00
John Sully f023696345 Add license key lib for aarch64
Former-commit-id: 8b804d91e3dc810b6d8cc585dd3747ba962ead18
2020-01-06 19:16:48 +00:00
John Sully 76be9ec3d0 Bump version
Former-commit-id: 4770a5f208a417d2a5b31d76bc766941c2059926
2020-01-06 12:07:57 -05:00
John Sully 35e7b88a75 Merge branch 'unstable' into RELEASE_5
Former-commit-id: e2afb5a74459884ad6959cffa8cf07a731db8c07
2020-01-06 12:07:11 -05:00
John Sully 0d5dd27136 Merge branch 'unstable' of https://github.com/JohnSully/KeyDB into unstable
Former-commit-id: 08f9a2bdb34a3370408a35dbb5cb9d5341c63c14
2020-01-06 12:04:00 -05:00
John Sully d530ae0efa Merge branch 'keydbpro' of https://github.com/JohnSully/KeyDB-Pro into keydbpro
Former-commit-id: 3d63d38aae762c60a22154109827ebfd46aae2a5
2020-01-05 20:19:55 -05:00
John Sully 55b0e44b35 Merge branch 'keydbpro' of https://github.com/JohnSully/KeyDB-Pro into keydbpro
Former-commit-id: 3d63d38aae762c60a22154109827ebfd46aae2a5
2020-01-05 20:19:55 -05:00
John Sully 0702f54742 Add new flags to example configuration file
Former-commit-id: 752c4854ec62752c2ab5bac23ffc8f0a04451dd1
2020-01-05 20:19:28 -05:00
John Sully bb356920c7 Enforce seperate license keys for connected replicas
Former-commit-id: bc005cb50b1010a2bc9170e261cd93dba849c35f
2020-01-04 17:15:06 -05:00
John Sully 8eec466d49 Enforce seperate license keys for connected replicas
Former-commit-id: bc005cb50b1010a2bc9170e261cd93dba849c35f
2020-01-04 17:15:06 -05:00
John Sully a15c350d08 Additional flash tests
Former-commit-id: 3f9b1a35821cb3a3bf82aabb180c13a9eddf4e93
2020-01-03 17:11:23 -05:00
John Sully 6d12595143 Additional flash tests
Former-commit-id: 3f9b1a35821cb3a3bf82aabb180c13a9eddf4e93
2020-01-03 17:11:23 -05:00
John Sully aeb32b2a66 Fix crash with subkey expire
Former-commit-id: 8e1d416714484ff6ff4242c5d9a24b1458bbfb7b
2020-01-03 17:06:07 -05:00
John Sully b85237fa69 Fix crash with subkey expire
Former-commit-id: 8e1d416714484ff6ff4242c5d9a24b1458bbfb7b
2020-01-03 17:06:07 -05:00
John Sully 2d37625f56 Merge branch 'unstable' into keydbpro
Former-commit-id: 76ddbed0708277443660ffab2a2289e120fe87cd
2020-01-03 16:53:40 -05:00
John Sully f3670fc38b Merge branch 'unstable' into keydbpro
Former-commit-id: 76ddbed0708277443660ffab2a2289e120fe87cd
2020-01-03 16:53:40 -05:00
John Sully e9d599c195 subkey expire testes
Former-commit-id: 47c17c4b66434167ced345c21cdcaecc401b17f2
2020-01-03 16:50:13 -05:00
John Sully c645cbcdc5 Add support for storing expirations in FLASH
Former-commit-id: 1dca07bd564042fce1b01d275641f35b918ae557
2020-01-03 15:53:36 -05:00
John Sully a295d987e2 Add support for storing expirations in FLASH
Former-commit-id: 1dca07bd564042fce1b01d275641f35b918ae557
2020-01-03 15:53:36 -05:00
John Sully 2f322f91ac Drop severity of master disconnect log when multimaster is enabled
Former-commit-id: 315212c426ad3c91466882a4f4f18ec8ddd9c9f3
2020-01-02 15:36:02 -05:00
John Sully e9d1c720fe Fix issue where expire is lost when performing a defrag
Former-commit-id: b2a8287270dc8a15f15cfcbb9267d11ce02553c9
2020-01-01 20:41:17 -05:00
John Sully cf4f8ed3a8 C++ wrapper classes for SDS
Former-commit-id: a649300ed28d4c6954af965b7bb8c65a6e028c23
2020-01-01 19:13:48 -05:00
John Sully 460085a1c0 Fix issue #130 due to fastlock timeout reduction
Former-commit-id: d670d17e926bef53596a194e6bec1b04be3f4005
2020-01-01 11:52:00 -05:00
John Sully cf178e36b6 Merge branch 'unstable' into keydbpro
Former-commit-id: 7ddcbb8ec0c842bd4a79b6e14ebd33616174e793
2019-12-27 18:17:36 -05:00
John Sully b0eae7b9d9 Merge branch 'unstable' into keydbpro
Former-commit-id: 7ddcbb8ec0c842bd4a79b6e14ebd33616174e793
2019-12-27 18:17:36 -05:00
John Sully 61ed2d7204 Fix some static analysis warnings
Former-commit-id: e6969d28863a696e53fd68b70f55a83fd8f0dc02
2019-12-27 18:17:22 -05:00
John Sully 0336682223 Merge branch 'keydbpro' of https://github.com/JohnSully/KeyDB-Pro into keydbpro
Former-commit-id: b52725163ec6ea128102880be33c43437693cc9e
2019-12-27 17:46:51 -05:00
John Sully d6340577a2 Merge branch 'keydbpro' of https://github.com/JohnSully/KeyDB-Pro into keydbpro
Former-commit-id: b52725163ec6ea128102880be33c43437693cc9e
2019-12-27 17:46:51 -05:00
John Sully 28b7af218e Ignore dependency files
Former-commit-id: f18d973adcf38483400edac85e9258c37aa4e8e5
2019-12-27 17:46:16 -05:00
John Sully 50ea91c06a Ignore dependency files
Former-commit-id: f18d973adcf38483400edac85e9258c37aa4e8e5
2019-12-27 17:46:16 -05:00
John Sully 6722c5880f Ignore dependency files
Former-commit-id: ad0d51cdf102c430d4f35f7cd6eef4f6f0c05b96
2019-12-27 17:45:56 -05:00
John Sully 62ac2d08a4 Merge keydb community
Former-commit-id: b9dcd0997c3dfd3cd2a5908ba540bc4d389104a0
2019-12-27 17:44:48 -05:00
John Sully 63a2b84616 Merge keydb community
Former-commit-id: b9dcd0997c3dfd3cd2a5908ba540bc4d389104a0
2019-12-27 17:44:48 -05:00
John Sully a25a6226fb Make incremental building work with header files
Former-commit-id: 1fb8e73f08d52a38f31d4274943ddae129e9963a
2019-12-27 17:34:41 -05:00
John Sully b7cb9949c5 recommended rocksdb tuning
Former-commit-id: 2a634365f901968f9758d2d362f211b8e0fddc2a
2019-12-24 02:22:47 -05:00
John Sully cf8af9d405 recommended rocksdb tuning
Former-commit-id: 2a634365f901968f9758d2d362f211b8e0fddc2a
2019-12-24 02:22:47 -05:00
John Sully ded345bab6 Track key count accurately before we've committed to the database. Also use this to optimize DB lookups when all keys are in memory
Former-commit-id: 78c07f0276109a085761b7044d4edc63af26d3da
2019-12-24 00:03:38 -05:00
John Sully ed59f30fc0 Track key count accurately before we've committed to the database. Also use this to optimize DB lookups when all keys are in memory
Former-commit-id: 78c07f0276109a085761b7044d4edc63af26d3da
2019-12-24 00:03:38 -05:00
John Sully 5b1e6f0638 Perf remove extra lookup in rocksdb
Former-commit-id: 8074472c7a25572a53f1166911920c2cb168c141
2019-12-23 23:32:04 -05:00
John Sully 582980e753 Perf remove extra lookup in rocksdb
Former-commit-id: 8074472c7a25572a53f1166911920c2cb168c141
2019-12-23 23:32:04 -05:00
John Sully a1d2d9f1d9 More testing
Former-commit-id: 564d94f0653315ce05495a8d83ff8577a365c11b
2019-12-23 22:14:43 -05:00
John Sully 0100dc86ad More testing
Former-commit-id: 564d94f0653315ce05495a8d83ff8577a365c11b
2019-12-23 22:14:43 -05:00
John Sully c618597a46 Fix issue where database size is off when setting key with expire
Former-commit-id: 7796918bfb4a98bc056b3b8f4065f1416da8d89a
2019-12-23 22:07:33 -05:00
John Sully 3020f88e87 Fix issue where database size is off when setting key with expire
Former-commit-id: 7796918bfb4a98bc056b3b8f4065f1416da8d89a
2019-12-23 22:07:33 -05:00
John Sully 668339750d Add missing files
Former-commit-id: 4eadf8f0923ee70ffa3af329a4d636d508bfad8d
2019-12-23 19:07:53 -05:00
John Sully e839ffc3cc Add missing files
Former-commit-id: 4eadf8f0923ee70ffa3af329a4d636d508bfad8d
2019-12-23 19:07:53 -05:00
John Sully d14f8111af Add more test code, and fix bugs uncovered
Former-commit-id: 5362fa4b62f89cbc1e92e01c73a45c4e3718708b
2019-12-23 17:17:41 -05:00
John Sully d8d359ca8e Add more test code, and fix bugs uncovered
Former-commit-id: 5362fa4b62f89cbc1e92e01c73a45c4e3718708b
2019-12-23 17:17:41 -05:00
John Sully 6730f10af7 Key count is innacurate after overwrite
Former-commit-id: 180c5a8e401415cede36548ab8d01f3e4ff8fb7f
2019-12-22 19:41:36 -05:00
John Sully 6edce37d27 Key count is innacurate after overwrite
Former-commit-id: 180c5a8e401415cede36548ab8d01f3e4ff8fb7f
2019-12-22 19:41:36 -05:00
John Sully c7097327cb Add additional tests
Former-commit-id: e7d2c78e776b8262fd54caeb7b6bd210182e9bdb
2019-12-22 19:16:30 -05:00
John Sully 78cca4565c Add additional tests
Former-commit-id: e7d2c78e776b8262fd54caeb7b6bd210182e9bdb
2019-12-22 19:16:30 -05:00
John Sully 1dd79343c0 Fix FLASH eviction issue, the algo relies on correct key count
Former-commit-id: dc260a7f44fe197b9b0022d044d559be88bf91be
2019-12-22 18:38:10 -05:00
John Sully 11785d42e6 Fix FLASH eviction issue, the algo relies on correct key count
Former-commit-id: dc260a7f44fe197b9b0022d044d559be88bf91be
2019-12-22 18:38:10 -05:00
John Sully c28fa2f034 Optimization fails because dbAdd() will ensure the key
Former-commit-id: 1448b555c49fb5ba4a573a97681f7843ba02141f
2019-12-22 17:49:54 -05:00
John Sully acc7c35e71 Optimization fails because dbAdd() will ensure the key
Former-commit-id: 1448b555c49fb5ba4a573a97681f7843ba02141f
2019-12-22 17:49:54 -05:00
John Sully a64337e2d4 Merge remote-tracking branch 'nonfree/tests' into keydbpro
Former-commit-id: 180b059c05290aa403197bca819ec092c5ab326d
2019-12-22 17:31:05 -05:00
John Sully aec58edc35 Merge remote-tracking branch 'nonfree/tests' into keydbpro
Former-commit-id: 180b059c05290aa403197bca819ec092c5ab326d
2019-12-22 17:31:05 -05:00
John Sully e602ce7148 Fix issue where DELETE always returns 1 when using FLASH
Former-commit-id: 0574db59fdc740255388ae77d2ece8622898bb49
2019-12-22 17:30:15 -05:00
John Sully 2b2cc9124a Fix issue where DELETE always returns 1 when using FLASH
Former-commit-id: 0574db59fdc740255388ae77d2ece8622898bb49
2019-12-22 17:30:15 -05:00
John Sully f2a6017dff Multimaster requires Active Replication
Former-commit-id: 4dae1391b802521cb72bb945deece9046e50c667
2019-12-21 18:24:02 -05:00
Petr Vaněk 490db098b6 Rename redis.conf to keydb.conf
Former-commit-id: 22632f5f20284bbb19234056135aacc418de3035
2019-12-21 15:00:24 -05:00
Petr Vaněk 9736adde7f Rename default pid file
Former-commit-id: 7ba779c4cd80a7b32181d2a3b3e6cba95bf9c075
2019-12-21 15:00:24 -05:00
John Sully ab1e075297 Only override maxmemory settings if everything is default
Former-commit-id: 9fb240d49c61f5a69124a17cfc769095cadd3d98
2019-12-20 18:19:24 -05:00
John Sully 12ac880e82 Only override maxmemory settings if everything is default
Former-commit-id: 9fb240d49c61f5a69124a17cfc769095cadd3d98
2019-12-20 18:19:24 -05:00
John Sully 40637e12e9 Evicted flash no longer keeps the key around
Former-commit-id: 908b303d1a8dd032c092f0bc035361a09c0291a5
2019-12-20 17:45:07 -05:00
John Sully 7fbcf8a2e6 Evicted flash no longer keeps the key around
Former-commit-id: 908b303d1a8dd032c092f0bc035361a09c0291a5
2019-12-20 17:45:07 -05:00
John Sully d60bedff92 FLASH storage no longer keeps evicted keys in memory
Former-commit-id: 65c2b47c895d57231bbd3f451ecf1f6d9871f5f7
2019-12-19 17:30:31 -05:00
John Sully 8604bc7dbc FLASH storage no longer keeps evicted keys in memory
Former-commit-id: 65c2b47c895d57231bbd3f451ecf1f6d9871f5f7
2019-12-19 17:30:31 -05:00
John Sully 083845cf9c tests should use the new binary name
Former-commit-id: b4ee3c4ea57041d7c87ec228994ff5397bb6139f
2019-12-19 17:13:51 -05:00
John Sully 27e79af326 tests should use the new binary name
Former-commit-id: b4ee3c4ea57041d7c87ec228994ff5397bb6139f
2019-12-19 17:13:51 -05:00
John Sully b976be741d Fix crash when using rocksdb and jemalloc but scope it to just jemalloc
Former-commit-id: 6fa0cfd35fd1158f190db27bfb734ea2f763cb20
2019-12-19 15:44:09 -05:00
John Sully a6d5b0c6d1 Fix crash when using rocksdb and jemalloc but scope it to just jemalloc
Former-commit-id: 6fa0cfd35fd1158f190db27bfb734ea2f763cb20
2019-12-19 15:44:09 -05:00
John Sully 7604af108f add missing file
Former-commit-id: 24e85bc84f58bbfbef973eab64017a08e3f34d7d
2019-12-18 13:38:59 -05:00
John Sully bb9c3b2525 add missing file
Former-commit-id: 24e85bc84f58bbfbef973eab64017a08e3f34d7d
2019-12-18 13:38:59 -05:00
benschermel 4882b1de4e adding flash test
Former-commit-id: 879b17c053695ee09562e2ec320e269141e31fdb
2019-12-18 00:47:08 -05:00
benschermel d7a8e4bce2 adding flash test
Former-commit-id: 879b17c053695ee09562e2ec320e269141e31fdb
2019-12-18 00:47:08 -05:00
benschermel 52f80fd27e adding flash test
Former-commit-id: 8c0f0bd1b5c83027e64765f9942f284bdb8ebcb4
2019-12-18 00:24:07 -05:00
benschermel 90016d51cb adding flash test
Former-commit-id: 8c0f0bd1b5c83027e64765f9942f284bdb8ebcb4
2019-12-18 00:24:07 -05:00
John Sully 97cc5473db Implement subkey expires for sorted sets
Former-commit-id: 99a651ebc0a6c8347e363f88d01ba9a2a60d72b8
2019-12-18 00:10:05 -05:00
John Sully e8f1a0f7b5 Implement subkey expire for hashes
Former-commit-id: 0df57b1a599bb36188307259fadccf6f62c6a81a
2019-12-18 00:04:48 -05:00
John Sully b1137c0fc2 Launch the pro binary with --enable-pro
Former-commit-id: 0ff9e3683b5de8545a0a76715985c452d6033d8f
2019-12-17 23:52:19 -05:00
John Sully 2c78c504ae rename binary to keydb-pro-server
Former-commit-id: 717dd64fe33b997e8d05ca9ebfb598dbe1605990
2019-12-17 23:43:14 -05:00
John Sully 9a9a4643dd rename binary to keydb-pro-server
Former-commit-id: 717dd64fe33b997e8d05ca9ebfb598dbe1605990
2019-12-17 23:43:14 -05:00
John Sully 77d878cf67 Ignore enable-pro with no license key. makes it easier to launch a demo from the open source version
Former-commit-id: 31ab6bcd6f39f0a4a9e50a5af613b293eecfb4c2
2019-12-17 23:40:59 -05:00
John Sully d104465d84 Ignore enable-pro with no license key. makes it easier to launch a demo from the open source version
Former-commit-id: 31ab6bcd6f39f0a4a9e50a5af613b293eecfb4c2
2019-12-17 23:40:59 -05:00
John Sully 5ff2943b66 Implement license key checks
Former-commit-id: 62ed5b2956aebe70ef8cf758888098e1f4bb530b
2019-12-17 23:35:14 -05:00
John Sully 348ebea0d5 Implement license key checks
Former-commit-id: 62ed5b2956aebe70ef8cf758888098e1f4bb530b
2019-12-17 23:35:14 -05:00
John Sully f27b84b67c Implement pro badge and trial timeout
Former-commit-id: 9d6a284eb45c8a137c7f59645294b4fa4be389e5
2019-12-17 20:32:53 -05:00
John Sully f0cdad2c19 Implement pro badge and trial timeout
Former-commit-id: 9d6a284eb45c8a137c7f59645294b4fa4be389e5
2019-12-17 20:32:53 -05:00
John Sully 576f358078 Merge branch 'unstable' into advanced_db
Former-commit-id: 1f9cb22fd370741c2f60517376af5008c25704f5
2019-12-17 19:00:02 -05:00
John Sully 45feae74c0 Merge branch 'unstable' into advanced_db
Former-commit-id: 1f9cb22fd370741c2f60517376af5008c25704f5
2019-12-17 19:00:02 -05:00
John Sully 2c3d96dda8 Fix type in makefile
Former-commit-id: e4ecea416a0750cc23d23ff5587950123fe19073
2019-12-17 18:23:19 -05:00
John Sully 17e5f75e1e Enusre CXXFLAGS has the same settings as CFLAGS
Former-commit-id: 1a03e6c3e82198af6f0f2cf00b7b43fc65ff36cf
2019-12-17 17:49:51 -05:00
Petr Vaněk dbd86c4c27 Correct C++ related makefile variables
FINAL_CXXFLAGS should not inherit CFLAGS because they can contain C
specific options unsupported by C++.

REDIS_CXX should point to the C++ compiler rather than C.


Former-commit-id: 76daee5b310ea7eade65d7550a6e0cb2c89f82e0
2019-12-17 17:43:15 -05:00
John Sully dc82ff4139 Perf fixes for expire snapshots
Former-commit-id: da805e4442815c89e85ca7b9fc855dd11ef2a6c8
2019-12-17 17:39:04 -05:00
John Sully 7fb96a349c Perf fixes for expire snapshots
Former-commit-id: da805e4442815c89e85ca7b9fc855dd11ef2a6c8
2019-12-17 17:39:04 -05:00
John Sully aff0d270e1 Threading fixes
Former-commit-id: 4f1cec6abd72d6e215880f2ce7812e88509cd218
2019-12-16 22:08:18 -05:00
John Sully 6acd0680d7 Threading fixes
Former-commit-id: 4f1cec6abd72d6e215880f2ce7812e88509cd218
2019-12-16 22:08:18 -05:00
John Sully 7877c12732 complete snapshot handling of expires, may still be perf issues
Former-commit-id: 7c6cf4ba4696ba8a7b4069491e8ad0a583958bdc
2019-12-16 22:07:53 -05:00
John Sully f1b7575719 complete snapshot handling of expires, may still be perf issues
Former-commit-id: 7c6cf4ba4696ba8a7b4069491e8ad0a583958bdc
2019-12-16 22:07:53 -05:00
John Sully 09e774ebbd snapshots no longer have dangling keys in the expire set
Former-commit-id: 939b6b61084fbec7b7bd0ada49f6853e334f87dd
2019-12-16 21:14:16 -05:00
John Sully 6d41d774ba snapshots no longer have dangling keys in the expire set
Former-commit-id: 939b6b61084fbec7b7bd0ada49f6853e334f87dd
2019-12-16 21:14:16 -05:00
John Sully 709825a5d9 SDS refcounted type
Former-commit-id: 361d0308febd5da0c7291469ea7e922e7147c1d6
2019-12-16 20:16:51 -05:00
John Sully 6fca46cb02 SDS refcounted type
Former-commit-id: 361d0308febd5da0c7291469ea7e922e7147c1d6
2019-12-16 20:16:51 -05:00
John Sully 080b023e3d Extra expire validation on save
Former-commit-id: 037290cd2ec1b237df5236a86915d63d53fb48ce
2019-12-16 20:16:07 -05:00
John Sully 2ab9bbc36a Extra expire validation on save
Former-commit-id: 037290cd2ec1b237df5236a86915d63d53fb48ce
2019-12-16 20:16:07 -05:00
John Sully 06b93999a4 Merge the expire datastructs on endsnapshot
Former-commit-id: 968681ac37d1505a7b38628425f60e08b2cd41c4
2019-12-16 20:13:19 -05:00
John Sully 14197490b0 Merge the expire datastructs on endsnapshot
Former-commit-id: 968681ac37d1505a7b38628425f60e08b2cd41c4
2019-12-16 20:13:19 -05:00
John Sully aea9d6beb9 We shouldn't define libc functions...
Former-commit-id: 9da8b7e25b8f423dc0efa54f49307c425eeabc55
2019-12-16 20:11:01 -05:00
John Sully 6737e10f31 We shouldn't define libc functions...
Former-commit-id: 9da8b7e25b8f423dc0efa54f49307c425eeabc55
2019-12-16 20:11:01 -05:00
John Sully b1622e7558 Expireset should do a deep hash
Former-commit-id: cdcdf57dd1419ec09eab6579caf5e5ff9a5a242c
2019-12-16 19:06:07 -05:00
John Sully 0655825ea7 Expireset should do a deep hash
Former-commit-id: cdcdf57dd1419ec09eab6579caf5e5ff9a5a242c
2019-12-16 19:06:07 -05:00
John Sully 62c0d244c2 The mitigation was bogus, fix it so it works
Former-commit-id: c7f1e069bf7e7b6f5321f920af9a0ed80f3853b0
2019-12-16 18:40:55 -05:00
John Sully 42c1b90961 The mitigation was bogus, fix it so it works
Former-commit-id: c7f1e069bf7e7b6f5321f920af9a0ed80f3853b0
2019-12-16 18:40:55 -05:00
John Sully bdb97984bb IStorage related build issues
Former-commit-id: 45bc344bfe678a633a005506a690e86ddf2efd5f
2019-12-16 18:32:30 -05:00
John Sully fd079de3e8 IStorage related build issues
Former-commit-id: 45bc344bfe678a633a005506a690e86ddf2efd5f
2019-12-16 18:32:30 -05:00
Petr Vaněk 02c190c827 readme: fix typo
Former-commit-id: 9cc1137e35e4dca0790c27857f59737792caf815
2019-12-16 15:40:09 -05:00
John Sully 77e89a555a Try harder to free memory
Former-commit-id: 48f7c34c91c51ef06d9a1f4e8bc5f1f5cd88cfaa
2019-12-14 19:46:39 -05:00
John Sully 1b922dbc51 Try harder to free memory
Former-commit-id: 48f7c34c91c51ef06d9a1f4e8bc5f1f5cd88cfaa
2019-12-14 19:46:39 -05:00
John Sully dfb39344dc A bunch of bug fixes
Former-commit-id: 228339586a19874f869cf45dc3834a270f99768a
2019-12-10 01:01:45 -05:00
John Sully 6e026711f9 A bunch of bug fixes
Former-commit-id: 228339586a19874f869cf45dc3834a270f99768a
2019-12-10 01:01:45 -05:00
John Sully 93a3929918 Make the storage provider configurable, and show it in the info command
Former-commit-id: e201ce622ff3c7832d03c6b5759386f0efc23cdf
2019-12-09 21:07:37 -05:00
John Sully f6616bf89e Make the storage provider configurable, and show it in the info command
Former-commit-id: e201ce622ff3c7832d03c6b5759386f0efc23cdf
2019-12-09 21:07:37 -05:00
John Sully 645b94ba0c Add support for multiple databases with rocksdb
Former-commit-id: cfa3b760b00776876134692d42e25a60fcd8dea9
2019-12-09 20:45:58 -05:00
John Sully e9b2c28e1f Add support for multiple databases with rocksdb
Former-commit-id: cfa3b760b00776876134692d42e25a60fcd8dea9
2019-12-09 20:45:58 -05:00
Tais P. Hansen c5ea4d8def Fix keydb-cli crashing on read-only filesystem
Former-commit-id: 7fda84f7f03ebb8b78515ec8416357bf4c597336
2019-12-09 14:23:10 -05:00
John Sully 86419a30e7 Flash running well
Former-commit-id: 9cf393eb9fb69bcc7550cd8b83e1568b3f360310
2019-12-08 20:06:22 -05:00
John Sully f90fc5ed63 Flash running well
Former-commit-id: 9cf393eb9fb69bcc7550cd8b83e1568b3f360310
2019-12-08 20:06:22 -05:00
John Sully 35187dafb1 modify how the database array is stored so swaps are easier
Former-commit-id: 48fd6ec5ca69dd505d0e757862c09a898c19cf22
2019-12-08 16:49:59 -05:00
John Sully 869a09bcca modify how the database array is stored so swaps are easier
Former-commit-id: 48fd6ec5ca69dd505d0e757862c09a898c19cf22
2019-12-08 16:49:59 -05:00
John Sully 5fc1dffd0f Prevent extra copy of key
Former-commit-id: 9c3ef97039e59c6b820f71a90f8a9fb4eae8a7b1
2019-12-08 16:02:24 -05:00
John Sully b2db7e7887 Prevent extra copy of key
Former-commit-id: 9c3ef97039e59c6b820f71a90f8a9fb4eae8a7b1
2019-12-08 16:02:24 -05:00
John Sully b0419d1b2b Optimize remote storage by bulk saving keys after processing operations but before sending responses to clients
Former-commit-id: 63a6dc2a29680d5d3f3f245168ca7de5d6bee1eb
2019-12-08 10:56:05 -05:00
John Sully 253d480bb5 Optimize remote storage by bulk saving keys after processing operations but before sending responses to clients
Former-commit-id: 63a6dc2a29680d5d3f3f245168ca7de5d6bee1eb
2019-12-08 10:56:05 -05:00
John Sully c4e132a721 Initial RocksDB integration
Former-commit-id: 0de9e5b692c02e779e538ddd0a56d10215e501bb
2019-12-06 20:39:32 -05:00
John Sully 18277ba293 Initial RocksDB integration
Former-commit-id: 0de9e5b692c02e779e538ddd0a56d10215e501bb
2019-12-06 20:39:32 -05:00
John Sully 6ba6a24b0a Fixup IStorage uses
Former-commit-id: 5ea0ce143a79365fb3903c6fc7caeb1c9760b0cc
2019-12-06 17:43:28 -05:00
John Sully 40ac1ce547 Fixup IStorage uses
Former-commit-id: 5ea0ce143a79365fb3903c6fc7caeb1c9760b0cc
2019-12-06 17:43:28 -05:00
John Sully 9404391ed2 Initial standup of RocksDB dependency
Former-commit-id: 19bb40ffdc794cf9cafa9f4132a0facf1e074101
2019-12-06 17:33:18 -05:00
John Sully 0fa1f3211a Initial standup of RocksDB dependency
Former-commit-id: 19bb40ffdc794cf9cafa9f4132a0facf1e074101
2019-12-06 17:33:18 -05:00
John Sully 762ef3b584 Fix warning
Former-commit-id: 1d5ae423e039de437e8e48b5d15eb9908846bf04
2019-12-01 20:28:21 -05:00
John Sully 7a806fd610 Fix Issue #107
Former-commit-id: c6bc8d03091c6d66d91d5f9fb390da7119f1b684
2019-12-01 18:17:33 -05:00
John Sully 99c2ae46b9 Merge branch 'unstable' into advanced_db
Former-commit-id: d1ae8f2d1b03c0a79a36d710e4bb6594c37028b4
2019-11-30 00:52:33 -05:00
John Sully 7125ba7397 Fix deadlock in spinlock (mfence) also spin for less time before sleeping
Former-commit-id: 15375a1b499cb728bf2f91ce497e877fe054247c
2019-11-30 00:51:58 -05:00
John Sully e68e9ff76a It is permissible to call dictFind() while iterating
Former-commit-id: 43a598c145d5ea9f2c0b2a16f93f5a8cbb724e7e
2019-11-30 00:03:34 -05:00
John Sully 1afae448a6 Reduce snapshot window to 1 second instead of 10
Former-commit-id: 4f91f0503fe4eea1c20b977a5858ac345c3e7b9b
2019-11-29 22:21:49 -05:00
John Sully ea0211ec31 Bug: only update global flags for sync save
Former-commit-id: f01a7cf59bf965b35e5bb23e3ecbb7265ef8942a
2019-11-29 22:21:17 -05:00
John Sully c83c76b7b3 rehash MS does too little work before checking the time
Former-commit-id: 3e57b5c961f7dd91ddb24331eba9a3fa39b08fdd
2019-11-29 15:18:37 -05:00
John Sully 6c58f58ad3 Nested snapshot garbage collection. Works but huge fragmentation
Former-commit-id: 82b2a3f3dbf8f864d9157655b5422c69845c4019
2019-11-28 19:00:51 -05:00
John Sully 7f9ba0356e Fastlock should yield in ARM
Former-commit-id: 89fa34f5724462b3375cbcba04babd7bff1ee526
2019-11-28 14:26:43 -05:00
John Sully fcdebf8448 Ensure size() count is accurate, and fix find_threadsafe which didn't check children
Former-commit-id: ffa44b636afd4fe907c79fe7deebac3d1e091ee9
2019-11-25 17:50:40 -05:00
John Sully 9088942081 Move snapshot code into its own file
Former-commit-id: 4afd0a6ce650cc93a73ea3e4bb632226087dde37
2019-11-24 17:59:02 -05:00
John Sully 88aaf6feee Restrict the snapshot API
Former-commit-id: cbafb88f267a9480cdbde6a88e9e1992e8a85971
2019-11-24 17:53:06 -05:00
John Sully 893937fdab Get rid of key only iterate, the threadsafe is just as fast and key only users can ignore the robj
Former-commit-id: 29689a5ed6141c5b2019d41ccd4036e6ddd1a121
2019-11-24 15:45:17 -05:00
John Sully d20be920b6 Fix crash on shutdown
Former-commit-id: 6dc55cc0f838b3c82afb233985429b4e7fc5dfb1
2019-11-24 14:24:41 -05:00
John Sully 39244d9038 Fix multithreading data races
Former-commit-id: 80f6e5818fd575cb08a5f620c35eed1cd862eb57
2019-11-24 13:44:43 -05:00
John Sully 69b7399ab3 Fix warning
Former-commit-id: 1318b87013c61f7149127eae8e30caf887a6db7b
2019-11-23 19:19:54 -05:00
John Sully 94bd7d3322 Add support for nesting snapshots
Former-commit-id: 5e6c37f388233cc3f2d204ad17ac2897d3333a21
2019-11-23 19:02:50 -05:00
John Sully 72f675af9e Remove pending async writes if we're freeing the client
Former-commit-id: 8b5caad51136f1ed29a9e4c01ed984f6e7ff9c4c
2019-11-23 19:01:40 -05:00
John Sully 5effaeceb2 Add support for removing pending writes for clients we're about to free
Former-commit-id: 67c1fd322e1a12b1b22707d67713d60c97c34cef
2019-11-23 19:00:27 -05:00
John Sully 39449e6cb6 Add support for nested snapshots
Former-commit-id: 43456c7807152062d59b2a90597b6204f637f5cd
2019-11-22 20:53:36 -05:00
John Sully 3f33731174 Fix crash when client running async keys disconnects before keys finishes
Former-commit-id: dd9233c49d82c89a9d92b7251a56f91c2ee98e77
2019-11-21 20:40:58 -05:00
John Sully b0b236b94a Merge branch 'unstable' into advanced_db
Former-commit-id: 00ad497fb3f409dbfcaa62fa9ea5d793263eb13d
2019-11-21 20:21:48 -05:00
John Sully b4c90f3e99 Bump version
Former-commit-id: fae34bda5543b8aa20d8c91d5b7c1dea229c74c0
2019-11-21 20:16:42 -05:00
John Sully a72e46a4da Merge branch 'unstable' into RELEASE_5
Former-commit-id: da5e975eff2822e65c2f7c8bb76a5ee835b2c1ab
2019-11-21 20:16:23 -05:00
John Sully 5d08ff5ed4 Fix issue #83
Former-commit-id: 1fb6bea2799187e71e8a1a545b2ff5cc6a35ecd4
2019-11-21 20:05:16 -05:00
John Sully 627631dc55 Add missing dependency to dockerfile
Former-commit-id: 1f1a053ccbb05e5c0a767aef15535bd03b030616
2019-11-20 20:35:14 -05:00
John Sully a9d2453710 Merge branch 'unstable' of https://github.com/JohnSully/KeyDB into unstable
Former-commit-id: a3180dfb7ea5a4776ebffcfcc121b8b1328f37bd
2019-11-20 19:44:43 -05:00
John Sully cff0abf580 Fix issue #107, active replicas do their own expires
Former-commit-id: f6af4196efcebb1bdf8e7bfb2625b97158aed993
2019-11-20 19:44:31 -05:00
John Sully aab294ccec Additional asserts ensuring the client is creating on the correct thread
Former-commit-id: efa150b4c8bd1d68225414975fa0560290cb11e4
2019-11-20 17:00:40 -05:00
John Sully c33670455e Update issue templates
Former-commit-id: 9bd5e872362762a1e09d22c83e9dd5420c837bc3
2019-11-20 16:25:33 -05:00
John Sully 0aabc6ebdb Update issue templates
Former-commit-id: e07f9be79b49a9f09122b62d9ca56b5deef290ad
2019-11-20 16:24:23 -05:00
John Sully dff4a45e15 Add missing files
Former-commit-id: 8fa2951e21c5c75a0bb4dc3ef50891123166b76a
2019-11-19 23:03:20 -05:00
John Sully 1fbe8ecad3 Clarify license
Former-commit-id: d0a7f219cd56edbe70bd8e93f21b39e6cd4836e2
2019-11-19 22:22:16 -05:00
John Sully 45794f4155 Run KEYS async
Former-commit-id: 214a54a815ff66ef4a1526da90296787240ecdf9
2019-11-19 22:12:52 -05:00
John Sully 7128c59083 Multiple threads should be able to get the same snapshot provided its not too old
Former-commit-id: 054331098ee18dfb1887fd2b0a67688ef894823e
2019-11-19 17:40:35 -05:00
John Sully 8f802a904a Ensure iterating the keyspace still works during background save
Former-commit-id: 23d7a8a293f253262801bc6ce88ad85e4e38f59a
2019-11-19 15:47:06 -05:00
John Sully 69930b8e48 Final design of forkless background save. expires NYI
Former-commit-id: e2dc24b441bf52b181c820c853e0bc7524254f3f
2019-11-18 19:47:12 -05:00
John Sully bfe21158ab Merge branch 'unstable' into advanced_db
Former-commit-id: 7530d93cd5c4a9fc4e6466abcf96edbdd8daea9e
2019-11-18 15:22:17 -05:00
John Sully f735307b8b Fix failure to wakeup from futex sleep due to fastlock_unlock reading the wrong offset in the asm version. Also fix false sharing in spinlock
Former-commit-id: 4af05e19146f4fba494512240c069dff7d9dafbe
2019-11-17 16:06:49 -05:00
John Sully 4af3901590 Revert "Debug sleep should apply to all threads"
This reverts commit 9ee2be0f86 [formerly 81dc38b3f3903855c66fab4ee895aa41f0217eb8].


Former-commit-id: eba116efee3f01ac6068496a86d91f14b9b28b9c
2019-11-17 15:39:47 -05:00
John Sully 44c8c01d66 Improve perf of reading cluster bitfield
Former-commit-id: b9f712c3fd1d1cd6fe4ca6d58cc4dba40e6b6c95
2019-11-17 14:52:12 -05:00
John Sully 0b0f377538 Merge branch 'unstable' of https://github.com/JohnSully/KeyDB into unstable
Former-commit-id: 71b3ff6f37b34a4865b1a4bbee52758241a10e3b
2019-11-14 21:21:46 -05:00
John Sully 520a1d64ec Cluster multithreading fixes
Former-commit-id: 1baf8fd5c9f8bde73728d831897c4749402fe712
2019-11-14 20:14:24 -05:00
John Sully 9ee2be0f86 Debug sleep should apply to all threads
Former-commit-id: 81dc38b3f3903855c66fab4ee895aa41f0217eb8
2019-11-14 19:57:29 -05:00
John Sully f4b4055980 killing clients should take effect ASAP
Former-commit-id: 3add051cefea27174af7cf031b9592f91a258ea1
2019-11-14 19:49:32 -05:00
John Sully b70a709b5c Improve AE Assert message
Former-commit-id: d0cd1804d173b846fb6bd5f8adfa6681ec5a8f17
2019-11-14 19:34:13 -05:00
John Sully 3b5a55cc66 Fix test failure with tcl8.5 (test only issue)
Former-commit-id: 15641a5070c2958a807c748cf7958e5627ada5c5
2019-11-04 17:31:29 -08:00
John Sully 6d06409ff2 Fix potential race in pubsub
Former-commit-id: 16c7c4a9f8eb1e28c61a2a836513e891a1c0c58d
2019-10-25 02:50:30 -04:00
John Sully 9dcab07b4a Fix potential race in pubsub
Former-commit-id: f68f521d8734b9d2e725ccd9f9414f893dd69c81
2019-10-25 02:44:14 -04:00
John Sully eb0618f9b6 bump version
Former-commit-id: 4315b22b22c5642829429f28a7521acbeca5765f
2019-10-25 01:00:28 -04:00
John Sully 5224419f15 Merge branch 'unstable' into RELEASE_5
Former-commit-id: 231c73a2f282c60d8df288eafcbc929fa9486a01
2019-10-24 23:39:18 -04:00
John Sully 40b7857176 Signals can happen on any thread, so look for the signal handler not the command on the callstack
Former-commit-id: 84c4b017ab720e9044af76882ec992f2c1cd19c0
2019-10-24 23:30:08 -04:00
John Sully aaef04e26d Two fixes: 1) Remove race conditions by not locking clients when async writing. 2) Don't derefence dangling pointers in lambda
Former-commit-id: ce3fcc50e89e74e617dedc07f3d21a0bdf98f75b
2019-10-24 23:07:02 -04:00
John Sully 5baf63a5f1 Sanitizers work with GCC too
Former-commit-id: 3a056f53e9c65df23c56bf11c0396d4f76573830
2019-10-24 23:05:39 -04:00
John Sully f1760c9f0a Remove the DB lock, its unnecessary
Former-commit-id: 066976fe4eef644421dd584246ab56442cd58d36
2019-10-24 20:18:48 -04:00
John Sully 3301cf8cde Remove unlocked KEYS command support, we will do this with snapshotting
Former-commit-id: 3c057f15734380aa1f468788e3e5a92dcdca2009
2019-10-24 20:18:11 -04:00
John Sully 08c04932e0 Build break, ensure C99 compatibility
Former-commit-id: c45063b30d09476ffa3ae0fa9cf0b3f38d44d09c
2019-10-23 13:38:07 -04:00
John Sully 2055bae986 Fix build break in TravisCI
Former-commit-id: aff7fffd2839c3578a6831dd54b0a511d3fefbe4
2019-10-23 13:31:39 -04:00
John Sully 3299e22e76 If a replica is about to be closed, don't wait on its lock (potential deadlock)
Former-commit-id: c39a751453dcc5a3dc5f829a85a4605e1feee203
2019-10-23 13:20:23 -04:00
John Sully 01b344e692 processEventsWhileBlocked needs to release the lock in a safe way
Former-commit-id: 4aaf236bb357e87657ccbb418e5de7229962cc46
2019-10-23 13:19:57 -04:00
John Sully 880a74a499 Remove race conditions
Former-commit-id: 01e0a2d5b43cd403f17afcddb95664921ead1ed6
2019-10-22 23:26:37 -04:00
John Sully a59a0d1d2a Optimize deadlock detection, fix callstack for ASM, and annotate locks
Note: This change moves our assembly code to use the GNU Assembler because NASM seems to be incapable of emitting the necessary debug information for callstack unwinding to work.

Former-commit-id: dca2c55128264a469c59652a1e9a30b8f6373b91
2019-10-22 21:34:51 -04:00
John Sully a5c9221034 Implement deadlock detection
Former-commit-id: b89f6c45e228e27b7f2b5cb055d7e1d768dcd904
2019-10-22 00:43:32 -04:00
John Sully 6cdcc880be Disable multithreaded KEYS due to bugs
Former-commit-id: 69eb966d849340187c3e1388865da5726e614328
2019-10-21 12:21:46 -04:00
John Sully 4daabdfa46 Remove performance zapping test code
Former-commit-id: e63916cf7fe5ea80725ac5e961a069e40f1efac9
2019-10-21 01:48:58 -04:00
John Sully a4323b828b reenable optimized string dup code
Former-commit-id: 11567781d6470bfc385173addc3fa9807e0345d5
2019-10-21 00:08:38 -04:00
John Sully faf7f597e2 Forkless background save. NOT OPTIMIZED
Former-commit-id: 5d1547b128e14973a8bcac2d719d4b8473fa0132
2019-10-20 23:54:05 -04:00
John Sully 931efd3bf8 Factor out dependencies on rdb_child_pid which will be going away
Former-commit-id: 1cdcf666724e14f2b876e1bf69c618f8f583a8a1
2019-10-17 23:10:45 -04:00
John Sully d723cceaf3 Dependencies for forkless RDB saving
Former-commit-id: 202ce77fea75a47aeb92c51a0c603f49803df0c0
2019-10-17 22:53:50 -04:00
John Sully cb4b144981 Ensure RDB saving only uses data from the persistent data struct, and cleanup inheritance
Former-commit-id: 57f8c61ddcc26c64c49a952d619b48ff1e02e5c6
2019-10-17 17:20:47 -04:00
John Sully c2e1af89a9 Support serializing all types
Former-commit-id: ab2d487dfdc91bbd1f4cf7072a129d1dd46ff64f
2019-10-16 14:23:28 -04:00
John Sully 07464f7161 Cleanup inheritance
Former-commit-id: eb5b1fd4ac657f5049aa70e951e0d9ed7b08712e
2019-10-16 13:45:36 -04:00
John Sully dda9ba6a24 Merge branch 'unstable' into advanced_db
Former-commit-id: f464e9159fae1e180b2b06b5fbd70a2db39816ae
2019-10-16 13:23:19 -04:00
John Sully b12a5fd0b5 Merge branch 'unstable' into RELEASE_5
Former-commit-id: 1708d8782c2049b8a8f2a5b7422c11b0b50b4df7
2019-10-16 12:47:06 -04:00
john@csquare.ca 638576cb26 Fix: ExpireMember does not update MVCC timestamp
Former-commit-id: a7510fc1d51e344c37c5ff2a926427036465351f
2019-10-16 12:38:15 -04:00
John Sully 24ac098254 expiremember should return the same results as expire
Former-commit-id: 1e194ba852a29d8e096b3aeeee6c7a0d4746ead3
2019-10-16 12:27:04 -04:00
John Sully 1ba982dc6a Fix crash adding expire to key with a subkey expire already set
Former-commit-id: ae91301dd8519a66446e72000b5dd0cd337eb579
2019-10-16 12:26:48 -04:00
John Sully 44fe48443a Fix clang warnings
Former-commit-id: 450961de2699f6ce08595b56d3fee5d8b9c8f077
2019-10-13 15:48:55 -04:00
John Sully 78ef4b7281 Fix failing travis CI build
Former-commit-id: ad0f8a6f461857b2749166b92e736d8a55e9b8bb
2019-10-13 15:41:53 -04:00
John Sully e1d1496f27 Merge branch 'advanced_db' of https://github.com/JohnSully/redis2 into advanced_db
Former-commit-id: 88154ddd80cbdecbfdf4bd0e7e4202e005488d38
2019-10-13 15:35:30 -04:00
eric-weaver be29e2bb9a add missing dependency
Former-commit-id: f2a974ebe63d4b12340c4a2cc92b76f40e14180d
2019-10-13 21:30:06 +02:00
Segmond 5da03fffab Update README.md
Typo, focuses spelled as focusses

Former-commit-id: b33c0e89235aa171e108a71ac1080d1aef24f4b6
2019-10-13 21:29:15 +02:00
John Sully 3af04c9dad Add the IStorage interface and wire it up
Former-commit-id: 922e1953fcc2f1917d4466cb234f8cb335bbdcee
2019-10-13 15:24:08 -04:00
John Sully 7354033c7c Isolate the persistent parts of the database from the runtime parts
Former-commit-id: f0b9bebad6b71792b2d8999ee3bd531f7e468aed
2019-10-13 15:24:08 -04:00
John Sully 75a71e33ef Hide the database dict
Former-commit-id: e8bcf9dda768ec2cbbe093f74c622daa27c3fc6e
2019-10-13 15:13:01 -04:00
John Sully 20de2531a8 Implement the lastmodified query for the OBJECT command
Former-commit-id: e45a9778a8538cc5a4fce25283f11489958de290
2019-10-13 14:12:09 -04:00
John Sully 996313e78c You are not allowed to set a subkey expire if the subkey does not exist
Former-commit-id: f237c7eb4aee44351ff846d99b8f79a4ea2c101f
2019-10-13 14:11:43 -04:00
John Sully 7420517eb0 Implement the EXPIREMEMBERAT command
Former-commit-id: 9408150a9d0c15a02ff34309a8f3b5f7610037b8
2019-10-13 13:15:13 -04:00
John Sully 2799ec0b9e Add millisecond support for EXPIREMEMBER command
Former-commit-id: e81644edb32eeba37761a0475a30ffad2e4b8f91
2019-10-13 12:57:50 -04:00
John Sully f39e8d7545 Update more slave instances to use replica (Issue #75)
Former-commit-id: 57cf1ee82eabc428d0c61621feb4be403e602a78
2019-10-13 12:29:20 -04:00
John Sully 30d84ce606 Update a few uses of slave to use the new replica terminology (Issue #75)
Former-commit-id: 564ecf4ed5e98ae7f5d4cfefe4f495db940268c2
2019-10-13 12:12:05 -04:00
John Sully 567ed02ac9 Fix an intermittent crash when replicationCron happens before slavesdb is update
Former-commit-id: fe25de309ac9d02399cc7884ab34a3bd582dafd8
2019-10-13 12:04:54 -04:00
John Sully bb5debe8dc Implement TTL and PERSIST commands for subkeys. Also ensure expiremember replaces any old subkey expiries
Former-commit-id: 6089ac634c62c7409449fbd91020407a59e58d52
2019-10-13 12:03:25 -04:00
John Sully 748e5c274f Merge branch 'unstable' of https://github.com/JohnSully/redis2 into unstable
Former-commit-id: 3fadd8c4e8bdb9a1f6723b6ba03c686eaa08259b
2019-10-13 10:03:01 -04:00
John Sully cf5f2399ef Fix issue #88 - don't let seperate KeyDB processes listen on the same port
Former-commit-id: 9b4ef8d6a9d0ad8aba59ebdcca899ad436d8e1aa
2019-10-13 10:02:21 -04:00
John Sully f645dd5769 Bump version
Former-commit-id: 5785598cb77859558caa80c0cb11f0324b68a308
2019-10-01 17:53:48 -04:00
Edgard Lorraine Messias 50c3cf61cc Fixed "Provides" name in chkconfig info
Former-commit-id: 4cb0c9444346c928428c53aa86024effb2339ff5
2019-10-01 13:44:58 -04:00
John Sully 3cd74406aa Merge branch 'unstable' into RELEASE_5
Former-commit-id: 33dcb00b47ec10517604fb7ad0928fe9c4f4a11d
2019-09-30 00:28:12 -04:00
John Sully 28ba013015 Expire DEL command place holder
Former-commit-id: 5e76fd5773e2daa5878f6c029042bf1d7fe4b66c
2019-09-30 00:01:23 -04:00
John Sully 0465db13f7 Fuzz mode is now an argument not based on the exe name
Former-commit-id: cf4908a3d5550d7ca5f573348cbc1dea6a7c1d30
2019-09-30 00:00:29 -04:00
John Sully 2f8f97ab39 finish up the RDB fuzz
Former-commit-id: c0ecad185ff304d13e690ec0f0223930865f9d24
2019-09-28 17:38:46 -04:00
John Sully 5e66060475 Fix double free in RDB load
Former-commit-id: e3ab73e061b675360c54896153c3299c73b5f7cb
2019-09-28 17:38:26 -04:00
John Sully 757f6163d1 RDB fuzz test cases
Former-commit-id: 872f4e26a6958a5aeb0bff5b6ac0591513ebe93b
2019-09-28 17:04:08 -04:00
John Sully ec0271428e RREPLAY command now takes a DB argument
Former-commit-id: 85b76e319fcfcf6301037b6edf6e6f4a316ec879
2019-09-28 14:59:44 -04:00
John Sully 9611d108ad Implement left and right shift BITOP operators
Former-commit-id: b35058545ad1b81b6851eb78e39772614421279f
2019-09-28 00:10:46 -04:00
John Sully 66c3ea2cc4 Fix leaking stale RDBs during multimaster sync
Former-commit-id: 7707e6f631019cf71b2f5a5138e4df7a59678823
2019-09-27 13:17:29 -04:00
John Sully 600e5e4ae7 Fix multi master bugs: 1. we fail to create the temp file. 2. We use a master RDB as our backup even though we merged databases (and therefore it is not representitive)
Former-commit-id: 7bfcb03e2ee9986a91c502f9157397a384a9d07b
2019-09-26 20:35:51 -04:00
John Sully 7bc9a3d020 Add the IStorage interface and wire it up
Former-commit-id: 16ffcb20c8bd12f7c1eecf81e6f9de734ed490dc
2019-09-20 14:52:22 -04:00
John Sully 47d7726af5 Isolate the persistent parts of the database from the runtime parts
Former-commit-id: 6369e06e6f1765ed1774a6ef2b4d8788ee9efd1a
2019-09-19 22:36:29 -04:00
John Sully c70c6fb21a Hide the database dict
Former-commit-id: fc5a34ee2b967c90bdcbf7f7c54cd06b9f6d3692
2019-09-19 17:44:42 -04:00
John Sully a40be21601 Fix issue where AOF events are posted to the wrong event loop and not properly cleaned up
Former-commit-id: aa3c95d2e723a303e0f69e26933088743f575dd3
2019-09-19 15:40:09 -04:00
John Sully ce91955dd4 Fix issue where AOF events are posted to the wrong event loop and not properly cleaned up
Former-commit-id: 13e18cd142a84f00ffec7668ce6409cd2b1ec024
2019-09-19 15:39:52 -04:00
John Sully d560ce88c1 KEYS now only blocks one database
Former-commit-id: 8b8275dd04eb1868198257f7c3ecd1ef3638a101
2019-09-12 18:51:10 -04:00
John Sully a6e3f1af63 bump version
Former-commit-id: 5ff5c27024777b8c1ca6662ec55695d88492ab3c
2019-09-06 13:31:40 -04:00
John Sully e184f55204 Fix issue where Active Replicas were commiting data to the wrong database under load
Former-commit-id: 729a0f2372092a54a6fbcedd26c1cf186f60a525
2019-09-06 13:30:28 -04:00
John Sully 702ca3986a Fix issue where Active Replicas were commiting data to the wrong database under load
Former-commit-id: e762269288e963e459e5fde7b0f1128e3eb71c31
2019-09-06 13:30:15 -04:00
John Sully cd46ab2d16 Acquire the lock for modules that don't acquire it before calling like they are supposed to
Former-commit-id: f370cc5a127ca5cbae65b836b688bf344319d811
2019-08-29 15:41:03 -04:00
John Sully 7962c57986 Bump version
Former-commit-id: 093789463ef8ffabfe025d0b543beb08715bb13c
2019-08-27 15:32:24 -04:00
John Sully d4f000db23 Fix race condition in PUB/SUB and other async reply commands where the client can be freed before our handler is executed on the client thread. When this occurs the client pointer is dangling
Former-commit-id: 6fdb6ce862f249ce9b9a26e6f2d362416f202ed6
2019-08-27 15:31:47 -04:00
John Sully e30a46485b Fix race condition in PUB/SUB and other async reply commands where the client can be freed before our handler is executed on the client thread. When this occurs the client pointer is dangling
Former-commit-id: 921d7918577b2fad463a87ac08d2e7b7c92d4530
2019-08-26 20:18:52 -04:00
John Sully 590cbf7677 Fix warnings on newer compilers
Former-commit-id: 3d60a9a5693ed2036132ea9e3f5f95693c1db322
2019-08-14 01:03:24 -04:00
benschermel 697f5a327a update readme (#71)
* update readme

* KeyDB must acknowledge its Redis origin and that while we have different opinions we are greatful to Antirez and Redis for the work they've done in this space.

* Update README.md


Former-commit-id: e31dfbc85812109e6db45719f55c177834fe9838
2019-08-06 19:25:13 -04:00
John Sully 616a354912 Optimize the new expire code
Former-commit-id: 7586b4532ab8b22315406ddce70f1a4b8e003a06
2019-08-02 21:31:05 -04:00
John Sully 8d2fc2a824 Fix test failures: Non active replicas are allowed to use shared int values
Former-commit-id: e038f375e2087660003f8df7629604a3b4c0c2c9
2019-07-30 17:11:15 -04:00
John Sully a4e13bf27d Acquire the lock for modules that don't acquire it before calling like they are supposed to
Former-commit-id: e1bbaa5c921bf3844e4209a583a35cd6466e7dcf
2019-07-30 16:54:25 -04:00
John Sully 78a7069633 Fix HLL corruption
Former-commit-id: 9d48475c17cb78b9bf03874f3a74a70281c8c8ce
2019-07-29 18:08:45 -04:00
John Sully d4b9cedc3e Fix crash setting expire on a key with an existing subkey expiration
Former-commit-id: 3d85bb5ace9ad435232b4ccf1f5a3792353a5a6a
2019-07-29 17:09:51 -04:00
John Sully db878e26c0 Fix crash in RediSearch
Former-commit-id: 33008e5912178354a8e1cc29c6da66ef88391ba5
2019-07-29 15:08:57 -04:00
John Sully 33fb3201f1 Fix crash in RediSearch
Former-commit-id: 185c607fb8aec9e39d0ae29365f86fe5586c50b2
2019-07-29 15:08:41 -04:00
John Sully 36649e4da4 RREPLAY failures should be logged
Former-commit-id: 3cdc24909ce14791866a15584c8ed5144401a57f
2019-07-24 22:49:55 -04:00
John Sully caf2051367 RREPLAY failures should be logged
Former-commit-id: 4d78c789872b27d7256c9b1750f2e7863d9af716
2019-07-24 22:49:30 -04:00
John Sully 88124e61f6 Issue #64 RREPLAY isn't binary safe. Add fix and test.
Former-commit-id: 0942a7fb8edd2aa52d6262210cb5c23c67ae5eaf
2019-07-24 22:31:44 -04:00
John Sully 356449b010 Issue #64 RREPLAY isn't binary safe. Add fix and test.
Former-commit-id: 90276ca36144f4c95f0131872084840a550053ec
2019-07-24 22:31:02 -04:00
John Sully 11bb381240 We can't set FExpire() on shared objects, issue #66
Former-commit-id: e72ea94dee73b111e1986a770fcb4f4e8506f620
2019-07-23 23:39:47 -04:00
John Sully 10c45eb6f5 Merge pull request #65 from JohnSully/subexpire
EXPIREMEMBER Command Implementation

Former-commit-id: fd491401068e23ba43f5ffd165823c6e01df18bd
2019-07-23 19:06:57 -04:00
John Sully e6d3d6a7d6 Subexpire entries should load/save
Former-commit-id: eadd159583c97c8234489b1985320fd6184e1487
2019-07-23 18:53:59 -04:00
John Sully e590e4ad25 Fix buggy rebase
Former-commit-id: 239ac0ba9ce605ae207de034a5969463279e11c7
2019-07-23 18:53:59 -04:00
John Sully fca3b7dd09 Fix merge conflict
Former-commit-id: 09dc0ade84426eba14d2f10e69422e8969e92a10
2019-07-23 18:53:59 -04:00
John Sully 659523f945 Plumb support for sub expires to all expire related code
Former-commit-id: 3c23497dcffc7100feb3122b0e86269b870f21cf
2019-07-23 18:53:59 -04:00
John Sully c8250bf974 Fix crash with traditional expiration
Former-commit-id: 0321613bc7db7e3192939debe3836882ff2a976e
2019-07-23 18:53:58 -04:00
John Sully bdc64d75dd Initial prototype of EXPIREMEMBER command
Former-commit-id: 2aa343634fae084f43e09a7d245c1737bd2284be
2019-07-23 18:53:58 -04:00
John Sully 6ff076e130 New expire datastructure and algorithm. Allows us to expire in sublinear time
Former-commit-id: 082bbbead58c4792f0cfb06a3f301024991e993a
2019-07-23 18:49:31 -04:00
John Sully 670fe74367 Merge pull request #50 from JohnSully/expire
New Expire Datastructure which is faster and more memory efficient.  This allows us to process expiries in sublinear time.

Former-commit-id: 9e5cec55c80579bd0eaaabd90628a0b52a257f44
2019-07-23 18:40:48 -04:00
John Sully 646913d71b Support TTL stats with the new expire datastructure
Former-commit-id: e773b3078b9016400539922b58ae7f5463bc4ff6
2019-07-23 18:30:10 -04:00
John Sully 84f990ee0b Implement hash table stats and fixup the hash function based on the results
Former-commit-id: 7e01df05408a9b4d8750bd582e448b5da0398ca9
2019-07-23 18:30:10 -04:00
John Sully 6e50b616f5 Add back missing file lost in rebase
Former-commit-id: b7a6e8934e8623543530845f0421a0ff3893e904
2019-07-23 18:30:10 -04:00
John Sully 7e879ce592 Add back file erroniously deleted in rebase
Former-commit-id: ec606ed0449014ab67cf800930efea482bed14a6
2019-07-23 18:30:10 -04:00
John Sully 5774fc05b2 never make last minute changes before commiting
Former-commit-id: a03c149e9dbe196b426972647a32f6a18344c71c
2019-07-23 18:30:10 -04:00
John Sully be37d092a3 Fix a few potential assert crashes
Former-commit-id: 0eca78d32d9ac7b70f1a5d5560529a15182d966b
2019-07-23 18:30:10 -04:00
John Sully 9466ff7837 New expire datastructure and algorithm. Allows us to expire in sublinear time
Former-commit-id: 627da9a2d68d68c0dc73661cebd62d1ce16f462b
2019-07-23 18:30:10 -04:00
John Sully 2d12c70c81 Any +x bit is acceptable
Former-commit-id: 8c1a2b57848c55b5872f4debeb4c441ef3a5bbeb
2019-07-19 15:26:17 -04:00
John Sully 227d3a4f17 Any +x bit is acceptable
Former-commit-id: cbbcaecb2e5c7fe84e87eeee13f6ec60c3894ea4
2019-07-19 01:42:05 -04:00
John Sully b2f14f148f Modules must have execute permissions to load
Former-commit-id: 2406c9c724cfcab3c7eef48a686ec83f65e897e7
2019-07-19 01:31:10 -04:00
antirez 0103d0663b RDB: make sure to abort on LZF encoding error.
Former-commit-id: f42ac8f07a91993cce72d4e022c584c8b2a6fb90
2019-07-19 01:03:16 -04:00
antirez 37bc18f648 RDB: handle encoding errors with rdbExitReportCorruptRDB().
Without such change, the diskless replicas, when loading RDB files from
the socket will not abort when a broken RDB file gets loaded. This is
potentially unsafe, because right now Redis is not able to guarantee
that encoding errors are safe from the POV of memory corruptions (for
instance the LZF library may not be safe against untrusted data?) so
better to abort when the RDB file we are going to load is corrupted.

Instead I/O errors are still returned to the caller without aborting,
so that in case of short read the diskless replica can try again.


Former-commit-id: ea4dc9e37ad02245b7156c12b58ed284f9705d94
2019-07-19 01:02:49 -04:00
John Sully 47cc255d75 Fix bad merge in SCAN KEYS command
Former-commit-id: fd5d1255b5b197e3537fefc8102bf2cbe3b0b7ac
2019-07-19 00:43:23 -04:00
John Sully f5cecd25f6 Merge commit '9c1932beeb6e307c2fbeadcfff8954e517189ae8' into unstable
Former-commit-id: 8d9e324a49acbd90b5e8f892f638eff5c7c36d91
2019-07-19 00:32:43 -04:00
John Sully 7dbbd27ccf Merge commit '985e5b2c608eade2a60e50a6a177f13381c9c8d8' into unstable
Former-commit-id: 2dccb6c8b7c1b8cf658d8d619f97cb3d85e7310d
2019-07-19 00:01:56 -04:00
John Sully 68e06b043f Fix compile errors from merges
Former-commit-id: 7577d0bb8c360a2eab06296479f5f2b69b3ad12f
2019-07-18 23:35:51 -04:00
Angus Pearson 630c9293ec Add char* typeNameCanonicalize(robj*) to remove duplicate code between SCAN and TYPE commands,
and to keep OBJ_* enum to string canonicalization in one place.


Former-commit-id: cf4cf045d9d5eccbedd403df83af7ac99a2d1519
2019-07-18 23:31:31 -04:00
John Sully 000b15338e Merge commit '2af8ebe14743ad88fd15af2ea91862b0667e94ce' into unstable
Former-commit-id: 1b63ffe1082866e3ee769d5aaa48d76ad16ddb72
2019-07-18 23:28:56 -04:00
Madelyn Olson eb360ca485 Fixed some spelling issues in ACL codepath including user facing error
Former-commit-id: def911a4154d9541d923f57c7dd3401e35e736f9
2019-07-18 23:28:36 -04:00
John Sully 13ae9e6896 Merge commit '214555b02ea448c444fb6a32ecfc5f312fc052b8' into unstable
Former-commit-id: 10d1b55fd7de81e2ae20edce886636e7d91ec90d
2019-07-18 23:26:46 -04:00
John Sully aad11f3c43 Merge commit '4bbaf621a12f6ec22ec7dad6a2282b7908660497' into unstable
Former-commit-id: 32dd3372bb15a78132730c6c53694d188d94b1ec
2019-07-18 23:22:36 -04:00
John Sully 2158be2950 Merge commit '525fc336ef5172f1eddbf18cbbfc1a32b054c9e2' into unstable
Former-commit-id: f599cb4eb637a9c404f3776829e355ce5fa183b7
2019-07-18 23:21:13 -04:00
John Sully 53216530ae Merge commit '9eea57cc311e62a49358e09af7baebce9da9053f' into unstable
Former-commit-id: 66d55984d19760ce8c8745744a8e8f93b4f447af
2019-07-18 23:20:46 -04:00
John Sully a552dd4fce Merge commit '3f4f7aff1aa6abf8cad1726941d4c33b3bfbc9b8' into unstable
Former-commit-id: 6b57f3c5c0b67e90fea889c07e8bffe71ef7db03
2019-07-18 23:18:42 -04:00
antirez 9ba6aa7d64 Test: fix slowlog test false positive.
In fast systems "SLOWLOG RESET" is fast enough to don't be logged even
when the time limit is "1" sometimes. Leading to false positives such
as:

[err]: SLOWLOG - can be disabled in tests/unit/slowlog.tcl
Expected '1' to be equal to '0'


Former-commit-id: 522adb3a6ef20e986b32de3652ad1b0661e4b98b
2019-07-18 23:12:52 -04:00
antirez d91f364b93 Make comment in getClientOutputBufferMemoryUsage() describing the present.
Former-commit-id: 17573d9893de537c0ecbe2fae03a31749c9b45ac
2019-07-18 23:12:39 -04:00
antirez 451a81d30d Fix test false positive introduced by threaded I/O.
Now clients that are ready to be terminated asynchronously are processed
more often in beforeSleep() instead of being processed in serverCron().
This means that the test will not be able to catch the moment the client
was terminated, also note that the 'omem' figure now changes in big
steps, because of the new client output buffers layout.

So we have to change the test range in order to accomodate for that.
Yet the test is useful enough to be worth taking, even if its precision
is reduced by this commit. Probably if we get more problems, a thing
that makes sense is just to check that the limit is < 200k. That's more
than enough actually.


Former-commit-id: 5b5bca9a3c3e9003957b8aaa92ece879c4046a78
2019-07-18 23:12:05 -04:00
John Sully d54e3dbc32 Release version 5
Former-commit-id: 19526fae7c7fbef269fa1d19655506ef3b97e76d
2019-07-18 20:50:40 -04:00
John Sully e539f8d1e0 Active Replicas should always use their own slaveseldb variable when sending/saving rdbs - never those of their masters. This is because the Active Replica is also simultaneously a master
Former-commit-id: e2d84f2694ca4faef312b27768721aba0b793c09
2019-07-18 20:50:20 -04:00
John Sully abe01b15f6 remove unnecessary variables
Former-commit-id: b6a0e130e57102dfc65341fa80aa6c6e8deff3f9
2019-07-18 19:37:49 -04:00
John Sully 2ba45ceaa5 Fix issue #59 - Test replicaof config variable
Former-commit-id: 3ab63913a24b118fe9ebeba5bab5afe466c786b9
2019-07-18 19:22:49 -04:00
John Sully 7e09365cab Add support for sanitizers and fix issues they have found
Former-commit-id: 5a96f407f17ef53bb10d31baf198d9f8761ff358
2019-07-18 18:39:42 -04:00
John Sully 8be2711505 Resolve race on neterr variable
Former-commit-id: ba15c5e4015fb691bbacf1a1ecf7e23a554b06cf
2019-07-18 17:11:28 -04:00
John Sully ba88f3e27b Make object refcounts atomic, technically it doesn't need to be currently but the semantics are complicated and error prone. This is much safer with little performance impact
Former-commit-id: 36991bdc7244898b8bd52ccf9b6f6275c1b6b6d8
2019-07-18 15:49:12 -04:00
John Sully 29d267bc1b Suppress initialized data sanitizer warnings
Former-commit-id: 116f5d80390c700a0e4000d2a9bbf627b76aa023
2019-07-18 15:49:03 -04:00
John Sully 21fd9bfec2 Another RESP3 regression
Former-commit-id: ab09a93b8b30589e457b5b0a89728c0c1106e1ab
2019-07-17 22:57:52 -04:00
John Sully a4fd05f993 Fix Issue #58
Former-commit-id: 5290d41362a3dfc2dd558b1998ef8e0bd5c16af3
2019-07-17 02:34:02 -04:00
John Sully 6d9ca5be4f Shared objects should be marked as such
Former-commit-id: 99414b64329d0b8c1ce66d7d6a1fc5c7db30eaa7
2019-07-16 18:32:01 -04:00
John Sully b3dacfc408 Crash when aborting SYNC with a master on a thread other than main
Former-commit-id: b7e86fde18e92be2f979c61b7cbb27e6f7864546
2019-07-15 14:55:41 -04:00
John Sully 029c1e1f38 Implement test mode to make finding bugs easier
Former-commit-id: afa28b9a3ea7561853b175ded40112dc09686209
2019-07-15 14:55:18 -04:00
John Sully 027875e38f Blocked clients can stall when under low load
Former-commit-id: afb712bdd3f59b70b40ec181c2effc29efd890a0
2019-07-13 16:44:11 -04:00
John Sully be0d5bb5cc Give the active-rep more time to sync for test reliability
Former-commit-id: 1325197b1fabb902b10ae42bdb3d0e10b23c723f
2019-07-12 23:52:07 -04:00
John Sully ef804bca9e Fix more locking deadlocks
Former-commit-id: 9d379d065f7b9d352c4eeff202edbcbbd733b763
2019-07-12 23:51:45 -04:00
John Sully 1cc6b11a20 Fix deadlock with client and ae locks
Former-commit-id: 0326e52ede59df932f073e7e97811f746b523b43
2019-07-12 20:46:50 -04:00
John Sully 1e1551aebf Add Active Replication tests
Former-commit-id: f6ae5c118219260bdcaaffe2a4cafaf121f7ceb8
2019-07-12 03:54:41 -04:00
John Sully 220fe79648 FIX: The dabase count configuration is not respected
Former-commit-id: 7296751ff765a8eac849e07fd81ae3d5dd6b4686
2019-07-12 02:13:37 -04:00
John Sully a0d37f8631 Update README.md
Former-commit-id: 358a129f4236d7ecbc0eff1bc02f00fefbd390e3
2019-07-11 20:29:47 -04:00
John Sully 894145933a Fix compile errors on GCC v5
Former-commit-id: 02d825657fa9b0cfdf49b3c9830faec57cd24226
2019-07-11 20:20:01 -04:00
John Sully 8cf72072a8 Fix more accounting errors with active replication and the replication offset. Specifically we don't update repl_ack_off as frequently as we do reploff_skipped
Former-commit-id: a817a7106589f30058636d1c6119d8f92ea40d17
2019-07-11 19:20:12 -04:00
John Sully 59a61af518 Active Replicas are not slaves
Former-commit-id: 064f958ee093aa3949e0c4529255be18517da502
2019-07-11 18:51:20 -04:00
John Sully 48b7ab8e65 Fix active replication offset synchronization accounting, and enable the wait command
Former-commit-id: 6657f4f69d7056aa57e9e974dee8a5d191b32105
2019-07-11 17:00:23 -04:00
John Sully c739783454 lazyfree needs to consume more memory to be detectable
Former-commit-id: 0234ece6c77398a340112108659536e2d7a78c47
2019-07-06 00:53:40 -04:00
John Sully e18da1c9fb Redis only does this in beforeSleep function - doing extra calls like we do causes test issues
Former-commit-id: 20540b126e30e4e2ff09421563c6d5c5a29859a1
2019-07-06 00:53:20 -04:00
John Sully e85866db2e Add back user space buffering of RDB save
Former-commit-id: e61b399a071de75a33c5eac5f75cefbec1b3319b
2019-07-06 00:36:23 -04:00
John Sully e154e23d2f We can use less memory in the client output buffers. Its OK
Former-commit-id: d427f3f725fbc2334f6f3ca3f5947d61a1d42167
2019-07-05 23:43:01 -04:00
John Sully f4f0f91101 Fix additional warning related to new() overloads
Former-commit-id: ad0b76d10f836d0c16c309d064fe5420065f555c
2019-07-05 23:42:39 -04:00
John Sully 7bcfb804f6 Fix additional warnings
Former-commit-id: 360027efe9260058673f6a5b47e81792f69c76f8
2019-06-27 16:29:36 -04:00
John Sully 61750f8d89 Fix mac build breaks
Former-commit-id: 9c6e4b353a03d6c601572982ff517f7cd6f0781d
2019-06-27 15:04:09 -04:00
John Sully 0e45882715 Fix libcxxabi clang compile failure in travis, as well as bool issue due to old clang
Former-commit-id: 962196252e0c270997de26005705a2f8bbb82aa7
2019-06-18 00:42:01 -04:00
John Sully a575cf9ef0 Bump travis compiler version
Former-commit-id: acefee2b38440c424b078c67299294884ef55785
2019-06-18 00:42:01 -04:00
John Sully 35911ddbad Fix Travis CI issue
Former-commit-id: ea62a50e135c08569ecac7d4bcf9fa6e003ff412
2019-06-17 23:56:23 -04:00
John Sully 1766230c04 Fix issues with relaxed memory model architectures
Former-commit-id: 1e426ff051ba08fb19607e82354fcd2b5df4d555
2019-06-17 23:00:12 -04:00
John Sully e973c2fe0d Remove unnecessary recursive lock
Former-commit-id: c4a6a2c7809510b0bb0f652ac262bc7fcd0c5635
2019-06-17 23:00:12 -04:00
John Sully 6f1c7e036b missing file :)
Former-commit-id: 31e919e0f081247850802bb4c47c1f9fcfc387f6
2019-06-17 23:00:12 -04:00
John Sully 471bf99f08 Fix test failures due to assert
Former-commit-id: 76e067d1c62b15f2aca59b5d69cbb54505c9578f
2019-06-17 23:00:12 -04:00
John Sully 033df6c68d convert the pending write list to a vector for better performance and less cache thrashing
Former-commit-id: c01008c98a0004b75437c1ea85401aa26a6108b0
2019-06-17 23:00:12 -04:00
John Sully 02385957b3 Move more code out of the GIL
Former-commit-id: 0cf10dce8a39a4f508b1d5579107a655cf6d86ff
2019-06-17 23:00:12 -04:00
John Sully e79a854178 Remove an unnecessary lock that eats performance
Former-commit-id: 4b79986becce48b77c965010c4cc2daa25e7ca04
2019-06-17 23:00:12 -04:00
John Sully e263d0e735 Even the next up thread should sleep in the futex
Former-commit-id: a97f0e30b4363bddc5f90516b10aac3008b164aa
2019-06-17 23:00:12 -04:00
John Sully 9700367892 Fallback to a futex if we spin for a long time
Former-commit-id: 078c38d213323656525d8043d6d924c574e47195
2019-06-17 23:00:12 -04:00
John Sully 4e694fd1c4 Enable load balancing of UNIX sockets across threads
Former-commit-id: 1477a539b47d87cde2a7e2ee8671d3401a9c7cef
2019-06-11 01:34:36 -04:00
John Sully e41df8e221 Fix crash adding duplicate replica. Just send an error instead
Former-commit-id: ea58503a3f9a0946483d2ece2c03887795c9d9fe
2019-06-02 15:50:50 -04:00
John Sully 665a6a238f Merge branch 'unstable' of https://github.com/JohnSully/redis2 into unstable
Former-commit-id: 5b562bc67e548086982a5b83b270610c9e789176
2019-06-01 03:23:21 -04:00
John Sully 98585950e5 Implement MOTD feature in keydb-cli
Former-commit-id: b2c75f2f3567590b85e0ccf2416e45de63db9fe3
2019-05-21 15:12:12 -04:00
John Sully 56aae1a6c4 Update README.md
Former-commit-id: 2bd7ec98a498689cbff1ae91e05e16d19ce922a8
2019-05-21 00:04:12 -04:00
John Sully 620f811191 Fix regressions from RESP3 changes in commit c8304b099d
Former-commit-id: 2e0787734944ad09af89135a252ea6c07233e5c0
2019-05-20 23:39:44 -04:00
John Sully 82acc285a2 The unstable branch doesn't have a version #
Former-commit-id: 2479366797c5bbbde7b7ee3acdcbcb1c110198ec
2019-05-20 16:12:26 -04:00
John Sully da6a421bf6 Fix double unlock
Former-commit-id: 384d945fee94a09b9160756a2fc7941feafb6157
2019-05-20 15:52:04 -04:00
John Sully 212c889608 Merge branch 'unstable' of https://github.com/JohnSully/redis2 into unstable
Former-commit-id: 9c39bb3a6afb9911085aeb2436fbeb081c55c9ce
2019-05-20 10:57:59 -04:00
John Sully 5f4b447d53 Protocol regression from RESP3 work
Former-commit-id: 7f866c1395c677a93c9cc6fcb90e8e0955ce130a
2019-05-20 10:57:37 -04:00
Qix ce34624014 cast void data pointer to const char * to fix gcc
Former-commit-id: ddd3df8c636c791f5c27e5e7dc415432fad42fcd
2019-05-19 16:24:39 -04:00
John Sully 150441cbde Fix build breaks on some older compilers
Former-commit-id: 527ba329760d3a7f8da260129df319591154609e
2019-05-18 20:58:48 -04:00
John Sully 7b2ac1bc1e Fix build break on some compilers
Former-commit-id: b6da679720f6898b6e6bc98fa4fa1141cb8d7e7b
2019-05-18 20:41:05 -04:00
John Sully 0ca41fdce6 Merge branch 'unstable' of https://github.com/JohnSully/redis2 into unstable
Former-commit-id: ff353ff8dd949e87e51a759575d72668aa4c1bd0
2019-05-18 20:25:23 -04:00
John Sully 4eee4c96ac Print nicer error messages for uncaught exceptions
Former-commit-id: eb1e772c08c3d8c622cbc412f720dc0c49801a44
2019-05-18 20:24:29 -04:00
John Sully 215ec572fe Fix: Active replication falls behind under high load
Former-commit-id: 6163e7facaf36dd43cfb2f2e4173267fe93a4ae1
2019-05-18 20:23:20 -04:00
John Sully f71f61fbcf Update Active Replication wiki links
Former-commit-id: 4d665b64ced168e76a8e58cce06ac1084536fe90
2019-05-11 21:53:30 -04:00
John Sully 8e7d51236f Fix a few issues from the merge
Former-commit-id: 71d2af42cb7361224c8bfe033e92fe29290d553f
2019-05-11 19:26:59 -04:00
John Sully 944f31e11a Make lazy free test more reliable
Former-commit-id: 39c69cb5401684b1794194694dceb792d717bbe2
2019-05-11 17:57:35 -04:00
John Sully bba04e1e14 Merge branch 'unstable' of https://github.com/antirez/redis into MergeRedis
Note: some tests failing

Former-commit-id: 065650df21bcb9cfe342e7a35864fa4f3a3ff219
2019-05-11 02:20:34 -04:00
John Sully 86d6215a09 Add byline to logo
Former-commit-id: e7fc25ad3d5ffeb1466e53568b38f091df6e4bbe
2019-05-10 23:48:14 -04:00
John Sully eff5eb497c Fix CentOS build failure
Former-commit-id: 5f0d1de77a926842bea48b750c787106abfb508b
2019-05-09 19:54:34 -04:00
John Sully 4a9f8889be Merge branch 'unstable' of https://github.com/JohnSully/redis2 into unstable
Former-commit-id: 9bcdb6a5f6e386304faa25554d1d5f9c1f3955c2
2019-05-09 19:16:50 -04:00
John Sully 618f46eb80 build break fix
Former-commit-id: 51020f3dd24ed32c33e731c757f73573b7657581
2019-05-09 19:16:31 -04:00
John Sully b39b6fd379 Fix issue #11
Former-commit-id: dfd8be6d265368217fec35d21076b247cc29faef
2019-05-09 19:14:10 -04:00
John Sully dd6eca3319 Fix typo
Former-commit-id: 6c65fed3f027b406d779d6c7d7d7cd6c1aad82b4
2019-05-09 19:06:58 -04:00
John Sully 0513e95713 Add missing file
Former-commit-id: 75efcd3d9d170c7d3855b8b446cc598645c1d645
2019-05-09 19:05:09 -04:00
John Sully 028aac3b3f Change debug messages to reference KeyDB
Former-commit-id: f3517212f3e12c3815ba55b8a6e181c30f424867
2019-05-09 19:03:50 -04:00
John Sully 6da2115174 Fix module locking issues
Former-commit-id: cc351851e2ee6a57c9fb0b8d45ae29bc0200896f
2019-05-09 19:00:27 -04:00
John Sully d6cb1bae74 refactor server global into a pointer (so that threadsafe commands can set this to NULL to prove they don't rely on it
Former-commit-id: 1abfb5828b5ee569d4373e40255a0eb87434759d
2019-04-21 14:01:10 -04:00
John Sully ddebaad770 Factor out some normally const globals
Former-commit-id: e6ee321919efa1fae6643444b5df14add1f97830
2019-04-21 13:20:45 -04:00
John Sully 097e2f99d2 additional fix to rreplay forward compat
Former-commit-id: 2123fcb6cd59026bcd2b519e5966858a2f2d99c4
2019-04-20 01:36:23 -04:00
John Sully 5a0b933d1c Make rreplay forward compatible with extra future args
Former-commit-id: c45eaea5df1982a8f63fc1297484c6576a494839
2019-04-20 01:15:01 -04:00
John Sully 5a8971015d Tweak mvcc time format so rollovers are not an issue
Former-commit-id: bd02a04c990bc68fe697a95cad69c03421d093ab
2019-04-20 01:03:08 -04:00
John Sully c2ef57017e Timestamp writes to objects so we can be smarter about merging databases
Former-commit-id: 89d5a870a36ce0f978a51a8762df581b076a3628
2019-04-20 00:52:07 -04:00
John Sully 18a74fff64 Fix use uninitialized
Former-commit-id: 9e377fcf61a6e19971b97b746357f8f594fc3adb
2019-04-19 23:41:40 -04:00
John Sully ff16bd9b98 Additional MVCC work and fix memory leak loading objects from rdb
Former-commit-id: e0d2899a311695b8da853506afde8bdcc7192099
2019-04-19 22:54:42 -04:00
John Sully ced54bfc66 Add version override command for users that need compatibility with Redis
Former-commit-id: 1b53130d89c28fcd2ecf30fdf27c1321ab117313
2019-04-19 19:57:11 -04:00
John Sully 82ac0123e6 RREPLAY PERF: The UUID stack is unnecessary, RREPLAY itself can detect the cycle and call cancel()
Former-commit-id: be7c2edba07d6642e09cc066555c92636b4fac4e
2019-04-19 19:36:47 -04:00
John Sully a3deea8186 Detect cycles in mesh networks with multi master
Former-commit-id: 7a931c1d2a47b22c4c9b9f7ca693c764845f77bf
2019-04-19 19:31:11 -04:00
John Sully e77ecc28d6 Fix crash near boot when adding replicas and dumping database
Former-commit-id: 0c38e2267598067702626cbfde8bf13475641834
2019-04-19 17:08:54 -04:00
John Sully e2b161c24a Replication fake connection should inhereit the user and permission of the real connection
Former-commit-id: 2ee12add8eee4b78ee45ec26a170d6030466373b
2019-04-18 22:07:35 -04:00
John Sully efa4efb939 Start of MVCC support (and more C++)
Former-commit-id: 21dd60095553fba9b821bbbcefeaf4ae97250d5b
2019-04-16 23:16:03 -04:00
John Sully f2cc61c5df Fix module linking and crashing issues
Former-commit-id: e905eb992cf39d1ac3ad2212718d1c9ae558dd0a
2019-04-16 13:34:22 -04:00
John Sully ae7c4950c2 Fix replica authentication failure when masterauth is below replicaof in the config file
Former-commit-id: 6803f4671c583f565683276e28eb5a8033955fbc
2019-04-15 22:31:02 -04:00
John Sully 824fde28e6 Fix memory leak unsetting master
Former-commit-id: 933d45fb8ea2de68b6dd99c5a22d330fa3711b1b
2019-04-11 19:55:44 -04:00
John Sully 64cba896b7 Fix compile errors when MALLOC=memkind
Former-commit-id: c93134236dea2de30b5824819a2620aa33298f04
2019-04-11 19:40:45 -04:00
John Sully 4b2f29d10e Fix failure to respect masterauth issue #26
Former-commit-id: d8e1cb1de1d296c30953221b9f8f0ae00d7fd922
2019-04-11 19:08:12 -04:00
John Sully 2fa355d994 Fix addition RESP3 regressions (return empty set)
Former-commit-id: 17a1d7e138e3d16efb5eef557429448646a2ee7c
2019-04-08 16:52:57 -04:00
John Sully 17035ee011 Fix protocol break with hgetall and family
Former-commit-id: 40150e7ddf7b5048c4c9c00d1b4962e1211cc0c8
2019-04-08 13:52:02 -04:00
John Sully e014ce38f2 Move remaning files dependent on server.h over to C++
Former-commit-id: 6ff1be07f5d1659c8bee3ecffd1bb5b16cc697fd
2019-04-08 01:00:48 -04:00
John Sully 3aedf7205a Move dict to C++
Former-commit-id: d8c8915844f614fef5ed4c645bbf8d0cffcc97ec
2019-04-07 17:23:59 -04:00
John Sully 02660b4fc1 Port db to C++
Former-commit-id: 1ab0ae8fe63dd278a02e79957395b58f3fb1f244
2019-04-07 17:13:14 -04:00
John Sully fbf40c4bc2 Move a bunch of files to C++
Former-commit-id: b8452b712cc1fa077b1dc683818e75074a37594d
2019-04-07 16:54:56 -04:00
John Sully 68c7a7374d Make t_string C++
Former-commit-id: 9c81d4e6d64738766012c32b68dc690b5b5ed35e
2019-04-07 15:24:23 -04:00
John Sully c8fe14f7d0 Fix clang compile error
Former-commit-id: d0aeac3da2e53bbcc029fc15939547fb057c875a
2019-04-06 00:20:17 -04:00
John Sully 351f4deab6 Add RREPLAY command and put the issue of packet storms to rest. Fixes issue #24
Former-commit-id: 665720dd6dee443961b28c1f53e4b3965b9082b7
2019-04-06 00:14:27 -04:00
John Sully facbf3cbbf Fix regression in active replication caused by multimaster PR
Former-commit-id: 2028b17611d6119bd7aad9bda528b7d7e00cefe6
2019-04-04 16:50:40 -04:00
John Sully edd42ddc60 Merge pull request #23 from JohnSully/wip-multimaster
Wip multimaster

Former-commit-id: a8f798707f3d2d6b563eb493764559c0993dfcaa
2019-04-04 11:40:58 -07:00
John Sully 43a860b0ee All tests runs pass! YAYgit add src/cluster.c src/config.c !
Former-commit-id: 10ce9f88b668477f38f8fe13144f9a7cf22c7d31
2019-04-04 01:02:19 -04:00
John Sully 339ee81d71 Fix some more failing tests
Former-commit-id: f8a2d81b3d9fb80a67938807832f93d71362e774
2019-04-04 00:25:30 -04:00
John Sully 4cc78e47ee Merge branch 'unstable' into wip-multimaster
Former-commit-id: a79e37be953a263ee7a3b5607d02a61b5a8b154f
2019-04-03 00:12:13 -04:00
John Sully bf9921b7e1 Fix cluster test failure (not real issue)
Former-commit-id: aad720182b171093db1e0eb9d244c922e57c1792
2019-04-03 00:11:34 -04:00
John Sully 282b6f88f5 Merge branch 'unstable' of https://github.com/JohnSully/redis2 into unstable
Former-commit-id: 116d843083d8a8e7d802d315a4a3ec1fd4a12a10
2019-04-03 00:09:51 -04:00
John Sully 5d4a09b0da Fix failing tests due to build issue inhereted from Redis
Former-commit-id: fbf46ba9a9d312f2e23cb7419ffe16f60171b8c3
2019-04-03 00:09:26 -04:00
John Sully 364f3715af Merge branch 'unstable' of https://github.com/antirez/redis into unstable
Former-commit-id: fbee5282424d932f3fcf1377050c22a05170ab95
2019-04-03 00:00:38 -04:00
John Sully 76605c515b Cluster tests shouldn't crash (note: still not passing either)
Former-commit-id: 7a1e6f44249aeb483e8772f0bc0e31e72773a66a
2019-04-02 22:32:10 -04:00
John Sully 5425379b1d Multiple masters is no good if we keep dropping the database
Former-commit-id: 5e876de016c96b9c5fc21a3d7b400af9cc62af38
2019-04-02 21:47:21 -04:00
John Sully 051f090cdb Tests are passing! YAY!
Former-commit-id: f2d33e086462c9a5ede95e9203ee62227456bb75
2019-04-02 21:36:04 -04:00
John Sully e27ac2fd25 It compiles and doesn't crash immediately!
Former-commit-id: bfa8b8543553f3d7142eadc17bdef982952d1798
2019-04-02 16:47:05 -04:00
John Sully 95bbef87f0 Link to GUI
Former-commit-id: 7ede923d0471686d29f29477151c818d36dfb493
2019-03-31 14:37:54 -04:00
John Sully cb271ab9f4 Commit missing file
Former-commit-id: f10fdeacf65ef7679fa860a28b39f57eb1c29c1b
2019-03-28 17:56:14 -04:00
John Sully 8dd5d9ec70 Travis needs to install uuid-dev
Former-commit-id: f469f9bf13314e3166d687a25056fc0c9022be64
2019-03-28 16:18:26 -04:00
John Sully 383996db3e Implement database merging for Active Replicas
Former-commit-id: 8c2f90e1a7f284d410c55db728607ae54158979c
2019-03-28 15:12:43 -04:00
John Sully 4ff525c30c Merge branch 'unstable' of https://github.com/JohnSully/redis2 into unstable
Former-commit-id: 5ad6e514287648a8780122db056c83df53f4af77
2019-03-27 22:59:38 -04:00
John Sully ef07161c74 If no rdb file is specified and no s3 file is specified use the default RDB filename. If only S3 is specified use diskless sync
Former-commit-id: 69ad4707db551c1e3a9284a2852b7e6dea4a0ad7
2019-03-27 22:59:12 -04:00
John Sully 113c2113f5 Update README.md
Former-commit-id: 09d529db3df1be76f3efec9525dfaf3dcd05c72a
2019-03-27 21:52:08 -04:00
John Sully 8b6a165878 Update README.md
Former-commit-id: ddd3b5224a904edff6174d921b8f2292b17cdb19
2019-03-27 15:39:25 -04:00
John Sully e7f6c7f7c4 Merge branch 'unstable' of https://github.com/JohnSully/redis2 into unstable
Former-commit-id: e8ee4a42b384dfb8c328d51605b825505689ab9a
2019-03-26 20:39:56 -04:00
John Sully b6192ba84b SIGALRM should happen on a worker thread to make our tests happy
Former-commit-id: 331dffe7ceb75de0033b9a6501972500067b1286
2019-03-26 20:39:30 -04:00
John Sully 56c4e513f2 Make PSYNC2 tests more reliable on slower hardware
Former-commit-id: 9e3b1ef084c178db1313702014668aacf0fcf015
2019-03-26 18:59:31 -04:00
John Sully 444db1d606 Merge pull request #18 from DevopsDood/unstable
Update Readme for missing docker flag

Former-commit-id: e2fb35ac5d4e0cc10de2bb6b78eea91c39264e13
2019-03-26 09:49:53 -04:00
Richard Silver 1b9c809362 Update Readme for missing docker flag
Former-commit-id: af7cc9dbc5a8b2aa5f6d0a20b18b3aa7e346e5e4
2019-03-25 15:55:23 -07:00
John Sully 9780ed711e Give information on dependencies that need installation.
Former-commit-id: 7130f7acdfab7864e6cd5241b5e90c243f71edc1
2019-03-25 16:22:10 -04:00
John Sully f283f95a82 Add depenednecy on uuid-dev to dockerfile
Former-commit-id: 122e35766a80c09d3aae4d137e9b4b1042bbc110
2019-03-25 02:09:53 -04:00
John Sully d3c1a5220b Talk about active replica
Former-commit-id: 1df9a6dc45358c6cacabdd8d4fce62b11dc46071
2019-03-25 00:12:04 -04:00
John Sully 2b3781510b We don't corretly terminate our varargs
Former-commit-id: 2a984ee485e019d8afe12f87c5dd230294ee083d
2019-03-24 18:57:25 -04:00
John Sully da7bf3ce4f OS X build fixes
Former-commit-id: 2a806a5c20082652788870657da69760148b775f
2019-03-24 18:06:57 -04:00
John Sully ab463f56c9 Active Replica Support
Former-commit-id: e893dd6c681ef99dee9998912b8b512633ad5c75
2019-03-24 15:39:10 -04:00
John Sully eeea06c19e Merge branch 'unstable' of https://github.com/JohnSully/redis2 into unstable
Former-commit-id: 4c862cdd66ba7e477d57dd2ca6ea44f20c75e24a
2019-03-21 23:11:55 -04:00
John Sully c71e918fa3 Fix kqueue build error
Former-commit-id: 7c7e437b929ce4e6e5f5b145258050e1afce005f
2019-03-21 23:11:19 -04:00
John Sully 379b4b2999 Merge pull request #16 from gitter-badger/gitter-badge
Add a Gitter chat badge to README.md

Former-commit-id: c8dc4e4df4bf91528c7307c743a44c3ebfee2e18
2019-03-21 21:57:25 -04:00
John Sully 7c05b8cca1 Update README.md
Former-commit-id: c7a56a3df5b6ed8561bfdfba7ee2e725177ff67b
2019-03-21 21:26:00 -04:00
John Sully 4a06ca11aa Update README.md
Former-commit-id: 53b01947c7f8a1ac2c4df52b72da169d4e7e9365
2019-03-21 21:25:49 -04:00
The Gitter Badger d29d42c0de Add Gitter badge
Former-commit-id: e75c149652cdb575993a687ba3b3cd50631134a1
2019-03-22 01:24:32 +00:00
John Sully d1d870de08 Merge branch 'unstable' of https://github.com/antirez/redis into unstable
Former-commit-id: dc3c05d6101e33b5b157f49ed083bf641576e618
2019-03-21 20:15:59 -04:00
John Sully 39d480bd66 Merge pull request #15 from DevopsDood/unstable
Added docker builder for those that want it

Former-commit-id: f06307de106442db866feae1fa912514453be717
2019-03-21 19:54:00 -04:00
Richard Silver c1f627e2eb Merge branch 'unstable' of github.com:JohnSully/KeyDB into unstable
Former-commit-id: 8cad57e1f101ebdc1e398a7a07937a785f985961
2019-03-21 16:19:45 -07:00
Richard Silver 4072fd36d3 updated readme and Dockerfile to allow for tests to be run in container
Former-commit-id: 0b2925086d63bb0e1c22556f6fbef8358064986b
2019-03-21 16:18:37 -07:00
John Sully 57d5c59b18 comment issue
Former-commit-id: 332e87e8b5a29328c1e3dcfb36e65f8b9882f43e
2019-03-21 22:18:48 +00:00
John Sully 5a35e59fbe Polarity of the weak flag was wrong. We want to use the strong variant of atomic_compare_exchange always
Former-commit-id: 576b7a8b62e5b44d4a312d47a8b536d3c627845c
2019-03-21 22:17:04 +00:00
Richard Silver e41a19c7e6 Added build Dockerfile
Former-commit-id: e0c296338daa2a445775e7c2acf8fd0ef70f2bfe
2019-03-21 15:15:11 -07:00
John Sully 513580c847 Compile issues at O0 optimization
Former-commit-id: b1cb4d3a9c48beb95dfcfab9687de6045d9da6e3
2019-03-21 21:57:18 +00:00
John Sully 8e024ac47f ARM build fix: Don't use X64 asm here
Former-commit-id: c071e4103527f95f5d2c9cb48afc40178570d003
2019-03-20 04:14:33 +00:00
John Sully 1ab383033c Add debugging stats to the INFO command
Former-commit-id: 8866808f2af260d1cac63cef5bcb698fd32a919d
2019-03-19 22:04:33 -04:00
John Sully 02523c36a0 Add release badge
Former-commit-id: c52c6023cbbfc0e03b58c1dcfa0b965028d4a595
2019-03-19 20:54:36 -04:00
John Sully 1a4a23ca05 Add CI badge
Former-commit-id: 0e574366001f2c4fc8e86f0dc2e15b969dbbdc37
2019-03-19 20:46:25 -04:00
John Sully 432deefc58 Getting close! Maybe there was a better way to do this than checking in travis.yml files repeatedly but alas it works and doesn't affect people building locally
Former-commit-id: 28f7bbacb3176eabb6f47c4f1e3646b2eedda97b
2019-03-19 20:40:17 -04:00
John Sully 7f00991ede Clang build with libc malloc
Former-commit-id: 373432c6bad3b67c1dc8106280d5ca1b7eb567bc
2019-03-19 20:34:09 -04:00
John Sully 4c9f85c89c more clang travis fixes
Former-commit-id: 802aaca945ac658dd245ed7727409cdb2fc81f87
2019-03-19 20:26:35 -04:00
John Sully 24b15d39d2 Fix race condition building dependencies with multithreaded builds
Former-commit-id: 16308327ad6ffbe254b3a5945b9992f50210710d
2019-03-19 20:25:30 -04:00
John Sully b39e58d185 Will clang build now with travis?
Former-commit-id: b507e364492bc6e8207d793f802d7db217b27cdf
2019-03-19 20:00:52 -04:00
John Sully e0ed8f2892 clang build failure
Former-commit-id: ed97f78225433a1f8c28ffbe97d145841d6d4e8c
2019-03-19 19:55:03 -04:00
John Sully 7f65041d04 Travis clang dependencies
Former-commit-id: 887563be3742692dc1c4fa408b1bf765a6b31630
2019-03-19 19:50:28 -04:00
John Sully 6fec3aed6a Makefile ignores env CXXFLAGS
Former-commit-id: ca768b526748abf71fbb2454d1eaf7360e48ba64
2019-03-19 19:29:14 -04:00
John Sully 31d13255e6 No underscore
Former-commit-id: f53605cf52fc9b41d230062b6f365ba420a6a4a0
2019-03-19 19:22:27 -04:00
John Sully 1df261e596 Maybe this will make travis-ci stop using GCC headers when compiling with clang
Former-commit-id: f8582451e3abfe054a17b8ad1bb8c04a64e73a00
2019-03-19 19:12:15 -04:00
John Sully 7aa02c30dc Feature gate SO_INCOMING_CPU so we compile on older kernels
Former-commit-id: dd3788d792cfbc7dd75f944c6dbf46a999891eb3
2019-03-19 18:55:42 -04:00
John Sully 1736c1e777 typo
Former-commit-id: 0eb079e6069c7d8d79e3021351afceae20adb500
2019-03-19 18:40:50 -04:00
John Sully df709b9c18 It would be nice if our CI actually called make...
Former-commit-id: f671c0290990d2a53bbd5937ec295184b4db367d
2019-03-19 18:37:53 -04:00
John Sully 3e1b5875e9 Fix issues with travis config
Former-commit-id: b5c2bb1c0c11b154dade177be74f8e0a701a09f7
2019-03-19 18:31:45 -04:00
John Sully 8af05807f8 Let's try travis-ci
Former-commit-id: 49aa4a05c8df5afeea102038b68d57de9052681c
2019-03-19 18:27:54 -04:00
John 18fe66e2a9 Fix linker errors on some compilers due to sdslen()
Former-commit-id: 518df722b8d1552dbd1b8e48d69658abf88e79c5
2019-03-19 22:08:20 +00:00
John Sully 250775d275 KeyDB has different aims than the Redis project.
We believe software is for the user.  If a feature requires complicating the codebase
but simplifies our user's lives we will do it any time.  This should not be taken
as an outright rejection of the manifesto, as we agree on many points.


Former-commit-id: bedd5ed627b1c9e575201154b2b6e5a44b85e476
2019-03-19 01:36:03 -04:00
John Sully 697dbb88ce Merge branch 'unstable' of https://github.com/JohnSully/redis2 into unstable
Former-commit-id: 7b30708320d466f4defce5df701b08c4b0c6274c
2019-03-19 01:26:22 -04:00
John Sully bad26e41fb Merge branch 'unstable' of https://github.com/antirez/redis into unstable
Former-commit-id: bfd8bc3b49407068e5fcd28e860b902fb0dfd6e6
2019-03-19 01:26:10 -04:00
John Sully e9515b3c6e Hack to prevent build errors on some machines due to missing throw()
Former-commit-id: 1dfd6f95bb5d847f1f067470900afd67b33cf9c4
2019-03-15 05:28:20 +00:00
John Sully 63df790252 Merge /home/john/repos/redis_clean into unstable
Former-commit-id: c7d151da7d058080511f41101ee5df4ec091c196
2019-03-14 14:22:41 -04:00
John Sully 830fa87cee Merge branch 'unstable' of https://github.com/antirez/redis into unstable
Former-commit-id: 341b4ae738acc6e8eb9ac12f0c7bc1ad1a3f5c64
2019-03-14 14:22:27 -04:00
John Sully 895ea29ae3 Merge branch 'unstable' of https://github.com/JohnSully/redis2 into unstable
Former-commit-id: 1f8f625bc804f3e7b71b259cc7978293c3ef8a2f
2019-03-13 18:08:59 -04:00
John Sully 4d2e119563 Merge branch 'unstable' of https://github.com/antirez/redis into unstable
Lots of fixes and improvements from upstream.


Former-commit-id: 596c910774725443cb7a9e292f774dbefe57d81e
2019-03-13 18:08:22 -04:00
JohnSully 48f832bb5c Update README.md
Former-commit-id: c9cd2f74391564b817420ee070f6d131d295bab2
2019-03-13 16:57:40 -04:00
John Sully c2ce4b6392 Merge branch 'unstable' of https://github.com/JohnSully/redis2 into unstable
Former-commit-id: a3ed3bc248ea0bc1be48dbe272cb831662acdb10
2019-03-13 16:53:55 -04:00
John Sully 5280a0db7f Implement load database dumps from S3. We already save.
Former-commit-id: a0ad3f488d7170c30279eacb7bf2831edbd61354
2019-03-13 16:53:37 -04:00
JohnSully 2457b11fff Merge pull request #9 from 0xflotus/patch-1
fixed guarantees

Former-commit-id: 7f95ef85247e06fced1ff2479c7ba1615d7c239b
2019-03-13 12:22:29 -04:00
0xflotus c7e86106df fixed guarantees
Former-commit-id: 0e86d6fdcdda24f5b92d0273c93fbb4471447cfd
2019-03-13 15:14:34 +01:00
JohnSully 58c8eb21c1 Update README.md
Former-commit-id: aa2f3b703e3f7af56586fb3c7965cd0a9aa4ad2d
2019-03-12 14:38:03 -04:00
JohnSully b3e46026b7 formatting fixes
Former-commit-id: e3f236f6bb42550b139a141821cbfcecd1000978
2019-03-12 00:59:28 -04:00
JohnSully c11af651f2 Add charts to readme
Hotlink from medium, hope they don't mind.

Former-commit-id: 74bab0e9a63de2d9689638712f5b726fd543de3f
2019-03-12 00:55:03 -04:00
John Sully 423ab5f78f Merge branch 'unstable' of https://github.com/JohnSully/redis2 into RELEASE_0_9
Former-commit-id: 4ebca64accd8738c73ef8c05c66e0de1d35391fd
2019-03-11 20:54:14 -04:00
John Sully 3dcb767431 Werror is good for me, but not for people compiling on other compilers
Former-commit-id: 690f788ec3ecf1ecdc5a62171590ceecbe2a0391
2019-03-11 20:53:57 -04:00
JohnSully ddeb29f362 Explain how multithreading works
Former-commit-id: 470e9d3ba0b90bab43f664bc66e1fbae9d2b2c96
2019-03-11 20:37:57 -04:00
JohnSully f472e3fba4 Update README.md
Former-commit-id: 775ab46cd694f9705ca7999f05c55878dad89fb4
2019-03-11 19:38:20 -04:00
John Sully 6e4dee9687 Make storage.h C++ safe
Former-commit-id: 6bf67d298968b28481d09f244951630dc44c92a7
2019-03-09 13:42:08 -05:00
John Sully d2e0c2ef1a sizeof is too big
Former-commit-id: 78e43a4b439576f451ad120bef337bdb8980c0f2
2019-03-09 13:41:49 -05:00
John Sully 6f2f0c8d72 bump version
Former-commit-id: 46707e2bdc2836955d276e28439add47166dbe75
2019-03-07 19:13:59 -05:00
John Sully 90f358a03d Merge branch 'unstable' into RELEASE_0_9
Former-commit-id: c6f1b7c1177fed320f64928f209da4398fd4493a
2019-03-07 19:13:33 -05:00
John Sully 538df67ba9 Module threading fixes
Former-commit-id: 6e830e357135b02aef47e90fafcad9b08684a111
2019-03-07 19:13:01 -05:00
John Sully e82dafa276 Merge branch 'unstable' into RELEASE_0_9
Former-commit-id: c31d512debcc9ea6fe21f60743e62d3aa8572b8e
2019-03-06 16:39:15 -05:00
John Sully 34dcc23556 Limit server-threads to cores in the machine
Former-commit-id: 80175ff059662f0b72eaabaf4328c801c8f379d9
2019-03-06 16:39:02 -05:00
John Sully 3a22280da6 port server.c to server.cpp
Former-commit-id: a6d25b92df52e436e5cf8c23ecc258f68abda00f
2019-03-06 16:29:30 -05:00
John Sully 5bba6cd4f0 Set version
Former-commit-id: 10e7adc4286f454e9c2a53a7959728716b239968
2019-03-06 15:25:28 -05:00
John Sully 1364c71cb9 Don't send replies to slaves after we've queued them to be closed
Former-commit-id: 3ca5ceeed4419b5ddb8bf4a1a3553ef17c1bb8e6
2019-03-06 15:21:05 -05:00
John Sully 04d7bb8352 defer free
Former-commit-id: fcf2ce17fd049269c822b1a3bcb24d4566ae5776
2019-03-05 15:46:19 -05:00
John Sully 8291a3b761 Fix crash with paused clients (accessed when global lock is not acquired)
Former-commit-id: 713f1d98a73e85a5899cf1b2bae56d3f4500e0c9
2019-03-03 22:24:12 -05:00
John Sully f59cbeb37f Crash in Memory Doctor when all clients are slaves
Former-commit-id: acf69818fee53f1d1c37211819e9cd1b7c1bde5a
2019-03-03 13:56:47 -05:00
John Sully 0065113cf0 Fix issue #2, check posix return values
Former-commit-id: fbfec97ccdae8399ddd593e32bd1dd510718d0c6
2019-03-02 20:43:03 -05:00
John Sully ade064cb28 sds copies uninitialized data wasting time for everyone
Former-commit-id: fa7b8863924f97e2e708a9b7f832bc01219fd17a
2019-03-02 19:27:52 -05:00
John Sully eb5cd9cba6 Merge branch 'unstable' of https://github.com/antirez/redis into unstable
We want that awesome multithreaded benchmark


Former-commit-id: 97234040674f82a3c948b1151b3af9935ee950e6
2019-03-02 18:07:18 -05:00
John Sully de96c777f8 write fastlock_unlock in ASM... because its faster
Former-commit-id: 70bf74835f3c06ed0ad6abb92a7ab8826ee2fade
2019-03-02 16:47:27 -05:00
John Sully 6a2952102c Merge branch 'unstable' of https://github.com/JohnSully/redis2 into unstable
Former-commit-id: 535b158b637aa83bd95d9a1df28bb1a58a571922
2019-03-01 16:40:20 -05:00
John Sully 67d291ce06 tighten up the spinlock loop, and some other bikeshedding
Former-commit-id: 605cc93caaae97bbb4beb6ef7e5b5c4e7c1c063b
2019-03-01 13:29:21 -05:00
John Sully 4b8e69093f remove unnecessary logs
Former-commit-id: 47415c39882918ef2e83ed6ac087e5efef50215b
2019-02-28 13:57:58 -05:00
JohnSully fba69489d8 Update README.md
Former-commit-id: ab0365eaad85fd627a2da7f5b86527abfb526f58
2019-02-26 15:16:46 -05:00
John Sully e4041e18c9 Merge branch 'unstable' of https://github.com/JohnSully/redis2 into unstable
Former-commit-id: 24b0ad6baa299cc79e62c379e038d911efa4e681
2019-02-26 15:14:50 -05:00
John Sully 5257f22e7f Thread affinity feature (default disabled)
Former-commit-id: edb5b93d5b33c68a466cd53459d912343a4a1bf8
2019-02-26 15:14:35 -05:00
JohnSully 539555b7b0 Link to detailed benchmarking results and methodology.
Former-commit-id: f6790c39c8486041d15ea60735725f2f24506edd
2019-02-26 15:11:25 -05:00
JohnSully b0bfd7adb0 More fine tuning help. Hopefully we can automate this.
Former-commit-id: c3517a8070f15611c8198e4a652fd5e6cf147646
2019-02-26 03:30:37 -05:00
JohnSully fb05d4f84d Update benchmarking notes.
Former-commit-id: 147acabffbd7b4a582202d88521aa4bfe06f271d
2019-02-26 02:30:03 -05:00
John Sully 2a61d348e4 test code shouldn't be commited
Former-commit-id: 26eaee03cea28666b905fd137aa51d926d28b955
2019-02-26 00:21:37 -05:00
John Sully 07f64657e6 Merge branch 'unstable' of https://github.com/JohnSully/redis2 into unstable
Former-commit-id: c6320904c90678df4b5782c0953f8b63d1e3ca2a
2019-02-26 00:20:11 -05:00
John Sully 257429ad00 writes shouldn't be under the global lock
Former-commit-id: d35a80076aaf8ed241cbf689afdbfd8875d234f1
2019-02-26 00:19:38 -05:00
John Sully 2967d7e923 Option to disable ASM spinlock
Former-commit-id: 2fa1b112df7ffdf3a3881cd127f83f97b08a45f2
2019-02-26 00:00:04 -05:00
John Sully c3968ba459 Fix build break
Former-commit-id: 0aeaae654a01f6ba733d408e44cbc9523778835c
2019-02-26 01:10:07 +00:00
John Sully 20c1d65195 Rewrite our spinlock in assembly, pretty big performance improvement
Former-commit-id: b3c59d926ffb270f77c5b890d0ff365a8417b370
2019-02-25 18:21:27 -05:00
JohnSully 860afe02bd Formatting (more)
Former-commit-id: 15b4a0ec337386e209e646429fe1d907cf5fd484
2019-02-23 03:08:24 -05:00
John Sully e0eddee39b Update copyright to include additional authorship
Former-commit-id: 0f933b341046ffe9870d77d9003717d12ee2c1f2
2019-02-23 02:27:19 -05:00
John Sully 472b2f3a5b Merge branch 'unstable' of https://github.com/JohnSully/redis2 into unstable
Former-commit-id: 1a56dc2948d93391113e8e4180372457471f3b05
2019-02-23 02:25:00 -05:00
John Sully 9492019b61 Merge branch 'Multithread' into unstable
Former-commit-id: 6451edd213d7f2140be9ebc128270eef874b63f3
2019-02-23 02:24:23 -05:00
JohnSully ad78760cff More edits
Former-commit-id: 78a28466aec1a667733ed5b85ee5e6b29066adf3
2019-02-23 01:48:05 -05:00
JohnSully 30d172c9e0 type
Former-commit-id: 4caaaa351b121a14c3b64d28aa6a9393c3be4164
2019-02-23 01:33:27 -05:00
JohnSully cf450a71fd Formatting
Former-commit-id: 975d7226a2902fa1e6db0d8c2f63071b51357df2
2019-02-23 01:32:50 -05:00
JohnSully 2c69ea377f Initial rewrite of Readme
Former-commit-id: 779d053e5d764bb9cbe1b841bff455424d4d3e5a
2019-02-23 01:28:44 -05:00
John Sully ceb64cd9af Fastlock fixes
Former-commit-id: 79692749551e25ddf89590652bfae7de2440faf6
2019-02-10 22:00:19 -05:00
John Sully cdf373825b move ae to C++
Former-commit-id: 092d0fc3fcd21bbd4cde945ccee32196ceb4d5d6
2019-02-10 20:24:11 -05:00
John Sully e230855554 Keep pool allocator up to date (even though we aren't enabling it)
Former-commit-id: fd7389ed0ed3d502e56179ed5e6c91833a980ec0
2019-02-10 19:33:07 -05:00
John Sully 0c36b7be49 Prevent so many copies of sdslen getting added
Former-commit-id: 7ad943c9f7af5cbdf7150324cfea736458d8277f
2019-02-10 19:31:46 -05:00
John Sully df20ddc444 Performance enhancements!
Former-commit-id: ee19012f96c01834713cd903dc82c71839c5d279
2019-02-09 13:05:06 -05:00
John Sully 88638b1c72 Reduce memory usage for in place strings by 8 bytes
Former-commit-id: c65045b639913afe088d1e2f47d760d323a6d53f
2019-02-09 13:04:18 -05:00
John Sully 0411a1b87e complete rebranding with tests passing
Former-commit-id: 1a90d294fce94e1d8905df28e4922609c4b5b8df
2019-02-09 10:11:46 -05:00
John Sully bacbf3a13e Fix bug where we try to load a database with no name
Former-commit-id: 8c6b4e9af4d49cf8999992c856d64aa3ab20f30c
2019-02-09 07:56:45 -05:00
John Sully 897ac7e956 remove Redis branding
Former-commit-id: fe86a507d2bbefbf705f1318f36d27a445016948
2019-02-08 17:56:32 -05:00
John Sully a74a7c2629 Support AWS S3 saving via the s3 cli tools
Former-commit-id: b2fae6707411fdb2e14684ee2892f85d3edcd1b7
2019-02-06 01:06:48 -05:00
John Sully d0a713aca2 Merge branch 'unstable' of https://github.com/antirez/redis into unstable
Former-commit-id: e9d15233dee4b1cb4b20325ab1ff8d1836ad0a13
2019-02-06 00:09:39 -05:00
John Sully bc4a0de024 Make main headers C++ safe, and change rdb to use file descriptor instead of FILE pointer
Former-commit-id: 9830785eb415f7671e823569c6d5314656d75e6f
2019-02-05 23:36:40 -05:00
John Sully 4e98e1f289 complete malloc memory class work, and pass tests
Former-commit-id: 0b93f6ccb86564317809273b5c73c81c3b385158
2019-02-04 16:56:13 -05:00
John Sully 921488398f Properly integrate memkind
Former-commit-id: 11b067329438dcea2a02f5482962e78582a91ea7
2019-02-01 15:21:00 -05:00
John Sully 629c096da4 Merge commit '09a263e6076b3fd0fe3b094a2bfad7f93fc997d6' as 'deps/memkind/src'
Former-commit-id: 7758c643692be25c17573e67acc17d31c4234bd7
2019-02-01 14:45:39 -05:00
John Sully 7a7236749d template config
Former-commit-id: 0a2e59c9c179060361585a0f3d81d31563520bd4
2019-02-01 14:01:35 -05:00
John Sully 29c5308396 Support configurable file backed scratch
Former-commit-id: 156419641a1ad54da45b45c6213198b669bd9da8
2019-02-01 13:54:59 -05:00
John Sully 494b359d81 crash fixes
Former-commit-id: 2f71096389ef2a5122248529206a80e4a47de673
2019-01-30 01:15:10 -05:00
John Sully 5ea2ee209a Custom flash heap
Former-commit-id: d9fdd4ebe86633a73d995d7a0910f3f1ca133cdb
2019-01-29 18:10:46 -05:00
126 changed files with 1404 additions and 7176 deletions

No files matched your search

+18 -23
View File
@@ -8,52 +8,40 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: make
run: |
sudo apt-get update
sudo apt-get -y remove libzstd || true
sudo apt-get -y install uuid-dev libcurl4-openssl-dev libbz2-dev zlib1g-dev libsnappy-dev liblz4-dev libzstd-dev libgflags-dev
make BUILD_TLS=yes -j2 KEYDB_CFLAGS='-Werror' KEYDB_CXXFLAGS='-Werror'
sudo apt-get -y install uuid-dev libcurl4-openssl-dev
make KEYDB_CFLAGS='-Werror' KEYDB_CXXFLAGS='-Werror' BUILD_TLS=yes -j2
- name: gen-cert
run: ./utils/gen-test-certs.sh
- name: test-tls
run: |
sudo apt-get -y install tcl tcl-tls
./runtest --clients 1 --verbose --tls --config server-threads 3
./runtest --clients 2 --verbose --tls
- name: cluster-test
run: |
./runtest-cluster --tls --config server-threads 3
./runtest-cluster --tls
- name: sentinel test
run: |
./runtest-sentinel
- name: module tests
run: |
./runtest-moduleapi
- name: rotation test
run: |
./runtest-rotation
build-ubuntu-old:
runs-on: ubuntu-20.04
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/checkout@v1
- name: make -j2
run: |
sudo apt-get update
sudo apt-get -y remove libzstd || true
sudo apt-get -y install uuid-dev libcurl4-openssl-dev libbz2-dev zlib1g-dev libsnappy-dev liblz4-dev libzstd-dev libgflags-dev
sudo apt-get -y install uuid-dev libcurl4-openssl-dev
make -j2
build-macos-latest:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: make
run: make KEYDB_CFLAGS='-Werror' KEYDB_CXXFLAGS='-Werror' -j2
@@ -61,11 +49,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: make
run: |
sudo apt-get update
sudo apt-get -y remove libzstd || true
sudo apt-get -y install uuid-dev libcurl4-openssl-dev libbz2-dev zlib1g-dev libsnappy-dev liblz4-dev libzstd-dev libgflags-dev
sudo apt-get -y install uuid-dev libcurl4-openssl-dev
make KEYDB_CFLAGS='-Werror' KEYDB_CXXFLAGS='-Werror' MALLOC=libc -j2
build-ubuntu-32bit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: make
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get -y install gcc-multilib g++-multilib libc6-dev-i386 lib32z1 uuid-dev:i386 libcurl4-openssl-dev:i386
make KEYDB_CFLAGS='-Werror' KEYDB_CXXFLAGS='-Werror' 32bit -j2
+4 -16
View File
@@ -4,7 +4,7 @@
##### KeyDB is now a part of Snap Inc! Check out the announcement [here](https://docs.keydb.dev/news/2022/05/12/keydb-joins-snap)
##### [Release v6.3.0](https://github.com/EQ-Alpha/KeyDB/releases/tag/v6.3.0) is here with major improvements as we consolidate our Open Source and Enterprise offerings into a single BSD-3 licensed project. See our [roadmap](https://docs.keydb.dev/docs/coming-soon) for details.
##### [Release v6.3.0](https://github.com/EQ-Alpha/KeyDB/releases/tag/v6.3.0) is here with major improvements as we consolodate our Open Source and Enterprise offerings into a single BSD-3 licensed project. See our [roadmap](https://docs.keydb.dev/docs/coming-soon) for details.
##### Want to extend KeyDB with Javascript? Try [ModJS](https://github.com/JohnSully/ModJS)
@@ -37,7 +37,7 @@ Because of this difference of opinion features which are right for KeyDB may not
Project Support
-------------------
The KeyDB team maintains this project as part of Snap Inc. KeyDB is used by Snap as part of its caching infrastructure and is fully open sourced. There is no separate commercial product and no paid support options available. We really value collaborating with the open source community and welcome PRs, bug reports, and open discussion. For community support or to get involved further with the project check out our community support options [here](https://docs.keydb.dev/docs/support) (slack, forum, meetup, github issues). Our team monitors these channels regularly.
The KeyDB team maintains this project as part of Snap Inc. KeyDB is used by Snap as part of its caching infrastructure and is fully open sourced. There is no separate commercial product and no paid support options available. We really value collaborating with the open source community and welcome PRs, bug reports, and open discussion. For community support or to get involved further with the project check out our community support options [here](https://docs.keydb.dev/docs/support) (slack, forum, meetup, github issues). Our team monitors these channlels regularly.
Additional Resources
@@ -104,12 +104,6 @@ Avoid forwarding RREPLAY messages to other masters? WARNING: This setting is dan
If you would like KeyDB to dump and load directly to AWS S3 this option specifies the bucket. Using this option with the traditional RDB options will result in KeyDB backing up twice to both locations. If both are specified KeyDB will first attempt to load from the local dump file and if that fails load from S3. This requires the AWS CLI tools to be installed and configured which are used under the hood to transfer the data.
```
storage-provider flash /path/to/flash
```
If you would like to use KeyDB FLASH storage, specify the storage medium followed by the directory path on your local SSD volume. Note that this feature is still considered experimental and should be used with discretion. See [FLASH Documentation](https://docs.keydb.dev/docs/flash) for more details on configuration and setting up your FLASH volume.
Building KeyDB
--------------
@@ -141,9 +135,9 @@ To append a suffix to KeyDB program names, use:
***Note that the following dependencies may be needed:
% sudo apt-get install autoconf autotools-dev libnuma-dev libtool
KeyDB by default is built with TLS enabled. To build without TLS support, use:
To buik=ld with TLS support, use:
% make BUILD_TLS=no
% make BUILD_TLS=yes
Running the tests with TLS enabled (you will need `tcl-tls`
installed):
@@ -151,12 +145,6 @@ installed):
% ./utils/gen-test-certs.sh
% ./runtest --tls
To build with KeyDB FLASH support, use:
% make ENABLE_FLASH=yes
***Note that the KeyDB FLASH feature is considered experimental (beta) and should used with discretion
Fixing build problems with dependencies or cached build options
---------
-70
View File
@@ -1,70 +0,0 @@
# Doc: https://wiki.sc-corp.net/pages/viewpage.action?pageId=121500284
version: 1
machamp:
keydb-build:
# Optional - build counter is linked to the build def
tag_template: "0.0.%build.counter%-%sha%"
# Optional - value in seconds before a build is terminated, default is 3600 seconds
timeout: 3600
# Optional - update ghe or not, default to true
update_ghe: true
code_coverage: false
# Required
steps:
make-build:
type: cmd
# https://github.sc-corp.net/Snapchat/img/tree/master/keydb/ubuntu-20-04
builder_image: us.gcr.io/snapchat-build-artifacts/prod/snapchat/img/keydb/keydb-ubuntu-20-04@sha256:cf869a3f5d1de1e1d976bb906689c37b7031938eb68661b844a38c532f27248c
command: ./machamp_scripts/build.sh
tls-test:
type: cmd
parent: make-build
# https://github.sc-corp.net/Snapchat/img/tree/master/keydb/ubuntu-20-04
builder_image: us.gcr.io/snapchat-build-artifacts/prod/snapchat/img/keydb/keydb-ubuntu-20-04@sha256:cf869a3f5d1de1e1d976bb906689c37b7031938eb68661b844a38c532f27248c
command: ./runtest --clients 4 --verbose
cluster-test:
type: cmd
parent: make-build
# https://github.sc-corp.net/Snapchat/img/tree/master/keydb/ubuntu-20-04
builder_image: us.gcr.io/snapchat-build-artifacts/prod/snapchat/img/keydb/keydb-ubuntu-20-04@sha256:cf869a3f5d1de1e1d976bb906689c37b7031938eb68661b844a38c532f27248c
command: ./runtest-cluster
sentinel-test:
type: cmd
parent: make-build
# https://github.sc-corp.net/Snapchat/img/tree/master/keydb/ubuntu-20-04
builder_image: us.gcr.io/snapchat-build-artifacts/prod/snapchat/img/keydb/keydb-ubuntu-20-04@sha256:cf869a3f5d1de1e1d976bb906689c37b7031938eb68661b844a38c532f27248c
command: ./runtest-sentinel
module-test:
type: cmd
parent: make-build
# https://github.sc-corp.net/Snapchat/img/tree/master/keydb/ubuntu-20-04
builder_image: us.gcr.io/snapchat-build-artifacts/prod/snapchat/img/keydb/keydb-ubuntu-20-04@sha256:cf869a3f5d1de1e1d976bb906689c37b7031938eb68661b844a38c532f27248c
command: ./runtest-moduleapi
rotation-test:
type: cmd
parent: make-build
# https://github.sc-corp.net/Snapchat/img/tree/master/keydb/ubuntu-20-04
builder_image: us.gcr.io/snapchat-build-artifacts/prod/snapchat/img/keydb/keydb-ubuntu-20-04@sha256:cf869a3f5d1de1e1d976bb906689c37b7031938eb68661b844a38c532f27248c
command: ./runtest-rotation
keydb-docker-build:
# Optional - build counter is linked to the build def
tag_template: "%sha%"
# Optional - value in seconds before a build is terminated, default is 3600 seconds
timeout: 3600
# Optional - update ghe or not, default to true
update_ghe: true
code_coverage: false
# Required
steps:
# to ensure a clearer docker build env
code-checkout:
type: cmd
command: echo checkout
# default machamp builder image does not work for multi arch
builder_image: us.gcr.io/snapchat-build-artifacts/prod/snapchat/img/ubuntu/ubuntu-23-04@sha256:bd43177a80e6ce1c3583e8ea959b88a9081c0f56b765ec9c5a157c27a637c23b
docker:
parent: code-checkout
type: docker # published images can be found in https://console.cloud.google.com/gcr/images/machamp-prod/global/keydb
dockerfile: machamp_scripts/Dockerfile
image_name: keydb # git commit sha will be deafult tag in the final image
workspace_context: ./ # This is the workspace context that your Dockerfile will use to move files around. <Root of checkout repository>/<Workspace Context>/<Dockerfile> If the workspace context is just the root of the repository, you can just use "./".
-35
View File
@@ -1,35 +0,0 @@
# Doc: https://wiki.sc-corp.net/display/TOOL/ci.yaml+User+Guide
version: 1
on:
# https://wiki.sc-corp.net/display/TOOL/Onboard+Machamp+Build+By+ci.yaml+Configuration
# on pull_request is used for any pr build
pull_request:
- branches: ['!!main', '*'] # this branch pattern means any branch but not main branch will trigger this pr build
workflows:
# All builds that use machamp should use the defined `backend_workflow`
- workflow_type: backend_workflow
# references a build defined in build.yaml
build_name: keydb-build
arch_types: ["amd64", "arm64"]
- workflow_type: backend_workflow
# references a build defined in build.yaml
build_name: keydb-docker-build
arch_types: ["amd64", "arm64"]
# on push is used for release branch, meaning: trigger this build when there is commit pushed to this branch
push:
- branches: [main]
workflows:
- workflow_type: backend_workflow
build_name: keydb-build
arch_types: ["amd64", "arm64"]
- workflow_type: backend_workflow
# references a build defined in build.yaml
build_name: keydb-docker-build
arch_types: ["amd64", "arm64"]
# below defines which branch is release branch / release tag
machamp:
releases:
# Note: machamp will only respect the ci.yaml file from default branch for "release branch" definition (most repositories using master/main as default branch)
# https://wiki.sc-corp.net/display/TOOL/Onboard+Machamp+Build+By+ci.yaml+Configuration
- branch_name: ^main$
+1 -1
View File
@@ -95,7 +95,7 @@ JEMALLOC_LDFLAGS= $(LDFLAGS)
jemalloc: .make-prerequisites
@printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
cd jemalloc && ./configure --with-version=5.2.1-0-g0 --with-lg-quantum=3 --disable-cxx CFLAGS="$(JEMALLOC_CFLAGS)" LDFLAGS="$(JEMALLOC_LDFLAGS)"
cd jemalloc && ./configure --with-version=5.2.1-0-g0 --with-lg-quantum=3 --with-jemalloc-prefix=je_ --disable-cxx CFLAGS="$(JEMALLOC_CFLAGS)" LDFLAGS="$(JEMALLOC_LDFLAGS)"
cd jemalloc && $(MAKE) CFLAGS="$(JEMALLOC_CFLAGS)" LDFLAGS="$(JEMALLOC_LDFLAGS)" lib/libjemalloc.a
.PHONY: jemalloc
-105
View File
@@ -1,105 +0,0 @@
AccessModifierOffset: -4
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortFunctionsOnASingleLine: Empty
BinPackArguments: false
BinPackParameters: false
ColumnLimit: 120
IndentCaseLabels: false
IndentWidth: 4
---
Language: Cpp
# BasedOnStyle: Google
#AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
#AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
#AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
#BinPackArguments: true
#BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
#ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: true
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*'
Priority: 2
- Regex: '.*'
Priority: 3
IncludeIsMainRegex: '([-_](test|unittest))?$'
#IndentCaseLabels: true
#IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
TabWidth: 8
UseTab: Never
...
-30
View File
@@ -1,30 +0,0 @@
name: Coverage
on: [push, pull_request]
jobs:
coverage:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y -qq make cmake gcc g++ lcov bc
- name: build
shell: bash
run: |
export LD_LIBRARY_PATH=.:$(cat /etc/ld.so.conf.d/* | grep -vF "#" | tr "\\n" ":" | sed -e "s/:$//g")
cmake . -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=On
make all -j$(nproc)
- name: coverage
shell: bash
run: |
make coverage
lines=$(lcov --summary coverage.info | grep -F lines | awk '{print $2}' | sed -e "s/%//g")
if (( $(echo "${lines} < ${COVERAGE_THRESHOLD}" | bc -l) )); then
echo "Line coverage dropped below ${COVERAGE_THRESHOLD}% to ${lines}%"
exit 1
fi
env:
COVERAGE_THRESHOLD: 85.0
-13
View File
@@ -1,13 +0,0 @@
name: Lint
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: lint
uses: DoozyX/clang-format-lint-action@v0.12
with:
clangFormatVersion: 12
source: './include/cpp-statsd-client ./tests'
-23
View File
@@ -1,23 +0,0 @@
name: Linux
on: [push, pull_request]
jobs:
linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y -qq make cmake gcc g++
- name: build
shell: bash
run: |
export LD_LIBRARY_PATH=.:$(cat /etc/ld.so.conf.d/* | grep -vF "#" | tr "\\n" ":" | sed -e "s/:$//g")
cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_SANITIZERS=On
make all -j$(nproc)
- name: test
shell: bash
run: |
make test
-18
View File
@@ -1,18 +0,0 @@
name: Windows
on: [push, pull_request]
jobs:
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: dependencies
run: |
choco install cmake
- name: build
run: |
cmake -S . -B build -G "Visual Studio 16 2019" -A x64
cmake --build build --target ALL_BUILD --config Release
- name: test
run: |
cmake --build build --target RUN_TESTS --config Release
-1
View File
@@ -1 +0,0 @@
bin
-85
View File
@@ -1,85 +0,0 @@
# Basic project setup
cmake_minimum_required(VERSION 3.5)
project(cpp-statsd-client
VERSION 1.0.2
LANGUAGES CXX
DESCRIPTION "A header-only StatsD client implemented in C++"
HOMEPAGE_URL "https://github.com/vthiery/cpp-statsd-client")
option(CPP_STATSD_STANDALONE "Allows configuration of targets for verifying library functionality" ON)
option(ENABLE_TESTS "Build tests" ON)
option(ENABLE_COVERAGE "Build with coverage instrumentalisation" OFF)
if(NOT CPP_STATSD_STANDALONE)
set(ENABLE_TESTS OFF)
set(ENABLE_COVERAGE OFF)
endif()
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
find_package(Threads)
# Optional code coverage targets
if(ENABLE_COVERAGE)
set(COVERAGE_EXCLUDES /usr/*)
include(${PROJECT_SOURCE_DIR}/cmake/CodeCoverage.cmake)
APPEND_COVERAGE_COMPILER_FLAGS()
SETUP_TARGET_FOR_COVERAGE_LCOV(NAME coverage
EXECUTABLE testStatsdClient
DEPENDENCIES ${PROJECT_NAME}
)
endif()
# The library target
add_library(${PROJECT_NAME} INTERFACE)
target_include_directories(
${PROJECT_NAME}
INTERFACE $<BUILD_INTERFACE:${${PROJECT_NAME}_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
target_link_libraries(${PROJECT_NAME} INTERFACE Threads::Threads)
if(WIN32)
target_link_libraries(${PROJECT_NAME} INTERFACE ws2_32)
endif()
# The installation and pkg-config-like cmake config
install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}_Targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion)
configure_package_config_file(
"${PROJECT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake)
install(EXPORT ${PROJECT_NAME}_Targets
FILE ${PROJECT_NAME}Targets.cmake
NAMESPACE ${PROJECT_NAME}::
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake)
install(FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include DESTINATION include)
if(ENABLE_TESTS)
# The test targets
add_executable(testStatsdClient ${CMAKE_CURRENT_SOURCE_DIR}/tests/testStatsdClient.cpp)
if(WIN32)
target_compile_options(testStatsdClient PRIVATE -W4 -WX /external:W0)
else()
target_compile_options(testStatsdClient PRIVATE -Wall -Wextra -pedantic -Werror)
endif()
target_include_directories(testStatsdClient PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests)
target_link_libraries(testStatsdClient ${PROJECT_NAME})
set_property(TARGET testStatsdClient PROPERTY CXX_STANDARD 11)
set_property(TARGET testStatsdClient PROPERTY CXX_EXTENSIONS OFF)
# The test suite
enable_testing()
add_test(ctestTestStatsdClient testStatsdClient)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS testStatsdClient)
endif()
-9
View File
@@ -1,9 +0,0 @@
MIT License
Copyright (c) 2017 Vincent Thiery
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-22
View File
@@ -1,22 +0,0 @@
# simple makefile to build, test and clean
BUILD_MODE ?= Release
ENABLE_COVERAGE ?= On
build: clean
@echo "Build in ${BUILD_MODE} mode"
mkdir -p bin/${BUILD_MODE}
@cd bin/${BUILD_MODE}; cmake ../../ -DCMAKE_BUILD_TYPE=${BUILD_MODE} -DENABLE_COVERAGE=${ENABLE_COVERAGE}
@cd bin/${BUILD_MODE}; make
test: build
@cd bin/${BUILD_MODE}; make test
coverage: build
@cd bin/${BUILD_MODE}; make coverage
install: build
@cd bin/${BUILD_MODE}; make install
clean:
@rm -rf bin
-150
View File
@@ -1,150 +0,0 @@
# C++ StatsD Client
![logo](https://raw.githubusercontent.com/vthiery/cpp-statsd-client/master/images/logo.svg?sanitize=true)
[![Release](https://img.shields.io/github/release/vthiery/cpp-statsd-client.svg?style=for-the-badge)](https://github.com/vthiery/cpp-statsd-client/releases/latest)
![License](https://img.shields.io/github/license/vthiery/cpp-statsd-client?style=for-the-badge)
[![Linux status](https://img.shields.io/github/workflow/status/vthiery/cpp-statsd-client/Linux?label=Linux&style=for-the-badge)](https://github.com/vthiery/cpp-statsd-client/actions/workflows/linux.yml?query=branch%3Amaster++)
[![Windows status](https://img.shields.io/github/workflow/status/vthiery/cpp-statsd-client/Windows?label=Windows&style=for-the-badge)](https://github.com/vthiery/cpp-statsd-client/actions/workflows/windows.yml?query=branch%3Amaster++)
A header-only StatsD client implemented in C++.
The client allows:
- batching,
- change of configuration at runtime,
- user-defined frequency rate.
## Install and Test
### Makefile
In order to install the header files and/or run the tests, simply use the Makefile and execute
```sh
make install
```
and
```sh
make test
```
### Conan
If you are using [Conan](https://www.conan.io/) to manage your dependencies, merely add statsdclient/x.y.z@vthiery/stable to your conanfile.py's requires, where x.y.z is the release version you want to use. Please file issues here if you experience problems with the packages. You can also directly download the latest version [here](https://bintray.com/vthiery/conan-packages/statsdclient%3Avthiery/_latestVersion).
## Usage
### Example
A simple example of how to use the client:
```cpp
#include "StatsdClient.hpp"
using namespace Statsd;
int main() {
// Define the client on localhost, with port 8080,
// using a prefix,
// a batching size of 20 bytes,
// and three points of precision for floating point gauge values
StatsdClient client{ "127.0.0.1", 8080, "myPrefix", 20, 3 };
// Increment the metric "coco"
client.increment("coco");
// Decrement the metric "kiki"
client.decrement("kiki");
// Adjusts "toto" by +3
client.count("toto", 2, 0.1f);
// Record a gauge "titi" to 3
client.gauge("titi", 3);
// Record a timing of 2ms for "myTiming"
client.timing("myTiming", 2, 0.1f);
// Send a metric explicitly
client.send("tutu", 4, "c", 2.0f);
exit(0);
}
```
### Advanced Testing
A simple mock StatsD server can be found at `tests/StatsdServer.hpp`. This can be used to do simple validation of your application's metrics, typically in the form of unit tests. In fact this is the primary means by which this library is tested. The mock server itself is not distributed with the library so to use it you'd need to vendor this project into your project. Once you have though, you can test your application's use of the client like so:
```cpp
#include "StatsdClient.hpp"
#include "StatsdServer.hpp"
#include <cassert>
using namespace Statsd;
struct MyApp {
void doWork() const {
m_client.count("bar", 3);
}
private:
StatsdClient m_client{"localhost", 8125, "foo"};
};
int main() {
StatsdServer mockServer;
MyApp app;
app.doWork();
assert(mockServer.receive() == "foo.bar:3|c");
exit(0);
}
```
### Configuration
The configuration of the client must be input when one instantiates it. Nevertheless, the API allows the configuration ot change afterwards. For example, one can do the following:
```cpp
#include "StatsdClient.hpp"
using namespace Statsd;
int main()
{
// Define the client on localhost, with port 8080,
// using a prefix,
// a batching size of 20 bytes,
// and three points of precision for floating point gauge values
StatsdClient client{ "127.0.0.1", 8080, "myPrefix", 20, 3 };
client.increment("coco");
// Set a new configuration, using a different port, a different prefix, and more gauge precision
client.setConfig("127.0.0.1", 8000, "anotherPrefix", 6);
client.decrement("kiki");
}
```
The batchsize is the only parameter that cannot be changed for the time being.
### Batching
The client supports batching of the metrics. The batch size parameter is the number of bytes to allow in each batch (UDP datagram payload) to be sent to the statsd process. This number is not a hard limit. If appending the current stat to the current batch (separated by the `'\n'` character) pushes the current batch over the batch size, that batch is enqueued (not sent) and a new batch is started. If batch size is 0, the default, then each stat is sent individually to the statsd process and no batches are enqueued.
### Sending
As previously mentioned, if batching is disabled (by setting the batch size to 0) then every stat is sent immediately in a blocking fashion. If batching is enabled (ie non-zero) then you may also set the send interval. The send interval controls the time, in milliseconds, to wait before flushing/sending the queued stats batches to the statsd process. When the send interval is non-zero a background thread is spawned which will do the flushing/sending at the configured send interval, in other words asynchronously. The queuing mechanism in this case is *not* lock-free. If batching is enabled but the send interval is set to zero then the queued batchs of stats will not be sent automatically by a background thread but must be sent manually via the `flush` method. The `flush` method is a blocking call.
### Frequency rate
When sending a metric, a frequency rate can be set in order to limit the metrics' sampling. By default, the frequency rate is set to one and won't affect the sampling. If set to a value `epsilon` (0.0001 for the time being) close to one, the sampling is not affected either.
If the frequency rate is set and `epsilon` different from one, the sending will be rejected randomly (the higher the frequency rate, the lower the probability of rejection).
## License
This library is under MIT license.
-708
View File
@@ -1,708 +0,0 @@
# Copyright (c) 2012 - 2017, Lars Bilke
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# CHANGES:
#
# 2012-01-31, Lars Bilke
# - Enable Code Coverage
#
# 2013-09-17, Joakim Söderberg
# - Added support for Clang.
# - Some additional usage instructions.
#
# 2016-02-03, Lars Bilke
# - Refactored functions to use named parameters
#
# 2017-06-02, Lars Bilke
# - Merged with modified version from github.com/ufz/ogs
#
# 2019-05-06, Anatolii Kurotych
# - Remove unnecessary --coverage flag
#
# 2019-12-13, FeRD (Frank Dana)
# - Deprecate COVERAGE_LCOVR_EXCLUDES and COVERAGE_GCOVR_EXCLUDES lists in favor
# of tool-agnostic COVERAGE_EXCLUDES variable, or EXCLUDE setup arguments.
# - CMake 3.4+: All excludes can be specified relative to BASE_DIRECTORY
# - All setup functions: accept BASE_DIRECTORY, EXCLUDE list
# - Set lcov basedir with -b argument
# - Add automatic --demangle-cpp in lcovr, if 'c++filt' is available (can be
# overridden with NO_DEMANGLE option in setup_target_for_coverage_lcovr().)
# - Delete output dir, .info file on 'make clean'
# - Remove Python detection, since version mismatches will break gcovr
# - Minor cleanup (lowercase function names, update examples...)
#
# 2019-12-19, FeRD (Frank Dana)
# - Rename Lcov outputs, make filtered file canonical, fix cleanup for targets
#
# 2020-01-19, Bob Apthorpe
# - Added gfortran support
#
# 2020-02-17, FeRD (Frank Dana)
# - Make all add_custom_target()s VERBATIM to auto-escape wildcard characters
# in EXCLUDEs, and remove manual escaping from gcovr targets
#
# 2021-01-19, Robin Mueller
# - Add CODE_COVERAGE_VERBOSE option which will allow to print out commands which are run
# - Added the option for users to set the GCOVR_ADDITIONAL_ARGS variable to supply additional
# flags to the gcovr command
#
# 2020-05-04, Mihchael Davis
# - Add -fprofile-abs-path to make gcno files contain absolute paths
# - Fix BASE_DIRECTORY not working when defined
# - Change BYPRODUCT from folder to index.html to stop ninja from complaining about double defines
#
# 2021-05-10, Martin Stump
# - Check if the generator is multi-config before warning about non-Debug builds
#
# USAGE:
#
# 1. Copy this file into your cmake modules path.
#
# 2. Add the following line to your CMakeLists.txt (best inside an if-condition
# using a CMake option() to enable it just optionally):
# include(CodeCoverage)
#
# 3. Append necessary compiler flags:
# append_coverage_compiler_flags()
#
# 3.a (OPTIONAL) Set appropriate optimization flags, e.g. -O0, -O1 or -Og
#
# 4. If you need to exclude additional directories from the report, specify them
# using full paths in the COVERAGE_EXCLUDES variable before calling
# setup_target_for_coverage_*().
# Example:
# set(COVERAGE_EXCLUDES
# '${PROJECT_SOURCE_DIR}/src/dir1/*'
# '/path/to/my/src/dir2/*')
# Or, use the EXCLUDE argument to setup_target_for_coverage_*().
# Example:
# setup_target_for_coverage_lcov(
# NAME coverage
# EXECUTABLE testrunner
# EXCLUDE "${PROJECT_SOURCE_DIR}/src/dir1/*" "/path/to/my/src/dir2/*")
#
# 4.a NOTE: With CMake 3.4+, COVERAGE_EXCLUDES or EXCLUDE can also be set
# relative to the BASE_DIRECTORY (default: PROJECT_SOURCE_DIR)
# Example:
# set(COVERAGE_EXCLUDES "dir1/*")
# setup_target_for_coverage_gcovr_html(
# NAME coverage
# EXECUTABLE testrunner
# BASE_DIRECTORY "${PROJECT_SOURCE_DIR}/src"
# EXCLUDE "dir2/*")
#
# 5. Use the functions described below to create a custom make target which
# runs your test executable and produces a code coverage report.
#
# 6. Build a Debug build:
# cmake -DCMAKE_BUILD_TYPE=Debug ..
# make
# make my_coverage_target
#
include(CMakeParseArguments)
option(CODE_COVERAGE_VERBOSE "Verbose information" FALSE)
# Check prereqs
find_program( GCOV_PATH gcov )
find_program( LCOV_PATH NAMES lcov lcov.bat lcov.exe lcov.perl)
find_program( FASTCOV_PATH NAMES fastcov fastcov.py )
find_program( GENHTML_PATH NAMES genhtml genhtml.perl genhtml.bat )
find_program( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/scripts/test)
find_program( CPPFILT_PATH NAMES c++filt )
if(NOT GCOV_PATH)
message(FATAL_ERROR "gcov not found! Aborting...")
endif() # NOT GCOV_PATH
get_property(LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
list(GET LANGUAGES 0 LANG)
if("${CMAKE_${LANG}_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang")
if("${CMAKE_${LANG}_COMPILER_VERSION}" VERSION_LESS 3)
message(FATAL_ERROR "Clang version must be 3.0.0 or greater! Aborting...")
endif()
elseif(NOT CMAKE_COMPILER_IS_GNUCXX)
if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "[Ff]lang")
# Do nothing; exit conditional without error if true
elseif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
# Do nothing; exit conditional without error if true
else()
message(FATAL_ERROR "Compiler is not GNU gcc! Aborting...")
endif()
endif()
set(COVERAGE_COMPILER_FLAGS "-g -fprofile-arcs -ftest-coverage"
CACHE INTERNAL "")
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-fprofile-abs-path HAVE_fprofile_abs_path)
if(HAVE_fprofile_abs_path)
set(COVERAGE_COMPILER_FLAGS "${COVERAGE_COMPILER_FLAGS} -fprofile-abs-path")
endif()
endif()
set(CMAKE_Fortran_FLAGS_COVERAGE
${COVERAGE_COMPILER_FLAGS}
CACHE STRING "Flags used by the Fortran compiler during coverage builds."
FORCE )
set(CMAKE_CXX_FLAGS_COVERAGE
${COVERAGE_COMPILER_FLAGS}
CACHE STRING "Flags used by the C++ compiler during coverage builds."
FORCE )
set(CMAKE_C_FLAGS_COVERAGE
${COVERAGE_COMPILER_FLAGS}
CACHE STRING "Flags used by the C compiler during coverage builds."
FORCE )
set(CMAKE_EXE_LINKER_FLAGS_COVERAGE
""
CACHE STRING "Flags used for linking binaries during coverage builds."
FORCE )
set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
""
CACHE STRING "Flags used by the shared libraries linker during coverage builds."
FORCE )
mark_as_advanced(
CMAKE_Fortran_FLAGS_COVERAGE
CMAKE_CXX_FLAGS_COVERAGE
CMAKE_C_FLAGS_COVERAGE
CMAKE_EXE_LINKER_FLAGS_COVERAGE
CMAKE_SHARED_LINKER_FLAGS_COVERAGE )
get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR GENERATOR_IS_MULTI_CONFIG))
message(WARNING "Code coverage results with an optimised (non-Debug) build may be misleading")
endif() # NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR GENERATOR_IS_MULTI_CONFIG)
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
link_libraries(gcov)
endif()
# Defines a target for running and collection code coverage information
# Builds dependencies, runs the given executable and outputs reports.
# NOTE! The executable should always have a ZERO as exit code otherwise
# the coverage generation will not complete.
#
# setup_target_for_coverage_lcov(
# NAME testrunner_coverage # New target name
# EXECUTABLE testrunner -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
# DEPENDENCIES testrunner # Dependencies to build first
# BASE_DIRECTORY "../" # Base directory for report
# # (defaults to PROJECT_SOURCE_DIR)
# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative
# # to BASE_DIRECTORY, with CMake 3.4+)
# NO_DEMANGLE # Don't demangle C++ symbols
# # even if c++filt is found
# )
function(setup_target_for_coverage_lcov)
set(options NO_DEMANGLE)
set(oneValueArgs BASE_DIRECTORY NAME)
set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES LCOV_ARGS GENHTML_ARGS)
cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT LCOV_PATH)
message(FATAL_ERROR "lcov not found! Aborting...")
endif() # NOT LCOV_PATH
if(NOT GENHTML_PATH)
message(FATAL_ERROR "genhtml not found! Aborting...")
endif() # NOT GENHTML_PATH
# Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
if(DEFINED Coverage_BASE_DIRECTORY)
get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
else()
set(BASEDIR ${PROJECT_SOURCE_DIR})
endif()
# Collect excludes (CMake 3.4+: Also compute absolute paths)
set(LCOV_EXCLUDES "")
foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_LCOV_EXCLUDES})
if(CMAKE_VERSION VERSION_GREATER 3.4)
get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
endif()
list(APPEND LCOV_EXCLUDES "${EXCLUDE}")
endforeach()
list(REMOVE_DUPLICATES LCOV_EXCLUDES)
# Conditional arguments
if(CPPFILT_PATH AND NOT ${Coverage_NO_DEMANGLE})
set(GENHTML_EXTRA_ARGS "--demangle-cpp")
endif()
# Setting up commands which will be run to generate coverage data.
# Cleanup lcov
set(LCOV_CLEAN_CMD
${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -directory .
-b ${BASEDIR} --zerocounters
)
# Create baseline to make sure untouched files show up in the report
set(LCOV_BASELINE_CMD
${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -c -i -d . -b
${BASEDIR} -o ${Coverage_NAME}.base
)
# Run tests
set(LCOV_EXEC_TESTS_CMD
${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
)
# Capturing lcov counters and generating report
set(LCOV_CAPTURE_CMD
${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --directory . -b
${BASEDIR} --capture --output-file ${Coverage_NAME}.capture
)
# add baseline counters
set(LCOV_BASELINE_COUNT_CMD
${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -a ${Coverage_NAME}.base
-a ${Coverage_NAME}.capture --output-file ${Coverage_NAME}.total
)
# filter collected data to final coverage report
set(LCOV_FILTER_CMD
${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --remove
${Coverage_NAME}.total ${LCOV_EXCLUDES} --output-file ${Coverage_NAME}.info
)
# Generate HTML output
set(LCOV_GEN_HTML_CMD
${GENHTML_PATH} ${GENHTML_EXTRA_ARGS} ${Coverage_GENHTML_ARGS} -o
${Coverage_NAME} ${Coverage_NAME}.info
)
if(CODE_COVERAGE_VERBOSE)
message(STATUS "Executed command report")
message(STATUS "Command to clean up lcov: ")
string(REPLACE ";" " " LCOV_CLEAN_CMD_SPACED "${LCOV_CLEAN_CMD}")
message(STATUS "${LCOV_CLEAN_CMD_SPACED}")
message(STATUS "Command to create baseline: ")
string(REPLACE ";" " " LCOV_BASELINE_CMD_SPACED "${LCOV_BASELINE_CMD}")
message(STATUS "${LCOV_BASELINE_CMD_SPACED}")
message(STATUS "Command to run the tests: ")
string(REPLACE ";" " " LCOV_EXEC_TESTS_CMD_SPACED "${LCOV_EXEC_TESTS_CMD}")
message(STATUS "${LCOV_EXEC_TESTS_CMD_SPACED}")
message(STATUS "Command to capture counters and generate report: ")
string(REPLACE ";" " " LCOV_CAPTURE_CMD_SPACED "${LCOV_CAPTURE_CMD}")
message(STATUS "${LCOV_CAPTURE_CMD_SPACED}")
message(STATUS "Command to add baseline counters: ")
string(REPLACE ";" " " LCOV_BASELINE_COUNT_CMD_SPACED "${LCOV_BASELINE_COUNT_CMD}")
message(STATUS "${LCOV_BASELINE_COUNT_CMD_SPACED}")
message(STATUS "Command to filter collected data: ")
string(REPLACE ";" " " LCOV_FILTER_CMD_SPACED "${LCOV_FILTER_CMD}")
message(STATUS "${LCOV_FILTER_CMD_SPACED}")
message(STATUS "Command to generate lcov HTML output: ")
string(REPLACE ";" " " LCOV_GEN_HTML_CMD_SPACED "${LCOV_GEN_HTML_CMD}")
message(STATUS "${LCOV_GEN_HTML_CMD_SPACED}")
endif()
# Setup target
add_custom_target(${Coverage_NAME}
COMMAND ${LCOV_CLEAN_CMD}
COMMAND ${LCOV_BASELINE_CMD}
COMMAND ${LCOV_EXEC_TESTS_CMD}
COMMAND ${LCOV_CAPTURE_CMD}
COMMAND ${LCOV_BASELINE_COUNT_CMD}
COMMAND ${LCOV_FILTER_CMD}
COMMAND ${LCOV_GEN_HTML_CMD}
# Set output files as GENERATED (will be removed on 'make clean')
BYPRODUCTS
${Coverage_NAME}.base
${Coverage_NAME}.capture
${Coverage_NAME}.total
${Coverage_NAME}.info
${Coverage_NAME}/index.html
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
DEPENDS ${Coverage_DEPENDENCIES}
VERBATIM # Protect arguments to commands
COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
)
# Show where to find the lcov info report
add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
COMMAND ;
COMMENT "Lcov code coverage info report saved in ${Coverage_NAME}.info."
)
# Show info where to find the report
add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
COMMAND ;
COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
)
endfunction() # setup_target_for_coverage_lcov
# Defines a target for running and collection code coverage information
# Builds dependencies, runs the given executable and outputs reports.
# NOTE! The executable should always have a ZERO as exit code otherwise
# the coverage generation will not complete.
#
# setup_target_for_coverage_gcovr_xml(
# NAME ctest_coverage # New target name
# EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
# DEPENDENCIES executable_target # Dependencies to build first
# BASE_DIRECTORY "../" # Base directory for report
# # (defaults to PROJECT_SOURCE_DIR)
# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative
# # to BASE_DIRECTORY, with CMake 3.4+)
# )
# The user can set the variable GCOVR_ADDITIONAL_ARGS to supply additional flags to the
# GCVOR command.
function(setup_target_for_coverage_gcovr_xml)
set(options NONE)
set(oneValueArgs BASE_DIRECTORY NAME)
set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT GCOVR_PATH)
message(FATAL_ERROR "gcovr not found! Aborting...")
endif() # NOT GCOVR_PATH
# Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
if(DEFINED Coverage_BASE_DIRECTORY)
get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
else()
set(BASEDIR ${PROJECT_SOURCE_DIR})
endif()
# Collect excludes (CMake 3.4+: Also compute absolute paths)
set(GCOVR_EXCLUDES "")
foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_GCOVR_EXCLUDES})
if(CMAKE_VERSION VERSION_GREATER 3.4)
get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
endif()
list(APPEND GCOVR_EXCLUDES "${EXCLUDE}")
endforeach()
list(REMOVE_DUPLICATES GCOVR_EXCLUDES)
# Combine excludes to several -e arguments
set(GCOVR_EXCLUDE_ARGS "")
foreach(EXCLUDE ${GCOVR_EXCLUDES})
list(APPEND GCOVR_EXCLUDE_ARGS "-e")
list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}")
endforeach()
# Set up commands which will be run to generate coverage data
# Run tests
set(GCOVR_XML_EXEC_TESTS_CMD
${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
)
# Running gcovr
set(GCOVR_XML_CMD
${GCOVR_PATH} --xml -r ${BASEDIR} ${GCOVR_ADDITIONAL_ARGS} ${GCOVR_EXCLUDE_ARGS}
--object-directory=${PROJECT_BINARY_DIR} -o ${Coverage_NAME}.xml
)
if(CODE_COVERAGE_VERBOSE)
message(STATUS "Executed command report")
message(STATUS "Command to run tests: ")
string(REPLACE ";" " " GCOVR_XML_EXEC_TESTS_CMD_SPACED "${GCOVR_XML_EXEC_TESTS_CMD}")
message(STATUS "${GCOVR_XML_EXEC_TESTS_CMD_SPACED}")
message(STATUS "Command to generate gcovr XML coverage data: ")
string(REPLACE ";" " " GCOVR_XML_CMD_SPACED "${GCOVR_XML_CMD}")
message(STATUS "${GCOVR_XML_CMD_SPACED}")
endif()
add_custom_target(${Coverage_NAME}
COMMAND ${GCOVR_XML_EXEC_TESTS_CMD}
COMMAND ${GCOVR_XML_CMD}
BYPRODUCTS ${Coverage_NAME}.xml
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
DEPENDS ${Coverage_DEPENDENCIES}
VERBATIM # Protect arguments to commands
COMMENT "Running gcovr to produce Cobertura code coverage report."
)
# Show info where to find the report
add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
COMMAND ;
COMMENT "Cobertura code coverage report saved in ${Coverage_NAME}.xml."
)
endfunction() # setup_target_for_coverage_gcovr_xml
# Defines a target for running and collection code coverage information
# Builds dependencies, runs the given executable and outputs reports.
# NOTE! The executable should always have a ZERO as exit code otherwise
# the coverage generation will not complete.
#
# setup_target_for_coverage_gcovr_html(
# NAME ctest_coverage # New target name
# EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
# DEPENDENCIES executable_target # Dependencies to build first
# BASE_DIRECTORY "../" # Base directory for report
# # (defaults to PROJECT_SOURCE_DIR)
# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative
# # to BASE_DIRECTORY, with CMake 3.4+)
# )
# The user can set the variable GCOVR_ADDITIONAL_ARGS to supply additional flags to the
# GCVOR command.
function(setup_target_for_coverage_gcovr_html)
set(options NONE)
set(oneValueArgs BASE_DIRECTORY NAME)
set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT GCOVR_PATH)
message(FATAL_ERROR "gcovr not found! Aborting...")
endif() # NOT GCOVR_PATH
# Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
if(DEFINED Coverage_BASE_DIRECTORY)
get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
else()
set(BASEDIR ${PROJECT_SOURCE_DIR})
endif()
# Collect excludes (CMake 3.4+: Also compute absolute paths)
set(GCOVR_EXCLUDES "")
foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_GCOVR_EXCLUDES})
if(CMAKE_VERSION VERSION_GREATER 3.4)
get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
endif()
list(APPEND GCOVR_EXCLUDES "${EXCLUDE}")
endforeach()
list(REMOVE_DUPLICATES GCOVR_EXCLUDES)
# Combine excludes to several -e arguments
set(GCOVR_EXCLUDE_ARGS "")
foreach(EXCLUDE ${GCOVR_EXCLUDES})
list(APPEND GCOVR_EXCLUDE_ARGS "-e")
list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}")
endforeach()
# Set up commands which will be run to generate coverage data
# Run tests
set(GCOVR_HTML_EXEC_TESTS_CMD
${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
)
# Create folder
set(GCOVR_HTML_FOLDER_CMD
${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/${Coverage_NAME}
)
# Running gcovr
set(GCOVR_HTML_CMD
${GCOVR_PATH} --html --html-details -r ${BASEDIR} ${GCOVR_ADDITIONAL_ARGS}
${GCOVR_EXCLUDE_ARGS} --object-directory=${PROJECT_BINARY_DIR}
-o ${Coverage_NAME}/index.html
)
if(CODE_COVERAGE_VERBOSE)
message(STATUS "Executed command report")
message(STATUS "Command to run tests: ")
string(REPLACE ";" " " GCOVR_HTML_EXEC_TESTS_CMD_SPACED "${GCOVR_HTML_EXEC_TESTS_CMD}")
message(STATUS "${GCOVR_HTML_EXEC_TESTS_CMD_SPACED}")
message(STATUS "Command to create a folder: ")
string(REPLACE ";" " " GCOVR_HTML_FOLDER_CMD_SPACED "${GCOVR_HTML_FOLDER_CMD}")
message(STATUS "${GCOVR_HTML_FOLDER_CMD_SPACED}")
message(STATUS "Command to generate gcovr HTML coverage data: ")
string(REPLACE ";" " " GCOVR_HTML_CMD_SPACED "${GCOVR_HTML_CMD}")
message(STATUS "${GCOVR_HTML_CMD_SPACED}")
endif()
add_custom_target(${Coverage_NAME}
COMMAND ${GCOVR_HTML_EXEC_TESTS_CMD}
COMMAND ${GCOVR_HTML_FOLDER_CMD}
COMMAND ${GCOVR_HTML_CMD}
BYPRODUCTS ${PROJECT_BINARY_DIR}/${Coverage_NAME}/index.html # report directory
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
DEPENDS ${Coverage_DEPENDENCIES}
VERBATIM # Protect arguments to commands
COMMENT "Running gcovr to produce HTML code coverage report."
)
# Show info where to find the report
add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
COMMAND ;
COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
)
endfunction() # setup_target_for_coverage_gcovr_html
# Defines a target for running and collection code coverage information
# Builds dependencies, runs the given executable and outputs reports.
# NOTE! The executable should always have a ZERO as exit code otherwise
# the coverage generation will not complete.
#
# setup_target_for_coverage_fastcov(
# NAME testrunner_coverage # New target name
# EXECUTABLE testrunner -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
# DEPENDENCIES testrunner # Dependencies to build first
# BASE_DIRECTORY "../" # Base directory for report
# # (defaults to PROJECT_SOURCE_DIR)
# EXCLUDE "src/dir1/" "src/dir2/" # Patterns to exclude.
# NO_DEMANGLE # Don't demangle C++ symbols
# # even if c++filt is found
# SKIP_HTML # Don't create html report
# POST_CMD perl -i -pe s!${PROJECT_SOURCE_DIR}/!!g ctest_coverage.json # E.g. for stripping source dir from file paths
# )
function(setup_target_for_coverage_fastcov)
set(options NO_DEMANGLE SKIP_HTML)
set(oneValueArgs BASE_DIRECTORY NAME)
set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES FASTCOV_ARGS GENHTML_ARGS POST_CMD)
cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT FASTCOV_PATH)
message(FATAL_ERROR "fastcov not found! Aborting...")
endif()
if(NOT Coverage_SKIP_HTML AND NOT GENHTML_PATH)
message(FATAL_ERROR "genhtml not found! Aborting...")
endif()
# Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
if(Coverage_BASE_DIRECTORY)
get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
else()
set(BASEDIR ${PROJECT_SOURCE_DIR})
endif()
# Collect excludes (Patterns, not paths, for fastcov)
set(FASTCOV_EXCLUDES "")
foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_FASTCOV_EXCLUDES})
list(APPEND FASTCOV_EXCLUDES "${EXCLUDE}")
endforeach()
list(REMOVE_DUPLICATES FASTCOV_EXCLUDES)
# Conditional arguments
if(CPPFILT_PATH AND NOT ${Coverage_NO_DEMANGLE})
set(GENHTML_EXTRA_ARGS "--demangle-cpp")
endif()
# Set up commands which will be run to generate coverage data
set(FASTCOV_EXEC_TESTS_CMD ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS})
set(FASTCOV_CAPTURE_CMD ${FASTCOV_PATH} ${Coverage_FASTCOV_ARGS} --gcov ${GCOV_PATH}
--search-directory ${BASEDIR}
--process-gcno
--output ${Coverage_NAME}.json
--exclude ${FASTCOV_EXCLUDES}
--exclude ${FASTCOV_EXCLUDES}
)
set(FASTCOV_CONVERT_CMD ${FASTCOV_PATH}
-C ${Coverage_NAME}.json --lcov --output ${Coverage_NAME}.info
)
if(Coverage_SKIP_HTML)
set(FASTCOV_HTML_CMD ";")
else()
set(FASTCOV_HTML_CMD ${GENHTML_PATH} ${GENHTML_EXTRA_ARGS} ${Coverage_GENHTML_ARGS}
-o ${Coverage_NAME} ${Coverage_NAME}.info
)
endif()
set(FASTCOV_POST_CMD ";")
if(Coverage_POST_CMD)
set(FASTCOV_POST_CMD ${Coverage_POST_CMD})
endif()
if(CODE_COVERAGE_VERBOSE)
message(STATUS "Code coverage commands for target ${Coverage_NAME} (fastcov):")
message(" Running tests:")
string(REPLACE ";" " " FASTCOV_EXEC_TESTS_CMD_SPACED "${FASTCOV_EXEC_TESTS_CMD}")
message(" ${FASTCOV_EXEC_TESTS_CMD_SPACED}")
message(" Capturing fastcov counters and generating report:")
string(REPLACE ";" " " FASTCOV_CAPTURE_CMD_SPACED "${FASTCOV_CAPTURE_CMD}")
message(" ${FASTCOV_CAPTURE_CMD_SPACED}")
message(" Converting fastcov .json to lcov .info:")
string(REPLACE ";" " " FASTCOV_CONVERT_CMD_SPACED "${FASTCOV_CONVERT_CMD}")
message(" ${FASTCOV_CONVERT_CMD_SPACED}")
if(NOT Coverage_SKIP_HTML)
message(" Generating HTML report: ")
string(REPLACE ";" " " FASTCOV_HTML_CMD_SPACED "${FASTCOV_HTML_CMD}")
message(" ${FASTCOV_HTML_CMD_SPACED}")
endif()
if(Coverage_POST_CMD)
message(" Running post command: ")
string(REPLACE ";" " " FASTCOV_POST_CMD_SPACED "${FASTCOV_POST_CMD}")
message(" ${FASTCOV_POST_CMD_SPACED}")
endif()
endif()
# Setup target
add_custom_target(${Coverage_NAME}
# Cleanup fastcov
COMMAND ${FASTCOV_PATH} ${Coverage_FASTCOV_ARGS} --gcov ${GCOV_PATH}
--search-directory ${BASEDIR}
--zerocounters
COMMAND ${FASTCOV_EXEC_TESTS_CMD}
COMMAND ${FASTCOV_CAPTURE_CMD}
COMMAND ${FASTCOV_CONVERT_CMD}
COMMAND ${FASTCOV_HTML_CMD}
COMMAND ${FASTCOV_POST_CMD}
# Set output files as GENERATED (will be removed on 'make clean')
BYPRODUCTS
${Coverage_NAME}.info
${Coverage_NAME}.json
${Coverage_NAME}/index.html # report directory
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
DEPENDS ${Coverage_DEPENDENCIES}
VERBATIM # Protect arguments to commands
COMMENT "Resetting code coverage counters to zero. Processing code coverage counters and generating report."
)
set(INFO_MSG "fastcov code coverage info report saved in ${Coverage_NAME}.info and ${Coverage_NAME}.json.")
if(NOT Coverage_SKIP_HTML)
string(APPEND INFO_MSG " Open ${PROJECT_BINARY_DIR}/${Coverage_NAME}/index.html in your browser to view the coverage report.")
endif()
# Show where to find the fastcov info report
add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo ${INFO_MSG}
)
endfunction() # setup_target_for_coverage_fastcov
function(append_coverage_compiler_flags)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
message(STATUS "Appending code coverage compiler flags: ${COVERAGE_COMPILER_FLAGS}")
endfunction() # append_coverage_compiler_flags
-18
View File
@@ -1,18 +0,0 @@
# Copyright (c) 2016, Ruslan Baratov
#
# Licensed under the MIT License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://opensource.org/licenses/MIT
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
@PACKAGE_INIT@
find_package(Threads REQUIRED)
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
check_required_components("@PROJECT_NAME@")
@@ -1,4 +0,0 @@
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
check_required_components("@PROJECT_NAME@")
-16
View File
@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="515px" height="315px" viewBox="0 0 515 315" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 47.1 (45422) - http://www.bohemiancoding.com/sketch -->
<title>Artboard Copy</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
<g id="Artboard-Copy" stroke-width="3">
<g id="Group" transform="translate(55.000000, 70.000000)">
<polyline id="Path-4" stroke="#F3A530" points="7.5 118.5 48.5 44.5 191.5 170 355 87"></polyline>
<polyline id="Path-5" stroke="#30499B" points="0.5 62 113 160.5 355 0"></polyline>
<polyline id="Path-6" stroke="#4CB2D4" points="42 146.5 194 39 406 175.5"></polyline>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 968 B

@@ -1,318 +0,0 @@
#ifndef STATSD_CLIENT_HPP
#define STATSD_CLIENT_HPP
#include <cpp-statsd-client/UDPSender.hpp>
#include <cstdint>
#include <cstdio>
#include <iomanip>
#include <memory>
#include <random>
#include <sstream>
#include <string>
#include <vector>
namespace Statsd {
/*!
*
* Statsd client
*
* This is the Statsd client, exposing the classic methods
* and relying on a UDP sender for the actual sending.
*
* The prefix for a stat is provided once at construction or
* on reconfiguring the client. The separator character '.'
* is automatically inserted between the prefix and the stats
* key, therefore you should neither append one to the prefix
* nor prepend one to the key
*
* The sampling frequency is specified per call and uses a
* random number generator to determine whether or not the stat
* will be recorded this time or not.
*
* The top level configuration includes 2 optional parameters
* that determine how the stats are delivered to statsd. These
* parameters are the batching size and the send interval.
*
* The batching size controls the number of bytes to send
* in each UDP datagram to statsd. This is not a hard limit as
* we continue appending to a batch of stats until the limit
* has been reached or surpassed. When this occurs we add the
* batch to a queue and create a new batch to appended to. A
* value of 0 for the batching size will disable batching such
* that each stat will be sent to the daemon individually.
*
* The send interval controls the rate at which queued batches
* of stats will be sent to statsd. If batching is disabled,
* this value is ignored and each individual stat is sent to
* statsd immediately in a blocking fashion. If batching is
* enabled (ie. non-zero) then the send interval is the number
* of milliseconds to wait before flushing the queue of
* batched stats messages to the daemon. This is done in a non-
* blocking fashion via a background thread. If the send
* interval is 0 then the stats messages are appended to a
* queue until the caller manually flushes the queue via the
* flush method.
*
*/
class StatsdClient {
public:
//!@name Constructor and destructor, non-copyable
//!@{
//! Constructor
StatsdClient(const std::string& host,
const uint16_t port,
const std::string& prefix,
const uint64_t batchsize = 0,
const uint64_t sendInterval = 1000,
const unsigned int gaugePrecision = 4) noexcept;
StatsdClient(const StatsdClient&) = delete;
StatsdClient& operator=(const StatsdClient&) = delete;
//!@}
//!@name Methods
//!@{
//! Sets a configuration { host, port, prefix, batchsize }
void setConfig(const std::string& host,
const uint16_t port,
const std::string& prefix,
const uint64_t batchsize = 0,
const uint64_t sendInterval = 1000,
const unsigned int gaugePrecision = 4) noexcept;
//! Returns the error message as an std::string
const std::string& errorMessage() const noexcept;
//! Increments the key, at a given frequency rate
void increment(const std::string& key,
float frequency = 1.0f,
const std::vector<std::string>& tags = {}) const noexcept;
//! Increments the key, at a given frequency rate
void decrement(const std::string& key,
float frequency = 1.0f,
const std::vector<std::string>& tags = {}) const noexcept;
//! Adjusts the specified key by a given delta, at a given frequency rate
void count(const std::string& key,
const int delta,
float frequency = 1.0f,
const std::vector<std::string>& tags = {}) const noexcept;
//! Records a gauge for the key, with a given value, at a given frequency rate
template <typename T>
void gauge(const std::string& key,
const T value,
float frequency = 1.0f,
const std::vector<std::string>& tags = {}) const noexcept;
//! Records a timing for a key, at a given frequency
void timing(const std::string& key,
const unsigned int ms,
float frequency = 1.0f,
const std::vector<std::string>& tags = {}) const noexcept;
//! Records a count of unique occurrences for a key, at a given frequency
void set(const std::string& key,
const unsigned int sum,
float frequency = 1.0f,
const std::vector<std::string>& tags = {}) const noexcept;
//! Seed the RNG that controls sampling
void seed(unsigned int seed = std::random_device()()) noexcept;
//! Flush any queued stats to the daemon
void flush() noexcept;
//!@}
private:
// @name Private methods
// @{
//! Send a value for a key, according to its type, at a given frequency
template <typename T>
void send(const std::string& key,
const T value,
const char* type,
float frequency,
const std::vector<std::string>& tags) const noexcept;
//!@}
private:
//! The prefix to be used for metrics
std::string m_prefix;
//! The UDP sender to be used for actual sending
std::unique_ptr<UDPSender> m_sender;
//! The random number generator for handling sampling
mutable std::mt19937 m_randomEngine;
//! The buffer string format our stats before sending them
mutable std::string m_buffer;
//! Fixed floating point precision of gauges
unsigned int m_gaugePrecision;
};
namespace detail {
inline std::string sanitizePrefix(std::string prefix) {
// For convenience we provide the dot when generating the stat message
if (!prefix.empty() && prefix.back() == '.') {
prefix.pop_back();
}
return prefix;
}
// All supported metric types
constexpr char METRIC_TYPE_COUNT[] = "c";
constexpr char METRIC_TYPE_GAUGE[] = "g";
constexpr char METRIC_TYPE_TIMING[] = "ms";
constexpr char METRIC_TYPE_SET[] = "s";
} // namespace detail
inline StatsdClient::StatsdClient(const std::string& host,
const uint16_t port,
const std::string& prefix,
const uint64_t batchsize,
const uint64_t sendInterval,
const unsigned int gaugePrecision) noexcept
: m_prefix(detail::sanitizePrefix(prefix)),
m_sender(new UDPSender{host, port, batchsize, sendInterval}),
m_gaugePrecision(gaugePrecision) {
// Initialize the random generator to be used for sampling
seed();
// Avoid re-allocations by reserving a generous buffer
m_buffer.reserve(256);
}
inline void StatsdClient::setConfig(const std::string& host,
const uint16_t port,
const std::string& prefix,
const uint64_t batchsize,
const uint64_t sendInterval,
const unsigned int gaugePrecision) noexcept {
m_prefix = detail::sanitizePrefix(prefix);
m_sender.reset(new UDPSender(host, port, batchsize, sendInterval));
m_gaugePrecision = gaugePrecision;
}
inline const std::string& StatsdClient::errorMessage() const noexcept {
return m_sender->errorMessage();
}
inline void StatsdClient::decrement(const std::string& key,
float frequency,
const std::vector<std::string>& tags) const noexcept {
count(key, -1, frequency, tags);
}
inline void StatsdClient::increment(const std::string& key,
float frequency,
const std::vector<std::string>& tags) const noexcept {
count(key, 1, frequency, tags);
}
inline void StatsdClient::count(const std::string& key,
const int delta,
float frequency,
const std::vector<std::string>& tags) const noexcept {
send(key, delta, detail::METRIC_TYPE_COUNT, frequency, tags);
}
template <typename T>
inline void StatsdClient::gauge(const std::string& key,
const T value,
const float frequency,
const std::vector<std::string>& tags) const noexcept {
send(key, value, detail::METRIC_TYPE_GAUGE, frequency, tags);
}
inline void StatsdClient::timing(const std::string& key,
const unsigned int ms,
float frequency,
const std::vector<std::string>& tags) const noexcept {
send(key, ms, detail::METRIC_TYPE_TIMING, frequency, tags);
}
inline void StatsdClient::set(const std::string& key,
const unsigned int sum,
float frequency,
const std::vector<std::string>& tags) const noexcept {
send(key, sum, detail::METRIC_TYPE_SET, frequency, tags);
}
template <typename T>
inline void StatsdClient::send(const std::string& key,
const T value,
const char* type,
float frequency,
const std::vector<std::string>& tags) const noexcept {
// Bail if we can't send anything anyway
if (!m_sender->initialized()) {
return;
}
// A valid frequency is: 0 <= f <= 1
// At 0 you never emit the stat, at 1 you always emit the stat and with anything else you roll the dice
frequency = std::max(std::min(frequency, 1.f), 0.f);
constexpr float epsilon{0.0001f};
const bool isFrequencyOne = std::fabs(frequency - 1.0f) < epsilon;
const bool isFrequencyZero = std::fabs(frequency) < epsilon;
if (isFrequencyZero ||
(!isFrequencyOne && (frequency < std::uniform_real_distribution<float>(0.f, 1.f)(m_randomEngine)))) {
return;
}
// Format the stat message
std::stringstream valueStream;
valueStream << std::fixed << std::setprecision(m_gaugePrecision) << value;
m_buffer.clear();
m_buffer.append(m_prefix);
if (!m_prefix.empty() && !key.empty()) {
m_buffer.push_back('.');
}
m_buffer.append(key);
m_buffer.push_back(':');
m_buffer.append(valueStream.str());
m_buffer.push_back('|');
m_buffer.append(type);
if (frequency < 1.f) {
m_buffer.append("|@0.");
m_buffer.append(std::to_string(static_cast<int>(frequency * 100)));
}
if (!tags.empty()) {
m_buffer.append("|#");
for (const auto& tag : tags) {
m_buffer.append(tag);
m_buffer.push_back(',');
}
m_buffer.pop_back();
}
// Send the message via the UDP sender
m_sender->send(m_buffer);
}
inline void StatsdClient::seed(unsigned int seed) noexcept {
m_randomEngine.seed(seed);
}
inline void StatsdClient::flush() noexcept {
m_sender->flush();
}
} // namespace Statsd
#endif
@@ -1,345 +0,0 @@
#ifndef UDP_SENDER_HPP
#define UDP_SENDER_HPP
#ifdef _WIN32
#define NOMINMAX
#include <io.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <arpa/inet.h>
#include <netdb.h>
#include <sys/socket.h>
#include <unistd.h>
#endif
#include <atomic>
#include <cmath>
#include <cstdint>
#include <cstring>
#include <deque>
#include <mutex>
#include <string>
#include <thread>
namespace Statsd {
#ifdef _WIN32
using SOCKET_TYPE = SOCKET;
constexpr SOCKET_TYPE k_invalidSocket{INVALID_SOCKET};
#define SOCKET_ERRNO WSAGetLastError()
#define SOCKET_CLOSE closesocket
#else
using SOCKET_TYPE = int;
constexpr SOCKET_TYPE k_invalidSocket{-1};
#define SOCKET_ERRNO errno
#define SOCKET_CLOSE close
#endif
/*!
*
* UDP sender
*
* A simple UDP sender handling batching.
*
*/
class UDPSender final {
public:
//!@name Constructor and destructor, non-copyable
//!@{
//! Constructor
UDPSender(const std::string& host,
const uint16_t port,
const uint64_t batchsize,
const uint64_t sendInterval) noexcept;
//! Destructor
~UDPSender();
UDPSender(const UDPSender&) = delete;
UDPSender& operator=(const UDPSender&) = delete;
UDPSender(UDPSender&&) = delete;
//!@}
//!@name Methods
//!@{
//! Send or enqueue a message
void send(const std::string& message) noexcept;
//! Returns the error message as a string
const std::string& errorMessage() const noexcept;
//! Returns true if the sender is initialized
bool initialized() const noexcept;
//! Flushes any queued messages
void flush() noexcept;
//!@}
private:
// @name Private methods
// @{
//! Initialize the sender and returns true when it is initialized
bool initialize() noexcept;
//! Queue a message to be sent to the daemon later
inline void queueMessage(const std::string& message) noexcept;
//! Send a message to the daemon
void sendToDaemon(const std::string& message) noexcept;
//!@}
private:
// @name State variables
// @{
//! Shall we exit?
std::atomic<bool> m_mustExit{false};
//!@}
// @name Network info
// @{
//! The hostname
std::string m_host;
//! The port
uint16_t m_port;
//! The structure holding the server
struct sockaddr_in m_server;
//! The socket to be used
SOCKET_TYPE m_socket = k_invalidSocket;
//!@}
// @name Batching info
// @{
//! The batching size
uint64_t m_batchsize;
//! The sending frequency in milliseconds
uint64_t m_sendInterval;
//! The queue batching the messages
std::deque<std::string> m_batchingMessageQueue;
//! The mutex used for batching
std::mutex m_batchingMutex;
//! The thread dedicated to the batching
std::thread m_batchingThread;
//!@}
//! Error message (optional string)
std::string m_errorMessage;
};
namespace detail {
inline bool isValidSocket(const SOCKET_TYPE socket) {
return socket != k_invalidSocket;
}
#ifdef _WIN32
struct WinSockSingleton {
inline static const WinSockSingleton& getInstance() {
static const WinSockSingleton instance;
return instance;
}
inline bool ok() const {
return m_ok;
}
~WinSockSingleton() {
WSACleanup();
}
private:
WinSockSingleton() {
WSADATA wsa;
m_ok = WSAStartup(MAKEWORD(2, 2), &wsa) == 0;
}
bool m_ok;
};
#endif
} // namespace detail
inline UDPSender::UDPSender(const std::string& host,
const uint16_t port,
const uint64_t batchsize,
const uint64_t sendInterval) noexcept
: m_host(host), m_port(port), m_batchsize(batchsize), m_sendInterval(sendInterval) {
// Initialize the socket
if (!initialize()) {
return;
}
// If batching is on, use a dedicated thread to send after the wait time is reached
if (m_batchsize != 0 && m_sendInterval > 0) {
// Define the batching thread
m_batchingThread = std::thread([this] {
// TODO: this will drop unsent stats, should we send all the unsent stats before we exit?
while (!m_mustExit.load(std::memory_order_acquire)) {
std::deque<std::string> stagedMessageQueue;
std::unique_lock<std::mutex> batchingLock(m_batchingMutex);
m_batchingMessageQueue.swap(stagedMessageQueue);
batchingLock.unlock();
// Flush the queue
while (!stagedMessageQueue.empty()) {
sendToDaemon(stagedMessageQueue.front());
stagedMessageQueue.pop_front();
}
// Wait before sending the next batch
std::this_thread::sleep_for(std::chrono::milliseconds(m_sendInterval));
}
});
}
}
inline UDPSender::~UDPSender() {
if (!initialized()) {
return;
}
// If we're running a background thread tell it to stop
if (m_batchingThread.joinable()) {
m_mustExit.store(true, std::memory_order_release);
m_batchingThread.join();
}
// Cleanup the socket
SOCKET_CLOSE(m_socket);
}
inline void UDPSender::send(const std::string& message) noexcept {
m_errorMessage.clear();
// If batching is on, accumulate messages in the queue
if (m_batchsize > 0) {
queueMessage(message);
return;
}
// Or send it right now
sendToDaemon(message);
}
inline void UDPSender::queueMessage(const std::string& message) noexcept {
// We aquire a lock but only if we actually need to (i.e. there is a thread also accessing the queue)
auto batchingLock =
m_batchingThread.joinable() ? std::unique_lock<std::mutex>(m_batchingMutex) : std::unique_lock<std::mutex>();
// Either we don't have a place to batch our message or we exceeded the batch size, so make a new batch
if (m_batchingMessageQueue.empty() || m_batchingMessageQueue.back().length() > m_batchsize) {
m_batchingMessageQueue.emplace_back();
m_batchingMessageQueue.back().reserve(m_batchsize + 256);
} // When there is already a batch open we need a separator when its not empty
else if (!m_batchingMessageQueue.back().empty()) {
m_batchingMessageQueue.back().push_back('\n');
}
// Add the new message to the batch
m_batchingMessageQueue.back().append(message);
}
inline const std::string& UDPSender::errorMessage() const noexcept {
return m_errorMessage;
}
inline bool UDPSender::initialize() noexcept {
#ifdef _WIN32
if (!detail::WinSockSingleton::getInstance().ok()) {
m_errorMessage = "WSAStartup failed: errno=" + std::to_string(SOCKET_ERRNO);
}
#endif
// Connect the socket
m_socket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (!detail::isValidSocket(m_socket)) {
m_errorMessage = "socket creation failed: errno=" + std::to_string(SOCKET_ERRNO);
return false;
}
std::memset(&m_server, 0, sizeof(m_server));
m_server.sin_family = AF_INET;
m_server.sin_port = htons(m_port);
if (inet_pton(AF_INET, m_host.c_str(), &m_server.sin_addr) == 0) {
// An error code has been returned by inet_aton
// Specify the criteria for selecting the socket address structure
struct addrinfo hints;
std::memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_DGRAM;
// Get the address info using the hints
struct addrinfo* results = nullptr;
const int ret{getaddrinfo(m_host.c_str(), nullptr, &hints, &results)};
if (ret != 0) {
// An error code has been returned by getaddrinfo
SOCKET_CLOSE(m_socket);
m_socket = k_invalidSocket;
m_errorMessage = "getaddrinfo failed: err=" + std::to_string(ret) + ", msg=" + gai_strerror(ret);
return false;
}
// Copy the results in m_server
struct sockaddr_in* host_addr = (struct sockaddr_in*)results->ai_addr;
std::memcpy(&m_server.sin_addr, &host_addr->sin_addr, sizeof(struct in_addr));
// Free the memory allocated
freeaddrinfo(results);
}
return true;
}
inline void UDPSender::sendToDaemon(const std::string& message) noexcept {
// Try sending the message
const auto ret = sendto(m_socket,
message.data(),
#ifdef _WIN32
static_cast<int>(message.size()),
#else
message.size(),
#endif
0,
(struct sockaddr*)&m_server,
sizeof(m_server));
if (ret == -1) {
m_errorMessage = "sendto server failed: host=" + m_host + ":" + std::to_string(m_port) +
", err=" + std::to_string(SOCKET_ERRNO);
}
}
inline bool UDPSender::initialized() const noexcept {
return m_socket != k_invalidSocket;
}
inline void UDPSender::flush() noexcept {
// We aquire a lock but only if we actually need to (ie there is a thread also accessing the queue)
auto batchingLock =
m_batchingThread.joinable() ? std::unique_lock<std::mutex>(m_batchingMutex) : std::unique_lock<std::mutex>();
// Flush the queue
while (!m_batchingMessageQueue.empty()) {
sendToDaemon(m_batchingMessageQueue.front());
m_batchingMessageQueue.pop_front();
}
}
} // namespace Statsd
#endif
-80
View File
@@ -1,80 +0,0 @@
#ifndef STATSD_SERVER_HPP
#define STATSD_SERVER_HPP
// It might make sense to include this test class in the UDPSender header
// it includes most of the cross platform defines etc that we need for socket io
#include "cpp-statsd-client/UDPSender.hpp"
#include <algorithm>
#include <string>
namespace Statsd {
class StatsdServer {
public:
StatsdServer(unsigned short port = 8125) noexcept {
#ifdef _WIN32
if (!detail::WinSockSingleton::getInstance().ok()) {
m_errorMessage = "WSAStartup failed: errno=" + std::to_string(SOCKET_ERRNO);
}
#endif
// Create the socket
m_socket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (!detail::isValidSocket(m_socket)) {
m_errorMessage = "socket creation failed: errno=" + std::to_string(SOCKET_ERRNO);
return;
}
// Binding should be with ipv4 to all interfaces
struct sockaddr_in address {};
address.sin_family = AF_INET;
address.sin_port = htons(port);
address.sin_addr.s_addr = INADDR_ANY;
// Try to bind
if (bind(m_socket, reinterpret_cast<const struct sockaddr*>(&address), sizeof(address)) != 0) {
SOCKET_CLOSE(m_socket);
m_socket = k_invalidSocket;
m_errorMessage = "bind failed: errno=" + std::to_string(SOCKET_ERRNO);
}
}
~StatsdServer() {
if (detail::isValidSocket(m_socket)) {
SOCKET_CLOSE(m_socket);
}
}
const std::string& errorMessage() const noexcept {
return m_errorMessage;
}
std::string receive() noexcept {
// If uninitialized then bail
if (!detail::isValidSocket(m_socket)) {
return "";
}
// Try to receive (this is blocking)
std::string buffer(256, '\0');
int string_len;
if ((string_len = recv(m_socket, &buffer[0], static_cast<int>(buffer.size()), 0)) < 1) {
m_errorMessage = "Could not recv on the socket file descriptor";
return "";
}
// No error return the trimmed result
m_errorMessage.clear();
buffer.resize(std::min(static_cast<size_t>(string_len), buffer.size()));
return buffer;
}
private:
SOCKET_TYPE m_socket;
std::string m_errorMessage;
};
} // namespace Statsd
#endif
-184
View File
@@ -1,184 +0,0 @@
#include <iostream>
#include "StatsdServer.hpp"
#include "cpp-statsd-client/StatsdClient.hpp"
using namespace Statsd;
// Each test suite below spawns a thread to recv the client messages over UDP as if it were a real statsd server
// Note that we could just synchronously recv metrics and not use a thread but doing the test async has the
// advantage that we can test the threaded batching mode in a straightforward way. The server thread basically
// just keeps storing metrics in an vector until it hears a special one signaling the test is over and bails
void mock(StatsdServer& server, std::vector<std::string>& messages) {
do {
// Grab the messages that are waiting
auto recvd = server.receive();
// Split the messages on '\n'
auto start = std::string::npos;
do {
// Keep this message
auto end = recvd.find('\n', ++start);
messages.emplace_back(recvd.substr(start, end));
start = end;
// Bail if we found the special quit message
if (messages.back().find("DONE") != std::string::npos) {
messages.pop_back();
return;
}
} while (start != std::string::npos);
} while (server.errorMessage().empty() && !messages.back().empty());
}
template <typename SocketWrapper>
void throwOnError(const SocketWrapper& wrapped, bool expectEmpty = true, const std::string& extraMessage = "") {
if (wrapped.errorMessage().empty() != expectEmpty) {
std::cerr << (expectEmpty ? wrapped.errorMessage() : extraMessage) << std::endl;
throw std::runtime_error(expectEmpty ? wrapped.errorMessage() : extraMessage);
}
}
void throwOnWrongMessage(StatsdServer& server, const std::string& expected) {
auto actual = server.receive();
if (actual != expected) {
std::cerr << "Expected: " << expected << " but got: " << actual << std::endl;
throw std::runtime_error("Incorrect stat received");
}
}
void testErrorConditions() {
// Resolve a rubbish ip and make sure initialization failed
StatsdClient client{"256.256.256.256", 8125, "myPrefix", 20};
throwOnError(client, false, "Should not be able to resolve a ridiculous ip");
}
void testReconfigure() {
StatsdServer server;
throwOnError(server);
StatsdClient client("localhost", 8125, "first.");
client.increment("foo");
throwOnWrongMessage(server, "first.foo:1|c");
client.setConfig("localhost", 8125, "second");
client.increment("bar");
throwOnWrongMessage(server, "second.bar:1|c");
client.setConfig("localhost", 8125, "");
client.increment("third.baz");
throwOnWrongMessage(server, "third.baz:1|c");
client.increment("");
throwOnWrongMessage(server, ":1|c");
// TODO: test what happens with the batching after resolving the question about incomplete
// batches being dropped vs sent on reconfiguring
}
void testSendRecv(uint64_t batchSize, uint64_t sendInterval) {
StatsdServer mock_server;
std::vector<std::string> messages, expected;
std::thread server(mock, std::ref(mock_server), std::ref(messages));
// Set a new config that has the client send messages to a proper address that can be resolved
StatsdClient client("localhost", 8125, "sendRecv.", batchSize, sendInterval, 3);
throwOnError(client);
// TODO: I forget if we need to wait for the server to be ready here before sending the first stats
// is there a race condition where the client sending before the server binds would drop that clients message
for (int i = 0; i < 3; ++i) {
// Increment "coco"
client.increment("coco");
throwOnError(client);
expected.emplace_back("sendRecv.coco:1|c");
// Decrement "kiki"
client.decrement("kiki");
throwOnError(client);
expected.emplace_back("sendRecv.kiki:-1|c");
// Adjusts "toto" by +2
client.seed(19); // this seed gets a hit on the first call
client.count("toto", 2, 0.1f);
throwOnError(client);
expected.emplace_back("sendRecv.toto:2|c|@0.10");
// Gets "sampled out" by the random number generator
client.count("popo", 9, 0.1f);
throwOnError(client);
// Record a gauge "titi" to 3
client.gauge("titi", 3);
throwOnError(client);
expected.emplace_back("sendRecv.titi:3|g");
// Record a gauge "titifloat" to -123.456789 with precision 3
client.gauge("titifloat", -123.456789);
throwOnError(client);
expected.emplace_back("sendRecv.titifloat:-123.457|g");
// Record a timing of 2ms for "myTiming"
client.seed(19);
client.timing("myTiming", 2, 0.1f);
throwOnError(client);
expected.emplace_back("sendRecv.myTiming:2|ms|@0.10");
// Send a set with 1227 total uniques
client.set("tutu", 1227, 2.0f);
throwOnError(client);
expected.emplace_back("sendRecv.tutu:1227|s");
// Gauge but with tags
client.gauge("dr.röstigrabe", 333, 1.f, {"liegt", "im", "weste"});
throwOnError(client);
expected.emplace_back("sendRecv.dr.röstigrabe:333|g|#liegt,im,weste");
// All the things
client.count("foo", -42, .9f, {"bar", "baz"});
throwOnError(client);
expected.emplace_back("sendRecv.foo:-42|c|@0.90|#bar,baz");
}
// Signal the mock server we are done
client.timing("DONE", 0);
// If manual flushing do it now
if (sendInterval == 0) {
client.flush();
}
// Wait for the server to stop
server.join();
// Make sure we get the exactly correct output
if (messages != expected) {
std::cerr << "Unexpected stats received by server, got:" << std::endl;
for (const auto& message : messages) {
std::cerr << message << std::endl;
}
std::cerr << std::endl << "But we expected:" << std::endl;
for (const auto& message : expected) {
std::cerr << message << std::endl;
}
throw std::runtime_error("Unexpected stats");
}
}
int main() {
// If any of these tests fail they throw an exception, not catching makes for a nonzero return code
// general things that should be errors
testErrorConditions();
// reconfiguring how you are sending
testReconfigure();
// no batching
testSendRecv(0, 0);
// background batching
testSendRecv(32, 1000);
// manual flushing of batches
testSendRecv(16, 0);
return EXIT_SUCCESS;
}
+1 -1
+1 -33
View File
@@ -1145,11 +1145,6 @@ acllog-max-len 128
#
# active-expire-effort 1
# Force evictions when used system memory reaches X% of total system memory.
# This is useful as a safeguard to prevent OOM kills (0 to disable).
#
# force-eviction-percent 0
############################# LAZY FREEING ####################################
# KeyDB has two primitives to delete keys. One is called DEL and is a blocking
@@ -2078,31 +2073,4 @@ replica-weighting-factor 2
#
# By default this is enabled
#
active-client-balancing yes
# Enable FLASH support (Experimental Feature)
# storage-provider flash /path/to/flash/db
# Blob support is a way to store very large objects (>200MB) on disk
# The files are automatically cleaned up when KeyDB exits and are only
# for temporary use. This helps reduce memory pressure for very large
# data items at the cost of some performance.
#
# By default this config is disable. When enabled the disk associated
# with KeyDB's working directory will be used. If there is insufficient
# disk space or any other I/O error KeyDB will instead use memory.
#
# blob-support false
# Begin load shedding if we use more than X% CPU relative to the number of server threads
# E.g. if overload-protect-percent is set to 80 and there are 8 server-threads, then the
# actual CPU protection will be 8 * 100 * 0.80 = 640% CPU usage.
#
# Set to 0 to disable
# overload-protect-percent 0
# Inform KeyDB of the availability zone if running in a cloud environment. Currently
# this is only exposed via the info command for clients to use, but in the future we
# we may also use this when making decisions for replication.
#
# availability-zone "us-east-1a"
active-client-balancing yes
-114
View File
@@ -1,114 +0,0 @@
FROM ubuntu:20.04
SHELL ["/bin/bash","-c"]
RUN groupadd -r keydb && useradd -r -g keydb keydb
# use gosu for easy step-down from root: https://github.com/tianon/gosu/releases
ENV GOSU_VERSION 1.14
RUN set -eux; \
savedAptMark="$(apt-mark showmanual)"; \
apt-get update; \
apt-get -o Dpkg::Options::="--force-confnew" install -y --no-install-recommends ca-certificates dirmngr gnupg wget; \
rm -rf /var/lib/apt/lists/*; \
dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \
wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \
export GNUPGHOME="$(mktemp -d)"; \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
gpgconf --kill all; \
rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc; \
apt-mark auto '.*' > /dev/null; \
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
chmod +x /usr/local/bin/gosu; \
gosu --version; \
gosu nobody true
# build KeyDB
ARG MAKE_JOBS=""
ARG ENABLE_FLASH=""
COPY . /tmp/keydb-internal
RUN set -eux; \
cd /tmp/keydb-internal; \
savedAptMark="$(apt-mark showmanual)"; \
apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confnew" install -qqy --no-install-recommends \
dpkg-dev \
pkg-config \
ca-certificates \
build-essential \
nasm \
autotools-dev \
autoconf \
libjemalloc-dev \
tcl \
tcl-dev \
uuid-dev \
libcurl4-openssl-dev \
libbz2-dev \
libzstd-dev \
liblz4-dev \
libsnappy-dev \
libssl-dev \
git; \
# disable protected mode as it relates to docker
grep -E '^ *createBoolConfig[(]"protected-mode",.*, *1 *,.*[)],$' ./src/config.cpp; \
sed -ri 's!^( *createBoolConfig[(]"protected-mode",.*, *)1( *,.*[)],)$!\10\2!' ./src/config.cpp; \
grep -E '^ *createBoolConfig[(]"protected-mode",.*, *0 *,.*[)],$' ./src/config.cpp; \
make distclean; \
make -j$([ -z "$MAKE_JOBS" ] && nproc || echo "$MAKE_JOBS") BUILD_TLS=yes NO_LICENSE_CHECK=yes $([ -z "$ENABLE_FLASH" ] && echo "" || echo "ENABLE_FLASH=$ENABLE_FLASH"); \
cd src; \
mv modules/keydb_modstatsd/modstatsd.so /usr/local/lib/; \
strip keydb-cli keydb-benchmark keydb-check-rdb keydb-check-aof keydb-diagnostic-tool keydb-sentinel; \
mv keydb-server keydb-cli keydb-benchmark keydb-check-rdb keydb-check-aof keydb-diagnostic-tool keydb-sentinel /usr/local/bin/; \
# clean up unused dependencies
echo $savedAptMark; \
apt-mark auto '.*' > /dev/null; \
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \
find /usr/local -type f -executable -exec ldd '{}' ';' \
| awk '/=>/ { print $(NF-1) }' \
| sed 's:.*/::' \
| sort -u \
| xargs -r dpkg-query --search \
| cut -d: -f1 \
| sort -u \
| xargs -r apt-mark manual \
; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*; \
# create working directories and organize files
RUN \
mkdir /data && chown keydb:keydb /data; \
mkdir /flash && chown keydb:keydb /flash; \
mkdir -p /etc/keydb; \
cp /tmp/keydb-internal/keydb.conf /etc/keydb/; \
sed -i 's/^\(daemonize .*\)$/# \1/' /etc/keydb/keydb.conf; \
sed -i 's/^\(dir .*\)$/# \1\ndir \/data/' /etc/keydb/keydb.conf; \
sed -i 's/^\(logfile .*\)$/# \1/' /etc/keydb/keydb.conf; \
sed -i 's/protected-mode yes/protected-mode no/g' /etc/keydb/keydb.conf; \
sed -i 's/^\(bind .*\)$/# \1/' /etc/keydb/keydb.conf; \
echo -e "\nloadmodule /usr/local/lib/modstatsd.so" >> /etc/keydb/keydb.conf; \
ln -s keydb-cli redis-cli; \
cd /etc/keydb; \
ln -s keydb.conf redis.conf; \
rm -rf /tmp/*
# generate entrypoint script
RUN set -eux; \
echo '#!/bin/sh' > /usr/local/bin/docker-entrypoint.sh; \
echo 'set -e' >> /usr/local/bin/docker-entrypoint.sh; \
echo "# perpend 'keydb-server' if not provided as first argument" >> /usr/local/bin/docker-entrypoint.sh; \
echo 'if [ "${1}" != "keydb-server" ]; then' >> /usr/local/bin/docker-entrypoint.sh; \
echo ' set -- keydb-server "$@"' >> /usr/local/bin/docker-entrypoint.sh; \
echo 'fi' >> /usr/local/bin/docker-entrypoint.sh; \
echo "# allow the container to be started with `--user`" >> /usr/local/bin/docker-entrypoint.sh; \
echo 'if [ "$1" = "keydb-server" -a "$(id -u)" = "0" ]; then' >> /usr/local/bin/docker-entrypoint.sh; \
echo " find . \! -user keydb -exec chown keydb '{}' +" >> /usr/local/bin/docker-entrypoint.sh; \
echo ' exec gosu keydb "$0" "$@"' >> /usr/local/bin/docker-entrypoint.sh; \
echo 'fi' >> /usr/local/bin/docker-entrypoint.sh; \
echo 'exec "$@"' >> /usr/local/bin/docker-entrypoint.sh; \
chmod +x /usr/local/bin/docker-entrypoint.sh
# set remaining image properties
VOLUME /data
WORKDIR /data
ENV KEYDB_PRO_DIRECTORY=/usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
EXPOSE 6379
CMD ["keydb-server","/etc/keydb/keydb.conf"]
-8
View File
@@ -1,8 +0,0 @@
#!/bin/bash
# make the build
git submodule init && git submodule update
make BUILD_TLS=yes ENABLE_FLASH=yes -j$(nproc) KEYDB_CFLAGS='-Werror' KEYDB_CXXFLAGS='-Werror'
# gen-cert
./utils/gen-test-certs.sh
-14
View File
@@ -2063,17 +2063,3 @@ server-threads 2
#
# By default KeyDB sets this to 2.
replica-weighting-factor 2
# Enable FLASH support (Experimental Feature)
# storage-provider flash /path/to/flash/db
# Blob support is a way to store very large objects (>200MB) on disk
# The files are automatically cleaned up when KeyDB exits and are only
# for temporary use. This helps reduce memory pressure for very large
# data items at the cost of some performance.
#
# By default this config is disable. When enabled the disk associated
# with KeyDB's working directory will be used. If there is insufficient
# disk space or any other I/O error KeyDB will instead use memory.
#
# blob-support false
-5
View File
@@ -19,11 +19,6 @@ elif [ "$distributor" == "Ubuntu" ]; then
fi
codename=$(lsb_release --codename --short)
date=$(date +%a," "%d" "%b" "%Y" "%T)
# overwrite debian bookworm version until updated
if [ $codename == "bookworm" ]; then
distname=+deb12u1
fi
pkg_name=keydb-$majorv:$version$distname
# create build tree
-1
View File
@@ -4,7 +4,6 @@ include /usr/share/dpkg/buildflags.mk
export BUILD_TLS=yes
export USE_SYSTEMD=yes
export ENABLE_FLASH=yes
export CFLAGS CPPFLAGS LDFLAGS
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -ldl -latomic $(LUA_LDFLAGS)
-1
View File
@@ -10,7 +10,6 @@ include /usr/share/dpkg/buildflags.mk
export BUILD_TLS=yes
export USE_SYSTEMD=yes
export ENABLE_FLASH=yes
export CFLAGS CPPFLAGS LDFLAGS
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -ldl -latomic $(LUA_LDFLAGS)
+2 -7
View File
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM ubuntu:18.04
SHELL ["/bin/bash","-c"]
RUN groupadd -r keydb && useradd -r -g keydb keydb
# use gosu for easy step-down from root: https://github.com/tianon/gosu/releases
@@ -53,7 +53,7 @@ RUN set -eux; \
grep -E '^ *createBoolConfig[(]"protected-mode",.*, *1 *,.*[)],$' ./src/config.cpp; \
sed -ri 's!^( *createBoolConfig[(]"protected-mode",.*, *)1( *,.*[)],)$!\10\2!' ./src/config.cpp; \
grep -E '^ *createBoolConfig[(]"protected-mode",.*, *0 *,.*[)],$' ./src/config.cpp; \
make -j$(nproc) BUILD_TLS=yes ENABLE_FLASH=yes; \
make -j$(nproc) BUILD_TLS=yes; \
cd src; \
strip keydb-cli keydb-benchmark keydb-check-rdb keydb-check-aof keydb-diagnostic-tool keydb-sentinel keydb-server; \
mv keydb-server keydb-cli keydb-benchmark keydb-check-rdb keydb-check-aof keydb-diagnostic-tool keydb-sentinel /usr/local/bin/; \
@@ -83,7 +83,6 @@ RUN \
sed -i 's/^\(logfile .*\)$/# \1/' /etc/keydb/keydb.conf; \
sed -i 's/protected-mode yes/protected-mode no/g' /etc/keydb/keydb.conf; \
sed -i 's/^\(bind .*\)$/# \1/' /etc/keydb/keydb.conf; \
cd /usr/local/bin; \
ln -s keydb-cli redis-cli; \
cd /etc/keydb; \
ln -s keydb.conf redis.conf; \
@@ -97,10 +96,6 @@ RUN set -eux; \
echo 'if [ "${1#-}" != "$1" ] || [ "${1%.conf}" != "$1" ]; then' >> /usr/local/bin/docker-entrypoint.sh; \
echo ' set -- keydb-server "$@"' >> /usr/local/bin/docker-entrypoint.sh; \
echo 'fi' >> /usr/local/bin/docker-entrypoint.sh; \
echo '# if KEYDB_PASSWORD is set, add it to the arguments' >> /usr/local/bin/docker-entrypoint.sh; \
echo 'if [ -n "$KEYDB_PASSWORD" ]; then' >> /usr/local/bin/docker-entrypoint.sh; \
echo ' set -- "$@" --requirepass "${KEYDB_PASSWORD}"' >> /usr/local/bin/docker-entrypoint.sh; \
echo 'fi' >> /usr/local/bin/docker-entrypoint.sh; \
echo "# allow the container to be started with `--user`" >> /usr/local/bin/docker-entrypoint.sh; \
echo 'if [ "$1" = "keydb-server" -a "$(id -u)" = "0" ]; then' >> /usr/local/bin/docker-entrypoint.sh; \
echo " find . \! -user keydb -exec chown keydb '{}' +" >> /usr/local/bin/docker-entrypoint.sh; \
+4 -13
View File
@@ -1,11 +1,11 @@
FROM alpine:3.18
FROM alpine:3.12
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN addgroup -S -g 1000 keydb && adduser -S -G keydb -u 999 keydb
RUN mkdir -p /etc/keydb
ARG BRANCH
RUN set -eux; \
\
apk add --no-cache su-exec tini; \
apk add --no-cache su-exec; \
apk add --no-cache --virtual .build-deps \
coreutils \
gcc \
@@ -21,10 +21,6 @@ RUN set -eux; \
bash \
perl \
git \
bzip2-dev \
zstd-dev \
lz4-dev \
snappy-dev \
; \
cd /tmp && git clone --branch $BRANCH https://github.com/Snapchat/KeyDB.git --recursive; \
cd /tmp/KeyDB; \
@@ -32,7 +28,7 @@ RUN set -eux; \
grep -E '^ *createBoolConfig[(]"protected-mode",.*, *1 *,.*[)],$' ./src/config.cpp; \
sed -ri 's!^( *createBoolConfig[(]"protected-mode",.*, *)1( *,.*[)],)$!\10\2!' ./src/config.cpp; \
grep -E '^ *createBoolConfig[(]"protected-mode",.*, *0 *,.*[)],$' ./src/config.cpp; \
make -j$(nproc) BUILD_TLS=yes ENABLE_FLASH=yes; \
make -j$(nproc) BUILD_TLS=yes; \
cd src; \
strip keydb-cli keydb-benchmark keydb-check-rdb keydb-check-aof keydb-diagnostic-tool keydb-sentinel keydb-server; \
mv keydb-server keydb-cli keydb-benchmark keydb-check-rdb keydb-check-aof keydb-diagnostic-tool keydb-sentinel /usr/local/bin/; \
@@ -54,7 +50,6 @@ RUN set -eux; \
sed -i 's/^\(logfile .*\)$/# \1/' /etc/keydb/keydb.conf; \
sed -i 's/protected-mode yes/protected-mode no/g' /etc/keydb/keydb.conf; \
sed -i 's/^\(bind .*\)$/# \1/' /etc/keydb/keydb.conf; \
cd /usr/local/bin; \
ln -s keydb-cli redis-cli; \
cd /etc/keydb; \
ln -s keydb.conf redis.conf; \
@@ -68,10 +63,6 @@ RUN set -eux; \
echo 'if [ "${1#-}" != "$1" ] || [ "${1%.conf}" != "$1" ]; then' >> /usr/local/bin/docker-entrypoint.sh; \
echo ' set -- keydb-server "$@"' >> /usr/local/bin/docker-entrypoint.sh; \
echo 'fi' >> /usr/local/bin/docker-entrypoint.sh; \
echo '# if KEYDB_PASSWORD is set, add it to the arguments' >> /usr/local/bin/docker-entrypoint.sh; \
echo 'if [ -n "$KEYDB_PASSWORD" ]; then' >> /usr/local/bin/docker-entrypoint.sh; \
echo ' set -- "$@" --requirepass "${KEYDB_PASSWORD}"' >> /usr/local/bin/docker-entrypoint.sh; \
echo 'fi' >> /usr/local/bin/docker-entrypoint.sh; \
echo "# allow the container to be started with `--user`" >> /usr/local/bin/docker-entrypoint.sh; \
echo 'if [ "$1" = "keydb-server" -a "$(id -u)" = "0" ]; then' >> /usr/local/bin/docker-entrypoint.sh; \
echo " find . \! -user keydb -exec chown keydb '{}' +" >> /usr/local/bin/docker-entrypoint.sh; \
@@ -81,6 +72,6 @@ RUN set -eux; \
chmod +x /usr/local/bin/docker-entrypoint.sh
VOLUME /data
WORKDIR /data
ENTRYPOINT ["tini", "--", "docker-entrypoint.sh"]
ENTRYPOINT ["docker-entrypoint.sh"]
EXPOSE 6379
CMD ["keydb-server", "/etc/keydb/keydb.conf"]
@@ -2063,17 +2063,3 @@ server-threads 2
#
# By default KeyDB sets this to 2.
replica-weighting-factor 2
# Enable FLASH support (Experimental Feature)
# storage-provider flash /path/to/flash/db
# Blob support is a way to store very large objects (>200MB) on disk
# The files are automatically cleaned up when KeyDB exits and are only
# for temporary use. This helps reduce memory pressure for very large
# data items at the cost of some performance.
#
# By default this config is disable. When enabled the disk associated
# with KeyDB's working directory will be used. If there is insufficient
# disk space or any other I/O error KeyDB will instead use memory.
#
# blob-support false
-1
View File
@@ -37,6 +37,5 @@ $TCLSH tests/test_helper.tcl \
--single unit/moduleapi/hash \
--single unit/moduleapi/zset \
--single unit/moduleapi/stream \
--single unit/moduleapi/load \
--config server-threads 3 \
"${@}"
-8
View File
@@ -1,7 +1,6 @@
#pragma once
#include <functional>
#include "sds.h"
#include <string>
#define METADATA_DB_IDENTIFIER "c299fde0-6d42-4ec4-b939-34f680ffe39f"
@@ -15,7 +14,6 @@ public:
virtual class IStorage *createMetadataDb() = 0;
virtual const char *name() const = 0;
virtual size_t totalDiskspaceUsed() const = 0;
virtual sdsstring getInfo() const = 0;
virtual bool FSlow() const = 0;
virtual size_t filedsRequired() const { return 0; }
};
@@ -33,7 +31,6 @@ public:
virtual void retrieve(const char *key, size_t cchKey, callbackSingle fn) const = 0;
virtual size_t clear() = 0;
virtual bool enumerate(callback fn) const = 0;
virtual bool enumerate_hashslot(callback fn, unsigned int hashslot) const = 0;
virtual size_t count() const = 0;
virtual void bulkInsert(char **rgkeys, size_t *rgcbkeys, char **rgvals, size_t *rgcbvals, size_t celem) {
@@ -44,11 +41,6 @@ public:
endWriteBatch();
}
virtual std::vector<std::string> getExpirationCandidates(unsigned int count) = 0;
virtual std::vector<std::string> getEvictionCandidates(unsigned int count) = 0;
virtual void setExpire(const char *key, size_t cchKey, long long expire) = 0;
virtual void removeExpire(const char *key, size_t cchKey, long long expire) = 0;
virtual void beginWriteBatch() {} // NOP
virtual void endWriteBatch() {} // NOP
+5 -14
View File
@@ -25,7 +25,7 @@ NODEPS:=clean distclean
# Default settings
STD=-pedantic -DREDIS_STATIC=''
CXX_STD=-std=c++17 -pedantic -fno-rtti -D__STDC_FORMAT_MACROS
CXX_STD=-std=c++14 -pedantic -fno-rtti -D__STDC_FORMAT_MACROS
ifneq (,$(findstring clang,$(CC)))
STD+=-Wno-c11-extensions
else
@@ -142,12 +142,10 @@ DEBUG=-g -ggdb
FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(KEYDB_CFLAGS) $(REDIS_CFLAGS)
FINAL_CXXFLAGS=$(CXX_STD) $(WARN) $(OPT) $(DEBUG) $(CXXFLAGS) $(KEYDB_CFLAGS) $(REDIS_CFLAGS)
FINAL_LDFLAGS=$(LDFLAGS) $(KEYDB_LDFLAGS) $(DEBUG)
FINAL_LIBS+=-lm -lz -lcrypto
FINAL_LIBS+=-lm
ifneq ($(uname_S),Darwin)
ifneq ($(uname_S),FreeBSD)
FINAL_LIBS+=-latomic
endif
endif
# Linux ARM32 needs -latomic at linking time
ifneq (,$(findstring armv,$(uname_M)))
@@ -213,13 +211,7 @@ ifeq ($(uname_S),NetBSD)
else
ifeq ($(uname_S),FreeBSD)
# FreeBSD
FINAL_LIBS+= -lpthread -luuid -lexecinfo
FINAL_CFLAGS+= -I/usr/local/include
FINAL_CXXFLAGS+= -I/usr/local/include
FINAL_LDFLAGS+= -L/usr/local/lib
ifeq ($(USE_BACKTRACE),yes)
FINAL_CFLAGS+= -DUSE_BACKTRACE
endif
FINAL_LIBS+= -lpthread -lexecinfo
else
ifeq ($(uname_S),DragonFly)
# DragonFly
@@ -268,7 +260,7 @@ endif
# Include paths to dependencies
FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -I../deps/hdr_histogram
FINAL_CXXFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -I../deps/hdr_histogram -I../deps/rocksdb/include/ -I../deps/concurrentqueue
FINAL_CXXFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -I../deps/hdr_histogram -I../deps/concurrentqueue
# Determine systemd support and/or build preference (defaulting to auto-detection)
BUILD_WITH_SYSTEMD=no
@@ -358,7 +350,6 @@ endif
OS := $(shell cat /etc/os-release | grep ID= | head -n 1 | cut -d'=' -f2)
ifeq ($(OS),alpine)
FINAL_CXXFLAGS+=-DUNW_LOCAL_ONLY
FINAL_CXXFLAGS+=-DALPINE
FINAL_LIBS += -lunwind
endif
@@ -385,7 +376,7 @@ endif
REDIS_SERVER_NAME=keydb-server$(PROG_SUFFIX)
REDIS_SENTINEL_NAME=keydb-sentinel$(PROG_SUFFIX)
REDIS_SERVER_OBJ=adlist.o quicklist.o ae.o anet.o dict.o server.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o t_nhash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o scripting.o bio.o rio.o rand.o memtest.o crcspeed.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o redis-check-rdb.o redis-check-aof.o geo.o lazyfree.o module.o evict.o expire.o geohash.o geohash_helper.o childinfo.o defrag.o siphash.o rax.o t_stream.o listpack.o localtime.o acl.o storage.o rdb-s3.o fastlock.o new.o tracking.o cron.o connection.o tls.o sha256.o motd_server.o timeout.o setcpuaffinity.o AsyncWorkQueue.o snapshot.o storage/teststorageprovider.o keydbutils.o StorageCache.o monotonic.o cli_common.o mt19937-64.o meminfo.o $(ASM_OBJ) $(STORAGE_OBJ)
REDIS_SERVER_OBJ=adlist.o quicklist.o ae.o anet.o dict.o server.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o t_nhash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o scripting.o bio.o rio.o rand.o memtest.o crcspeed.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o redis-check-rdb.o redis-check-aof.o geo.o lazyfree.o module.o evict.o expire.o geohash.o geohash_helper.o childinfo.o defrag.o siphash.o rax.o t_stream.o listpack.o localtime.o acl.o storage.o rdb-s3.o fastlock.o new.o tracking.o cron.o connection.o tls.o sha256.o motd_server.o timeout.o setcpuaffinity.o AsyncWorkQueue.o snapshot.o storage/teststorageprovider.o keydbutils.o StorageCache.o monotonic.o cli_common.o mt19937-64.o $(ASM_OBJ) $(STORAGE_OBJ)
KEYDB_SERVER_OBJ=SnapshotPayloadParseState.o
REDIS_CLI_NAME=keydb-cli$(PROG_SUFFIX)
REDIS_CLI_OBJ=anet.o adlist.o dict.o redis-cli.o redis-cli-cpphelper.o zmalloc.o release.o anet.o ae.o crcspeed.o crc64.o siphash.o crc16.o storage-lite.o fastlock.o motd_client.o monotonic.o cli_common.o mt19937-64.o $(ASM_OBJ)
+7 -7
View File
@@ -136,12 +136,12 @@ void SnapshotPayloadParseState::flushQueuedKeys() {
int idb = current_database;
serverAssert(vecqueuedKeys.size() == vecqueuedVals.size());
auto sizePrev = vecqueuedKeys.size();
(*insertsInFlight)++;
std::weak_ptr<std::atomic<int>> insertsInFlightTmp = insertsInFlight; // C++ GRRRRRRRRRRRRRRRR, we don't want to capute "this" because that's dangerous
++insertsInFlight;
auto &insertsInFlightTmp = insertsInFlight; // C++ GRRRRRRRRRRRRRRRR, we don't want to capute "this" because that's dangerous
if (current_database < cserver.dbnum) {
g_pserver->asyncworkqueue->AddWorkFunction([idb, vecqueuedKeys = std::move(this->vecqueuedKeys), vecqueuedKeysCb = std::move(this->vecqueuedKeysCb), vecqueuedVals = std::move(this->vecqueuedVals), vecqueuedValsCb = std::move(this->vecqueuedValsCb), insertsInFlightTmp, pallocator = m_spallocator.release()]() mutable {
g_pserver->db[idb]->bulkDirectStorageInsert(vecqueuedKeys.data(), vecqueuedKeysCb.data(), vecqueuedVals.data(), vecqueuedValsCb.data(), vecqueuedKeys.size());
(*(insertsInFlightTmp.lock()))--;
g_pserver->asyncworkqueue->AddWorkFunction([idb, vecqueuedKeys = std::move(this->vecqueuedKeys), vecqueuedKeysCb = std::move(this->vecqueuedKeysCb), vecqueuedVals = std::move(this->vecqueuedVals), vecqueuedValsCb = std::move(this->vecqueuedValsCb), &insertsInFlightTmp, pallocator = m_spallocator.release()]() mutable {
g_pserver->db[idb]->bulkStorageInsert(vecqueuedKeys.data(), vecqueuedKeysCb.data(), vecqueuedVals.data(), vecqueuedValsCb.data(), vecqueuedKeys.size());
--insertsInFlightTmp;
delete pallocator;
});
} else {
@@ -172,7 +172,7 @@ SnapshotPayloadParseState::SnapshotPayloadParseState() {
dictLongLongMetaData = dictCreate(&metadataLongLongDictType, nullptr);
dictMetaData = dictCreate(&metadataDictType, nullptr);
insertsInFlight = std::make_shared<std::atomic<int>>();
insertsInFlight = 0;
m_spallocator = std::make_unique<SlabAllocator>();
}
@@ -214,7 +214,7 @@ void SnapshotPayloadParseState::trimState() {
if (stackParse.empty()) {
flushQueuedKeys();
while (*insertsInFlight > 0) {
while (insertsInFlight > 0) {
// TODO: ProcessEventsWhileBlocked
aeReleaseLock();
aeAcquireLock();
+2 -2
View File
@@ -36,7 +36,7 @@ class SnapshotPayloadParseState {
std::vector<size_t> vecqueuedValsCb;
std::shared_ptr<std::atomic<int>> insertsInFlight;
std::atomic<int> insertsInFlight;
std::unique_ptr<SlabAllocator> m_spallocator;
dict *dictLongLongMetaData = nullptr;
dict *dictMetaData = nullptr;
@@ -62,5 +62,5 @@ public:
void pushArray(long long size);
void pushValue(const char *rgch, long long cch);
void pushValue(long long value);
bool shouldThrottle() const { return *insertsInFlight > (cserver.cthreads*4); }
bool shouldThrottle() const { return insertsInFlight > (cserver.cthreads*4); }
};
+12 -34
View File
@@ -21,7 +21,7 @@ dictType dbStorageCacheType = {
StorageCache::StorageCache(IStorage *storage, bool fCache)
: m_spstorage(storage)
{
if (!g_pserver->flash_disable_key_cache && fCache)
if (fCache)
m_pdict = dictCreate(&dbStorageCacheType, nullptr);
}
@@ -43,8 +43,6 @@ void StorageCache::clear(void(callback)(void*))
void StorageCache::clearAsync()
{
std::unique_lock<fastlock> ul(m_lock);
if (count() == 0)
return;
if (m_pdict != nullptr) {
dict *dSav = m_pdict;
m_pdict = dictCreate(&dbStorageCacheType, nullptr);
@@ -84,31 +82,19 @@ void StorageCache::cacheKey(const char *rgch, size_t cch)
bool StorageCache::erase(sds key)
{
unsigned long long when = 0;
m_spstorage->retrieve(key, sdslen(key), [&when](const char *, size_t, const void * data, size_t cbdata) {
auto e = deserializeExpire((const char *)data, cbdata, nullptr);
if (e != nullptr)
when = e->when();
});
bool result = m_spstorage->erase(key, sdslen(key));
std::unique_lock<fastlock> ul(m_lock);
if (result)
if (result && m_pdict != nullptr)
{
if (m_pdict != nullptr)
{
uint64_t hash = dictSdsHash(key);
dictEntry *de = dictFind(m_pdict, reinterpret_cast<void*>(hash));
serverAssert(de != nullptr);
de->v.s64--;
serverAssert(de->v.s64 >= 0);
if (de->v.s64 == 0) {
dictDelete(m_pdict, reinterpret_cast<void*>(hash));
} else {
m_collisionCount--;
}
}
if (when != 0) {
m_spstorage->removeExpire(key, sdslen(key), when);
uint64_t hash = dictSdsHash(key);
dictEntry *de = dictFind(m_pdict, reinterpret_cast<void*>(hash));
serverAssert(de != nullptr);
de->v.s64--;
serverAssert(de->v.s64 >= 0);
if (de->v.s64 == 0) {
dictDelete(m_pdict, reinterpret_cast<void*>(hash));
} else {
m_collisionCount--;
}
}
return result;
@@ -123,9 +109,6 @@ void StorageCache::insert(sds key, const void *data, size_t cbdata, bool fOverwr
}
ul.unlock();
m_spstorage->insert(key, sdslen(key), (void*)data, cbdata, fOverwrite);
auto e = deserializeExpire((const char *)data, cbdata, nullptr);
if (e != nullptr)
m_spstorage->setExpire(key, sdslen(key), e->when());
}
long _dictKeyIndex(dict *d, const void *key, uint64_t hash, dictEntry **existing);
@@ -134,18 +117,13 @@ void StorageCache::bulkInsert(char **rgkeys, size_t *rgcbkeys, char **rgvals, si
std::vector<dictEntry*> vechashes;
if (m_pdict != nullptr) {
vechashes.reserve(celem);
}
for (size_t ielem = 0; ielem < celem; ++ielem) {
if (m_pdict != nullptr) {
for (size_t ielem = 0; ielem < celem; ++ielem) {
dictEntry *de = (dictEntry*)zmalloc(sizeof(dictEntry));
de->key = (void*)dictGenHashFunction(rgkeys[ielem], (int)rgcbkeys[ielem]);
de->v.u64 = 1;
vechashes.push_back(de);
}
auto e = deserializeExpire(rgvals[ielem], rgcbvals[ielem], nullptr);
if (e != nullptr)
m_spstorage->setExpire(rgkeys[ielem], rgcbkeys[ielem], e->when());
}
std::unique_lock<fastlock> ul(m_lock);
-8
View File
@@ -49,20 +49,12 @@ public:
void expand(uint64_t slots);
bool enumerate(IStorage::callback fn) const { return m_spstorage->enumerate(fn); }
bool enumerate_hashslot(IStorage::callback fn, unsigned int hashslot) const { return m_spstorage->enumerate_hashslot(fn, hashslot); }
std::vector<std::string> getExpirationCandidates(unsigned int count) { return m_spstorage->getExpirationCandidates(count); }
std::vector<std::string> getEvictionCandidates(unsigned int count) { return m_spstorage->getEvictionCandidates(count); }
void setExpire(const char *key, size_t cchKey, long long expire) { m_spstorage->setExpire(key, cchKey, expire); }
void removeExpire(const char *key, size_t cchKey, long long expire) { m_spstorage->removeExpire(key, cchKey, expire); }
void beginWriteBatch();
void endWriteBatch() { m_spstorage->endWriteBatch(); }
void batch_lock() { return m_spstorage->batch_lock(); }
void batch_unlock() { return m_spstorage->batch_unlock(); }
void flush() { m_spstorage->flush(); }
size_t count() const;
const StorageCache *clone();
+5 -39
View File
@@ -113,8 +113,6 @@ enum class AE_ASYNC_OP
PostCppFunction,
DeleteFileEvent,
CreateFileEvent,
PostAsynDBFunction,
};
struct aeCommand
@@ -127,8 +125,6 @@ struct aeCommand
aePostFunctionProc *proc;
aeFileProc *fproc;
std::function<void()> *pfn;
aePostFunctionTokenProc* tproc;
};
void *clientData;
};
@@ -179,17 +175,6 @@ void aeProcessCmd(aeEventLoop *eventLoop, int fd, void *, int )
(*cmd.pfn)();
delete cmd.pfn;
break;
}
case AE_ASYNC_OP::PostAsynDBFunction:
{ //added to support async api IStorage
if (cmd.fLock && !ulock.owns_lock()) {
g_forkLock.releaseRead();
ulock.lock();
g_forkLock.acquireRead();
}
((aePostFunctionTokenProc*)cmd.tproc)(eventLoop,(StorageToken*)cmd.clientData);
break;
}
break;
}
@@ -271,20 +256,6 @@ int aePostFunction(aeEventLoop *eventLoop, aePostFunctionProc *proc, void *arg)
return AE_OK;
}
int aePostFunction(aeEventLoop *eventLoop, aePostFunctionTokenProc *proc, StorageToken *token)
{
//added to support async api IStorage
aeCommand cmd = {};
cmd.op = AE_ASYNC_OP::PostAsynDBFunction;
cmd.tproc = proc;
cmd.clientData = (void*)token;
cmd.fLock = true;
auto size = write(eventLoop->fdCmdWrite, &cmd, sizeof(cmd));
if (size != sizeof(cmd))
return AE_ERR;
return AE_OK;
}
int aePostFunction(aeEventLoop *eventLoop, std::function<void()> fn, bool fLock, bool fForceQueue)
{
if (eventLoop == g_eventLoopThisThread && !fForceQueue)
@@ -745,6 +716,11 @@ int aeProcessEvents(aeEventLoop *eventLoop, int flags)
}
}
if (eventLoop->flags & AE_DONT_WAIT) {
tv.tv_sec = tv.tv_usec = 0;
tvp = &tv;
}
if (eventLoop->beforesleep != NULL && flags & AE_CALL_BEFORE_SLEEP) {
std::unique_lock<decltype(g_lock)> ulock(g_lock, std::defer_lock);
if (!(eventLoop->beforesleepFlags & AE_SLEEP_THREADSAFE)) {
@@ -755,11 +731,6 @@ int aeProcessEvents(aeEventLoop *eventLoop, int flags)
eventLoop->beforesleep(eventLoop);
}
if (eventLoop->flags & AE_DONT_WAIT) {
tv.tv_sec = tv.tv_usec = 0;
tvp = &tv;
}
/* Call the multiplexing API, will return only on timeout or when
* some event fires. */
numevents = aeApiPoll(eventLoop, tvp);
@@ -888,11 +859,6 @@ void aeReleaseForkLock()
g_forkLock.downgradeWrite();
}
void aeForkLockInChild()
{
g_forkLock.setMulti(false);
}
int aeThreadOwnsLock()
{
return fOwnLockOverride || g_lock.fOwnLock();
+1 -6
View File
@@ -72,15 +72,13 @@ extern "C" {
#define AE_NOTUSED(V) ((void) V)
struct aeEventLoop;
/* Types and data structures */
typedef void aeFileProc(struct aeEventLoop *eventLoop, int fd, void *clientData, int mask);
typedef int aeTimeProc(struct aeEventLoop *eventLoop, long long id, void *clientData);
typedef void aeEventFinalizerProc(struct aeEventLoop *eventLoop, void *clientData);
typedef void aeBeforeSleepProc(struct aeEventLoop *eventLoop);
typedef void aePostFunctionProc(void *pvArgs);
//added to support async api IStorage
struct StorageToken;
typedef void aePostFunctionTokenProc(struct aeEventLoop *el, struct StorageToken *token);
/* File event structure */
typedef struct aeFileEvent {
@@ -136,8 +134,6 @@ int aePostFunction(aeEventLoop *eventLoop, aePostFunctionProc *proc, void *arg);
#ifdef __cplusplus
} // EXTERN C
int aePostFunction(aeEventLoop *eventLoop, std::function<void()> fn, bool fLock = true, bool fForceQueue = false);
//added to support async api IStorage
int aePostFunction(aeEventLoop *eventLoop, aePostFunctionTokenProc *proc, StorageToken *token);
extern "C" {
#endif
void aeDeleteEventLoop(aeEventLoop *eventLoop);
@@ -175,7 +171,6 @@ int aeTryAcquireLock(int fWeak);
void aeThreadOffline();
void aeReleaseLock();
void aeReleaseForkLock();
void aeForkLockInChild();
int aeThreadOwnsLock();
void aeSetThreadOwnsLockOverride(int fOverride);
int aeLockContested(int threshold);
+1 -1
View File
@@ -441,7 +441,7 @@ static int _anetTcpServer(char *err, int port, const char *bindaddr, int af, int
char _port[6]; /* strlen("65535") */
struct addrinfo hints, *servinfo, *p;
snprintf(_port,sizeof(_port),"%d",port);
snprintf(_port,6,"%d",port);
memset(&hints,0,sizeof(hints));
hints.ai_family = af;
hints.ai_socktype = SOCK_STREAM;
+13 -12
View File
@@ -285,7 +285,7 @@ int startAppendOnly(void) {
strerror(errno));
return C_ERR;
}
if (hasActiveChildProcessOrBGSave() && g_pserver->child_type != CHILD_TYPE_AOF) {
if (hasActiveChildProcess() && g_pserver->child_type != CHILD_TYPE_AOF) {
g_pserver->aof_rewrite_scheduled = 1;
serverLog(LL_WARNING,"AOF was enabled but there is already another background operation. An AOF background was scheduled to start when possible.");
} else {
@@ -438,7 +438,7 @@ void flushAppendOnlyFile(int force) {
* useful for graphing / monitoring purposes. */
if (sync_in_progress) {
latencyAddSampleIfNeeded("aof-write-pending-fsync",latency);
} else if (hasActiveChildProcessOrBGSave()) {
} else if (hasActiveChildProcess()) {
latencyAddSampleIfNeeded("aof-write-active-child",latency);
} else {
latencyAddSampleIfNeeded("aof-write-alone",latency);
@@ -535,7 +535,7 @@ void flushAppendOnlyFile(int force) {
try_fsync:
/* Don't fsync if no-appendfsync-on-rewrite is set to yes and there are
* children doing I/O in the background. */
if (g_pserver->aof_no_fsync_on_rewrite && hasActiveChildProcessOrBGSave())
if (g_pserver->aof_no_fsync_on_rewrite && hasActiveChildProcess())
return;
/* Perform the fsync if needed. */
@@ -752,7 +752,7 @@ void feedAppendOnlyFile(struct redisCommand *cmd, int dictid, robj **argv, int a
* accumulate the differences between the child DB and the current one
* in a buffer, so that when the child process will do its work we
* can append the differences to the new append only file. */
if (hasActiveChildProcess() && g_pserver->child_type == CHILD_TYPE_AOF)
if (g_pserver->child_type == CHILD_TYPE_AOF)
aofRewriteBufferAppend((unsigned char*)buf,sdslen(buf));
sdsfree(buf);
@@ -1592,7 +1592,8 @@ int rewriteAppendOnlyFileRio(rio *aof) {
}
/* Save the expire time */
if (o->FExpires()) {
expireEntry *pexpire = &o->expire;
std::unique_lock<fastlock> ul(g_expireLock);
expireEntry *pexpire = db->getExpire(&key);
for (auto &subExpire : *pexpire) {
if (subExpire.subkey() == nullptr)
{
@@ -1657,7 +1658,7 @@ int rewriteAppendOnlyFile(char *filename) {
{ // BEGIN GOTO SCOPED VARIABLES
/* Note that we have to use a different temp name here compared to the
* one used by rewriteAppendOnlyFileBackground() function. */
snprintf(tmpfile,sizeof(tmpfile),"temp-rewriteaof-%d.aof", (int) getpid());
snprintf(tmpfile,256,"temp-rewriteaof-%d.aof", (int) getpid());
fp = fopen(tmpfile,"w");
if (!fp) {
serverLog(LL_WARNING, "Opening the temp file for AOF rewrite in rewriteAppendOnlyFile(): %s", strerror(errno));
@@ -1886,7 +1887,7 @@ void aofClosePipes(void) {
int rewriteAppendOnlyFileBackground(void) {
pid_t childpid;
if (hasActiveChildProcessOrBGSave()) return C_ERR;
if (hasActiveChildProcess()) return C_ERR;
if (aofCreatePipes() != C_OK) return C_ERR;
if ((childpid = redisFork(CHILD_TYPE_AOF)) == 0) {
char tmpfile[256];
@@ -1894,7 +1895,7 @@ int rewriteAppendOnlyFileBackground(void) {
/* Child */
redisSetProcTitle("keydb-aof-rewrite");
redisSetCpuAffinity(g_pserver->aof_rewrite_cpulist);
snprintf(tmpfile,sizeof(tmpfile),"temp-rewriteaof-bg-%d.aof", (int) getpid());
snprintf(tmpfile,256,"temp-rewriteaof-bg-%d.aof", (int) getpid());
if (rewriteAppendOnlyFile(tmpfile) == C_OK) {
sendChildCowInfo(CHILD_INFO_TYPE_AOF_COW_SIZE, "AOF rewrite");
exitFromChild(0);
@@ -1929,7 +1930,7 @@ int rewriteAppendOnlyFileBackground(void) {
void bgrewriteaofCommand(client *c) {
if (g_pserver->child_type == CHILD_TYPE_AOF) {
addReplyError(c,"Background append only file rewriting already in progress");
} else if (hasActiveChildProcessOrBGSave()) {
} else if (hasActiveChildProcess()) {
g_pserver->aof_rewrite_scheduled = 1;
addReplyStatus(c,"Background append only file rewriting scheduled");
} else if (rewriteAppendOnlyFileBackground() == C_OK) {
@@ -1943,10 +1944,10 @@ void bgrewriteaofCommand(client *c) {
void aofRemoveTempFile(pid_t childpid) {
char tmpfile[256];
snprintf(tmpfile,sizeof(tmpfile),"temp-rewriteaof-bg-%d.aof", (int) childpid);
snprintf(tmpfile,256,"temp-rewriteaof-bg-%d.aof", (int) childpid);
bg_unlink(tmpfile);
snprintf(tmpfile,sizeof(tmpfile),"temp-rewriteaof-%d.aof", (int) childpid);
snprintf(tmpfile,256,"temp-rewriteaof-%d.aof", (int) childpid);
bg_unlink(tmpfile);
}
@@ -1984,7 +1985,7 @@ void backgroundRewriteDoneHandler(int exitcode, int bysignal) {
/* Flush the differences accumulated by the parent to the
* rewritten AOF. */
latencyStartMonitor(latency);
snprintf(tmpfile,sizeof(tmpfile),"temp-rewriteaof-bg-%d.aof",
snprintf(tmpfile,256,"temp-rewriteaof-bg-%d.aof",
(int)g_pserver->child_pid);
newfd = open(tmpfile,O_WRONLY|O_APPEND);
if (newfd == -1) {
+1 -1
View File
@@ -322,7 +322,7 @@ handle_wrap:
return 1;
}
int checkSignedBitfieldOverflow(int64_t value, int64_t incr, int bits, int owtype, int64_t *limit) {
int checkSignedBitfieldOverflow(int64_t value, int64_t incr, uint64_t bits, int owtype, int64_t *limit) {
int64_t max = (bits == 64) ? INT64_MAX : (((int64_t)1<<(bits-1))-1);
int64_t min = (-max)-1;
-1
View File
@@ -732,7 +732,6 @@ void unblockClientWaitingData(client *c) {
c->bpop.xread_group = NULL;
c->bpop.xread_consumer = NULL;
}
c->bpop.timeout = 0;
}
static int getBlockedTypeByType(int type) {
-1
View File
@@ -42,7 +42,6 @@ typedef struct {
* RDB / AOF saving process from the child to the parent (for instance
* the amount of copy on write memory used) */
void openChildInfoPipe(void) {
serverAssert(g_pserver->child_info_pipe[0] == -1);
if (pipe(g_pserver->child_info_pipe) == -1) {
/* On error our two file descriptors should be still set to -1,
* but we call anyway closeChildInfoPipe() since can't hurt. */
+16 -43
View File
@@ -4516,8 +4516,8 @@ void clusterCommand(client *c) {
"NODES",
" Return cluster configuration seen by node. Output format:",
" <id> <ip:port> <flags> <master> <pings> <pongs> <epoch> <link> <slot> ...",
"REPLICATE (<node-id>|NO ONE)",
" Configure current node as replica to <node-id> or turn it into empty primary.",
"REPLICATE <node-id>",
" Configure current node as replica to <node-id>.",
"RESET [HARD|SOFT]",
" Reset current node (default: soft).",
"SET-CONFIG-EPOCH <epoch>",
@@ -4890,22 +4890,14 @@ NULL
clusterDoBeforeSleep(CLUSTER_TODO_UPDATE_STATE|
CLUSTER_TODO_SAVE_CONFIG);
addReply(c,shared.ok);
} else if (!strcasecmp(szFromObj(c->argv[1]),"replicate") && (c->argc == 3 || c->argc == 4)) {
/* CLUSTER REPLICATE (<NODE ID>|NO ONE) */
clusterNode *n;
if (c->argc == 4) {
if (0 != strcasecmp(szFromObj(c->argv[2]),"NO") || 0 != strcasecmp(szFromObj(c->argv[3]),"ONE")) {
addReplySubcommandSyntaxError(c);
return;
}
n = nullptr;
} else {
/* Lookup the specified node in our table. */
n = clusterLookupNode(szFromObj(c->argv[2]));
if (n == nullptr) {
addReplyErrorFormat(c,"Unknown node %s", (char*)ptrFromObj(c->argv[2]));
return;
}
} else if (!strcasecmp(szFromObj(c->argv[1]),"replicate") && c->argc == 3) {
/* CLUSTER REPLICATE <NODE ID> */
clusterNode *n = clusterLookupNode(szFromObj(c->argv[2]));
/* Lookup the specified node in our table. */
if (!n) {
addReplyErrorFormat(c,"Unknown node %s", (char*)ptrFromObj(c->argv[2]));
return;
}
/* I can't replicate myself. */
@@ -4915,7 +4907,7 @@ NULL
}
/* Can't replicate a slave. */
if (n != nullptr && nodeIsSlave(n)) {
if (nodeIsSlave(n)) {
addReplyError(c,"I can only replicate a master, not a replica.");
return;
}
@@ -4931,26 +4923,8 @@ NULL
return;
}
if (n == nullptr) {
if (nodeIsMaster(myself)) {
addReply(c,shared.ok);
return;
}
serverLog(LL_NOTICE,"Stop replication and turning myself into empty primary.");
clusterSetNodeAsMaster(myself);
if (listLength(g_pserver->masters) > 0)
{
serverAssert(listLength(g_pserver->masters) == 1);
replicationUnsetMaster((redisMaster*)listFirst(g_pserver->masters)->value);
}
int empty_db_flags = g_pserver->repl_slave_lazy_flush ? EMPTYDB_ASYNC : EMPTYDB_NO_FLAGS;
emptyDb(-1,empty_db_flags, nullptr);
/* Reset manual failover state. */
resetManualFailover();
} else {
/* Set the master. */
clusterSetMaster(n);
}
/* Set the master. */
clusterSetMaster(n);
clusterDoBeforeSleep(CLUSTER_TODO_UPDATE_STATE|CLUSTER_TODO_SAVE_CONFIG);
addReply(c,shared.ok);
} else if ((!strcasecmp(szFromObj(c->argv[1]),"slaves") ||
@@ -5133,7 +5107,7 @@ void createDumpPayload(rio *payload, robj_roptr o, robj *key) {
serverAssert(rdbSaveObject(payload,o,key));
char szT[32];
uint64_t mvcc = mvccFromObj(o);
snprintf(szT, sizeof(szT), "%" PRIu64, mvcc);
snprintf(szT, 32, "%" PRIu64, mvcc);
serverAssert(rdbSaveAuxFieldStrStr(payload,"mvcc-tstamp", szT) != -1);
/* Write the footer, this is how it looks like:
@@ -5610,6 +5584,7 @@ try_again:
/* Create RESTORE payload and generate the protocol to call the command. */
for (j = 0; j < num_keys; j++) {
long long ttl = 0;
std::unique_lock<fastlock> ul(g_expireLock);
expireEntry *pexpire = c->db->getExpire(kv[j]);
long long expireat = INVALID_EXPIRE;
if (pexpire != nullptr)
@@ -5991,9 +5966,7 @@ clusterNode *getNodeByQuery(client *c, struct redisCommand *cmd, robj **argv, in
/* If it is not the first key, make sure it is exactly
* the same key as the first we saw. */
if (!equalStringObjects(firstkey,thiskey)) {
clusterNode* nThisKey = g_pserver->cluster->slots[thisslot];
if ((slot != thisslot) && (nThisKey != n || migrating_slot || importing_slot || g_pserver->cluster->migrating_slots_to[slot] != nullptr || g_pserver->cluster->importing_slots_from[slot] != nullptr)) {
if (slot != thisslot) {
/* Error: multiple keys from different slots. */
getKeysFreeResult(&result);
if (error_code)
+13 -86
View File
@@ -35,13 +35,11 @@
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/wait.h>
#ifdef __linux__
#include <sys/sysinfo.h>
#endif
const char *KEYDB_SET_VERSION = KEYDB_REAL_VERSION;
size_t g_semiOrderedSetTargetBucketSize = 0; // Its a header only class so nowhere else for this to go
/*-----------------------------------------------------------------------------
* Config file name-value maps.
@@ -363,11 +361,11 @@ bool initializeStorageProvider(const char **err)
adjustOpenFilesLimit();
g_pserver->m_pstorageFactory = CreateRocksDBStorageFactory(g_sdsArgs, cserver.dbnum, cserver.storage_conf, cserver.storage_conf ? strlen(cserver.storage_conf) : 0);
#else
serverLog(LL_WARNING, "To use the flash storage provider please compile KeyDB with ENABLE_FLASH=yes");
serverLog(LL_WARNING, "Exiting due to the use of an unsupported storage provider");
exit(EXIT_FAILURE);
serverLog(LL_WARNING, "To use the flash storage provider please compile KeyDB with ENABLE_FLASH=yes");
serverLog(LL_WARNING, "Exiting due to the use of an unsupported storage provider");
exit(EXIT_FAILURE);
#endif
}
}
else if (!strcasecmp(g_sdsProvider, "test") && g_sdsArgs == nullptr)
{
g_pserver->m_pstorageFactory = new (MALLOC_LOCAL) TestStorageFactory();
@@ -749,18 +747,6 @@ void loadServerConfigFromString(char *config) {
g_pserver->fActiveReplica = CONFIG_DEFAULT_ACTIVE_REPLICA;
err = "argument must be 'yes' or 'no'"; goto loaderr;
}
if (listLength(g_pserver->masters) && g_pserver->fActiveReplica) {
err = "must not set replica-of config before active-replica config"; goto loaderr;
}
} else if (!strcasecmp(argv[0], "multi-master") && argc == 2) {
g_pserver->enable_multimaster = yesnotoi(argv[1]);
if (g_pserver->enable_multimaster == -1) {
g_pserver->enable_multimaster = CONFIG_DEFAULT_ENABLE_MULTIMASTER;
err = "argument must be 'yes' or 'no'"; goto loaderr;
}
if (listLength(g_pserver->masters) && g_pserver->enable_multimaster) {
err = "must not set replica-of config before multi-master config"; goto loaderr;
}
} else if (!strcasecmp(argv[0], "tls-allowlist")) {
if (argc < 2) {
err = "must supply at least one element in the allow list"; goto loaderr;
@@ -770,15 +756,6 @@ void loadServerConfigFromString(char *config) {
}
for (int i = 1; i < argc; i++)
g_pserver->tls_allowlist.emplace(argv[i], strlen(argv[i]));
} else if (!strcasecmp(argv[0], "tls-auditlog-blocklist")) {
if (argc < 2) {
err = "must supply at least one element in the block list"; goto loaderr;
}
if (!g_pserver->tls_auditlog_blocklist.empty()) {
err = "tls-auditlog-blocklist may only be set once"; goto loaderr;
}
for (int i = 1; i < argc; i++)
g_pserver->tls_auditlog_blocklist.emplace(argv[i], strlen(argv[i]));
} else if (!strcasecmp(argv[0], "version-override") && argc == 2) {
KEYDB_SET_VERSION = zstrdup(argv[1]);
serverLog(LL_WARNING, "Warning version is overriden to: %s\n", KEYDB_SET_VERSION);
@@ -790,7 +767,7 @@ void loadServerConfigFromString(char *config) {
g_sdsProvider = sdsdup(argv[1]);
if (argc > 2)
g_sdsArgs = sdsdup(argv[2]);
} else if (!strcasecmp(argv[0],"is-flash-enabled") && argc == 1) {
} else if (!strcasecmp(argv[0],"is-flash-enabled") && argc == 1) {
#ifdef ENABLE_ROCKSDB
exit(EXIT_SUCCESS);
#else
@@ -2121,10 +2098,7 @@ static void sdsConfigGet(client *c, typeData data) {
}
static void sdsConfigRewrite(typeData data, const char *name, struct rewriteConfigState *state) {
sds sdsDefault = data.sds.default_value ? sdsnew(data.sds.default_value) : NULL;
rewriteConfigSdsOption(state, name, *(data.sds.config), sdsDefault);
if (sdsDefault)
sdsfree(sdsDefault);
rewriteConfigSdsOption(state, name, *(data.sds.config), data.sds.default_value ? sdsnew(data.sds.default_value) : NULL);
}
@@ -2481,32 +2455,6 @@ static int isValidAOFfilename(char *val, const char **err) {
return 1;
}
static int isValidS3Bucket(char *s3bucket, const char **err) {
int status = EXIT_FAILURE;
pid_t pid = fork();
if (pid < 0)
{
*err = "couldn't fork to call aws cli";
return 0;
}
if (pid == 0)
{
execlp("aws", "aws", "s3", "ls", s3bucket, nullptr);
exit(EXIT_FAILURE);
}
else
{
waitpid(pid, &status, 0);
}
if (status != EXIT_SUCCESS) {
*err = "could not access s3 bucket";
return 0;
}
return 1;
}
/* Validate specified string is a valid proc-title-template */
static int isValidProcTitleTemplate(char *val, const char **err) {
if (!validateProcTitleTemplate(val)) {
@@ -2597,19 +2545,6 @@ static int updateMaxmemory(long long val, long long prev, const char **err) {
return 1;
}
static int updateFlashMaxmemory(long long val, long long prev, const char **err) {
UNUSED(prev);
UNUSED(err);
if (val && g_pserver->m_pstorageFactory) {
size_t used = g_pserver->m_pstorageFactory->totalDiskspaceUsed();
if ((unsigned long long)val < used) {
serverLog(LL_WARNING,"WARNING: the new maxstorage value set via CONFIG SET (%llu) is smaller than the current storage usage (%zu). This will result in key eviction and/or the inability to accept new write commands depending on the maxmemory-policy.", g_pserver->maxstorage, used);
}
performEvictions(false /*fPreSnapshot*/);
}
return 1;
}
static int updateGoodSlaves(long long val, long long prev, const char **err) {
UNUSED(val);
UNUSED(prev);
@@ -2652,7 +2587,7 @@ static int updateMaxclients(long long val, long long prev, const char **err) {
adjustOpenFilesLimit();
if (g_pserver->maxclients != val) {
static char msg[128];
snprintf(msg, sizeof(msg), "The operating system is not able to handle the specified number of clients, try with %d", g_pserver->maxclients);
sprintf(msg, "The operating system is not able to handle the specified number of clients, try with %d", g_pserver->maxclients);
*err = msg;
if (g_pserver->maxclients > prev) {
g_pserver->maxclients = prev;
@@ -2691,7 +2626,7 @@ static int updateMaxclients(long long val, long long prev, const char **err) {
if (res != AE_OK){
static char msg[128];
snprintf(msg, sizeof(msg),"Failed to post the request to change setsize for Thread %d", iel);
sprintf(msg, "Failed to post the request to change setsize for Thread %d", iel);
*err = msg;
return 0;
}
@@ -2835,6 +2770,7 @@ standardConfig configs[] = {
createBoolConfig("replica-serve-stale-data", "slave-serve-stale-data", MODIFIABLE_CONFIG, g_pserver->repl_serve_stale_data, 1, NULL, NULL),
createBoolConfig("replica-read-only", "slave-read-only", MODIFIABLE_CONFIG, g_pserver->repl_slave_ro, 1, NULL, NULL),
createBoolConfig("replica-ignore-maxmemory", "slave-ignore-maxmemory", MODIFIABLE_CONFIG, g_pserver->repl_slave_ignore_maxmemory, 1, NULL, NULL),
createBoolConfig("multi-master", NULL, IMMUTABLE_CONFIG, g_pserver->enable_multimaster,CONFIG_DEFAULT_ENABLE_MULTIMASTER, NULL, NULL),
createBoolConfig("jemalloc-bg-thread", NULL, MODIFIABLE_CONFIG, cserver.jemalloc_bg_thread, 1, NULL, updateJemallocBgThread),
createBoolConfig("activedefrag", NULL, MODIFIABLE_CONFIG, cserver.active_defrag_enabled, 0, isValidActiveDefrag, NULL),
createBoolConfig("syslog-enabled", NULL, IMMUTABLE_CONFIG, g_pserver->syslog_enabled, 0, NULL, NULL),
@@ -2842,7 +2778,7 @@ standardConfig configs[] = {
createBoolConfig("appendonly", NULL, MODIFIABLE_CONFIG, g_pserver->aof_enabled, 0, NULL, updateAppendonly),
createBoolConfig("cluster-allow-reads-when-down", NULL, MODIFIABLE_CONFIG, g_pserver->cluster_allow_reads_when_down, 0, NULL, NULL),
createBoolConfig("delete-on-evict", NULL, MODIFIABLE_CONFIG, cserver.delete_on_evict, 0, NULL, NULL),
createBoolConfig("use-fork", NULL, IMMUTABLE_CONFIG, cserver.fForkBgSave, 1, NULL, NULL),
createBoolConfig("use-fork", NULL, IMMUTABLE_CONFIG, cserver.fForkBgSave, 0, NULL, NULL),
createBoolConfig("io-threads-do-reads", NULL, IMMUTABLE_CONFIG, fDummy, 0, NULL, NULL),
createBoolConfig("time-thread-priority", NULL, IMMUTABLE_CONFIG, cserver.time_thread_priority, 0, NULL, NULL),
createBoolConfig("prefetch-enabled", NULL, MODIFIABLE_CONFIG, g_pserver->prefetch_enabled, 1, NULL, NULL),
@@ -2866,7 +2802,6 @@ standardConfig configs[] = {
createStringConfig("cluster-announce-ip", NULL, MODIFIABLE_CONFIG, EMPTY_STRING_IS_NULL, g_pserver->cluster_announce_ip, NULL, NULL, NULL),
createStringConfig("syslog-ident", NULL, IMMUTABLE_CONFIG, ALLOW_EMPTY_STRING, g_pserver->syslog_ident, "redis", NULL, NULL),
createStringConfig("dbfilename", NULL, MODIFIABLE_CONFIG, ALLOW_EMPTY_STRING, g_pserver->rdb_filename, CONFIG_DEFAULT_RDB_FILENAME, isValidDBfilename, NULL),
createStringConfig("db-s3-object", NULL, MODIFIABLE_CONFIG, EMPTY_STRING_IS_NULL, g_pserver->rdb_s3bucketpath, NULL, isValidS3Bucket, NULL),
createStringConfig("appendfilename", NULL, IMMUTABLE_CONFIG, ALLOW_EMPTY_STRING, g_pserver->aof_filename, "appendonly.aof", isValidAOFfilename, NULL),
createStringConfig("server_cpulist", NULL, IMMUTABLE_CONFIG, EMPTY_STRING_IS_NULL, g_pserver->server_cpulist, NULL, NULL, NULL),
createStringConfig("bio_cpulist", NULL, IMMUTABLE_CONFIG, EMPTY_STRING_IS_NULL, g_pserver->bio_cpulist, NULL, NULL, NULL),
@@ -2921,7 +2856,7 @@ standardConfig configs[] = {
createIntConfig("list-compress-depth", NULL, MODIFIABLE_CONFIG, 0, INT_MAX, g_pserver->list_compress_depth, 0, INTEGER_CONFIG, NULL, NULL),
createIntConfig("rdb-key-save-delay", NULL, MODIFIABLE_CONFIG, INT_MIN, INT_MAX, g_pserver->rdb_key_save_delay, 0, INTEGER_CONFIG, NULL, NULL),
createIntConfig("key-load-delay", NULL, MODIFIABLE_CONFIG, INT_MIN, INT_MAX, g_pserver->key_load_delay, 0, INTEGER_CONFIG, NULL, NULL),
createIntConfig("active-expire-effort", NULL, MODIFIABLE_CONFIG, 1, 10, g_pserver->active_expire_effort, 1, INTEGER_CONFIG, NULL, NULL), /* From 1 to 10. */
createIntConfig("active-expire-effort", NULL, MODIFIABLE_CONFIG, 1, 10, cserver.active_expire_effort, 1, INTEGER_CONFIG, NULL, NULL), /* From 1 to 10. */
createIntConfig("hz", NULL, MODIFIABLE_CONFIG, 0, INT_MAX, g_pserver->config_hz, CONFIG_DEFAULT_HZ, INTEGER_CONFIG, NULL, updateHZ),
createIntConfig("min-replicas-to-write", "min-slaves-to-write", MODIFIABLE_CONFIG, 0, INT_MAX, g_pserver->repl_min_slaves_to_write, 0, INTEGER_CONFIG, NULL, updateGoodSlaves),
createIntConfig("min-replicas-max-lag", "min-slaves-max-lag", MODIFIABLE_CONFIG, 0, INT_MAX, g_pserver->repl_min_slaves_max_lag, 10, INTEGER_CONFIG, NULL, updateGoodSlaves),
@@ -2932,7 +2867,6 @@ standardConfig configs[] = {
/* Unsigned int configs */
createUIntConfig("maxclients", NULL, MODIFIABLE_CONFIG, 1, UINT_MAX, g_pserver->maxclients, 10000, INTEGER_CONFIG, NULL, updateMaxclients),
createUIntConfig("loading-process-events-interval-keys", NULL, MODIFIABLE_CONFIG, 0, LONG_MAX, g_pserver->loading_process_events_interval_keys, 8192, MEMORY_CONFIG, NULL, NULL),
createUIntConfig("maxclients-reserved", NULL, MODIFIABLE_CONFIG, 0, 100, g_pserver->maxclientsReserved, 0, INTEGER_CONFIG, NULL, NULL),
/* Unsigned Long configs */
createULongConfig("active-defrag-max-scan-fields", NULL, MODIFIABLE_CONFIG, 1, LONG_MAX, cserver.active_defrag_max_scan_fields, 1000, INTEGER_CONFIG, NULL, NULL), /* Default: keys with more than 1000 fields will be processed separately */
@@ -2946,14 +2880,13 @@ standardConfig configs[] = {
createLongLongConfig("latency-monitor-threshold", NULL, MODIFIABLE_CONFIG, 0, LLONG_MAX, g_pserver->latency_monitor_threshold, 0, INTEGER_CONFIG, NULL, NULL),
createLongLongConfig("proto-max-bulk-len", NULL, MODIFIABLE_CONFIG, 1024*1024, LLONG_MAX, g_pserver->proto_max_bulk_len, 512ll*1024*1024, MEMORY_CONFIG, NULL, NULL), /* Bulk request max size */
createLongLongConfig("stream-node-max-entries", NULL, MODIFIABLE_CONFIG, 0, LLONG_MAX, g_pserver->stream_node_max_entries, 100, INTEGER_CONFIG, NULL, NULL),
createLongLongConfig("repl-backlog-size", NULL, MODIFIABLE_CONFIG, 1, LLONG_MAX, g_pserver->repl_backlog_config_size, 1024*1024, MEMORY_CONFIG, NULL, updateReplBacklogSize), /* Default: 1mb */
createLongLongConfig("repl-backlog-size", NULL, MODIFIABLE_CONFIG, 1, LLONG_MAX, g_pserver->repl_backlog_size, 1024*1024, MEMORY_CONFIG, NULL, updateReplBacklogSize), /* Default: 1mb */
createLongLongConfig("repl-backlog-disk-reserve", NULL, IMMUTABLE_CONFIG, 0, LLONG_MAX, cserver.repl_backlog_disk_size, 0, MEMORY_CONFIG, NULL, NULL),
createLongLongConfig("max-snapshot-slip", NULL, MODIFIABLE_CONFIG, 0, 5000, g_pserver->snapshot_slip, 400, 0, NULL, NULL),
createLongLongConfig("max-rand-count", NULL, MODIFIABLE_CONFIG, 0, LONG_MAX/2, g_pserver->rand_total_threshold, LONG_MAX/2, 0, NULL, NULL),
/* Unsigned Long Long configs */
createULongLongConfig("maxmemory", NULL, MODIFIABLE_CONFIG, 0, LLONG_MAX, g_pserver->maxmemory, 0, MEMORY_CONFIG, NULL, updateMaxmemory),
createULongLongConfig("maxstorage", NULL, MODIFIABLE_CONFIG, 0, LLONG_MAX, g_pserver->maxstorage, 0, MEMORY_CONFIG, NULL, updateFlashMaxmemory),
createULongLongConfig("maxstorage", NULL, MODIFIABLE_CONFIG, 0, LLONG_MAX, g_pserver->maxstorage, 0, MEMORY_CONFIG, NULL, NULL),
/* Size_t configs */
createSizeTConfig("hash-max-ziplist-entries", NULL, MODIFIABLE_CONFIG, 0, LONG_MAX, g_pserver->hash_max_ziplist_entries, 512, INTEGER_CONFIG, NULL, NULL),
@@ -2977,12 +2910,6 @@ standardConfig configs[] = {
createBoolConfig("allow-write-during-load", NULL, MODIFIABLE_CONFIG, g_pserver->fWriteDuringActiveLoad, 0, NULL, NULL),
createBoolConfig("force-backlog-disk-reserve", NULL, MODIFIABLE_CONFIG, cserver.force_backlog_disk, 0, NULL, NULL),
createBoolConfig("soft-shutdown", NULL, MODIFIABLE_CONFIG, g_pserver->config_soft_shutdown, 0, NULL, NULL),
createBoolConfig("flash-disable-key-cache", NULL, MODIFIABLE_CONFIG, g_pserver->flash_disable_key_cache, 0, NULL, NULL),
createSizeTConfig("semi-ordered-set-bucket-size", NULL, MODIFIABLE_CONFIG, 0, 1024, g_semiOrderedSetTargetBucketSize, 0, INTEGER_CONFIG, NULL, NULL),
createSDSConfig("availability-zone", NULL, MODIFIABLE_CONFIG, 0, g_pserver->sdsAvailabilityZone, "", NULL, NULL),
createIntConfig("overload-protect-percent", NULL, MODIFIABLE_CONFIG, 0, 200, g_pserver->overload_protect_threshold, 0, INTEGER_CONFIG, NULL, NULL),
createIntConfig("force-eviction-percent", NULL, MODIFIABLE_CONFIG, 0, 100, g_pserver->force_eviction_percent, 0, INTEGER_CONFIG, NULL, NULL),
createBoolConfig("enable-async-rehash", NULL, MODIFIABLE_CONFIG, g_pserver->enable_async_rehash, 1, NULL, NULL),
#ifdef USE_OPENSSL
createIntConfig("tls-port", NULL, MODIFIABLE_CONFIG, 0, 65535, g_pserver->tls_port, 0, INTEGER_CONFIG, NULL, updateTLSPort), /* TCP port. */
-5
View File
@@ -161,11 +161,6 @@ static void connSocketClose(connection *conn) {
return;
}
if (conn->fprint) {
zfree(conn->fprint);
conn->fprint = NULL;
}
zfree(conn);
}
-2
View File
@@ -51,7 +51,6 @@ typedef enum {
#define CONN_FLAG_WRITE_BARRIER (1<<1) /* Write barrier requested */
#define CONN_FLAG_READ_THREADSAFE (1<<2)
#define CONN_FLAG_WRITE_THREADSAFE (1<<3)
#define CONN_FLAG_AUDIT_LOGGING_REQUIRED (1<<4)
#define CONN_TYPE_SOCKET 1
#define CONN_TYPE_TLS 2
@@ -87,7 +86,6 @@ struct connection {
ConnectionCallbackFunc write_handler;
ConnectionCallbackFunc read_handler;
int fd;
char* fprint;
};
/* The connection module does not deal with listening and accepting sockets,
+208 -213
View File
@@ -55,8 +55,8 @@ struct dbBackup {
int expireIfNeeded(redisDb *db, robj *key, robj *o);
void slotToKeyUpdateKeyCore(const char *key, size_t keylen, int add);
std::unique_ptr<expireEntry> deserializeExpire(const char *str, size_t cch, size_t *poffset);
sds serializeStoredObjectAndExpire(robj_roptr o);
std::unique_ptr<expireEntry> deserializeExpire(sds key, const char *str, size_t cch, size_t *poffset);
sds serializeStoredObjectAndExpire(redisDbPersistentData *db, const char *key, robj_roptr o);
dictType dictChangeDescType {
dictSdsHash, /* hash function */
@@ -83,7 +83,6 @@ void updateExpire(redisDb *db, sds key, robj *valOld, robj *valNew)
serverAssert(db->FKeyExpires((const char*)key));
valNew->expire = std::move(valOld->expire);
valNew->SetFExpires(true);
valOld->SetFExpires(false);
return;
@@ -94,7 +93,7 @@ static void lookupKeyUpdateObj(robj *val, int flags)
/* Update the access time for the ageing algorithm.
* Don't do it if we have a saving child, as this will trigger
* a copy on write madness. */
if (!hasActiveChildProcessOrBGSave() && !(flags & LOOKUP_NOTOUCH))
if (!hasActiveChildProcess() && !(flags & LOOKUP_NOTOUCH))
{
if (g_pserver->maxmemory_policy & MAXMEMORY_FLAG_LFU) {
updateLFU(val);
@@ -282,8 +281,8 @@ robj *lookupKeyWriteOrReply(client *c, robj *key, robj *reply) {
return o;
}
bool dbAddCore(redisDb *db, sds key, robj *val, bool fUpdateMvcc, bool fAssumeNew = false, dict_iter *piterExisting = nullptr, bool fValExpires = false) {
serverAssert(fValExpires || !val->FExpires());
bool dbAddCore(redisDb *db, sds key, robj *val, bool fUpdateMvcc, bool fAssumeNew = false, dict_iter *piterExisting = nullptr) {
serverAssert(!val->FExpires());
sds copy = sdsdupshared(key);
uint64_t mvcc = getMvccTstamp();
@@ -1060,7 +1059,7 @@ void keysCommand(client *c) {
sds pattern = szFromObj(c->argv[1]);
const redisDbPersistentDataSnapshot *snapshot = nullptr;
if (!(c->flags & (CLIENT_MULTI | CLIENT_BLOCKED | CLIENT_DENY_BLOCKING)) && !(serverTL->in_eval || serverTL->in_exec))
if (!(c->flags & (CLIENT_MULTI | CLIENT_BLOCKED)))
snapshot = c->db->createSnapshot(c->mvccCheckpoint, true /* fOptional */);
if (snapshot != nullptr)
{
@@ -1225,7 +1224,7 @@ void scanGenericCommand(client *c, robj_roptr o, unsigned long cursor) {
}
}
if (o == nullptr && count >= 100 && !(serverTL->in_eval || serverTL->in_exec))
if (o == nullptr && count >= 100)
{
// Do an async version
if (c->asyncCommand(
@@ -1495,6 +1494,15 @@ void renameGenericCommand(client *c, int nx) {
incrRefCount(o);
std::unique_ptr<expireEntry> spexpire;
{ // scope pexpireOld since it will be invalid soon
std::unique_lock<fastlock> ul(g_expireLock);
expireEntry *pexpireOld = c->db->getExpire(c->argv[1]);
if (pexpireOld != nullptr)
spexpire = std::make_unique<expireEntry>(std::move(*pexpireOld));
}
if (lookupKeyWrite(c->db,c->argv[2]) != NULL) {
if (nx) {
decrRefCount(o);
@@ -1505,12 +1513,10 @@ void renameGenericCommand(client *c, int nx) {
* with the same name. */
dbDelete(c->db,c->argv[2]);
}
bool fExpires = o->FExpires();
long long whenT = o->expire.when();
dbDelete(c->db,c->argv[1]);
o->SetFExpires(fExpires);
dbAddCore(c->db,szFromObj(c->argv[2]),o,true /*fUpdateMvcc*/,true/*fAssumeNew*/,nullptr,true/*fValExpires*/);
serverAssert(whenT == o->expire.when()); // dbDelete and dbAdd must not modify the expire, just the FExpire bit
dbAdd(c->db,c->argv[2],o);
if (spexpire != nullptr)
setExpire(c,c->db,c->argv[2],std::move(*spexpire));
signalModifiedKey(c,c->db,c->argv[1]);
signalModifiedKey(c,c->db,c->argv[2]);
notifyKeyspaceEvent(NOTIFY_GENERIC,"rename_from",
@@ -1573,15 +1579,22 @@ void moveCommand(client *c) {
return;
}
std::unique_ptr<expireEntry> spexpire;
{ // scope pexpireOld
std::unique_lock<fastlock> ul(g_expireLock);
expireEntry *pexpireOld = c->db->getExpire(c->argv[1]);
if (pexpireOld != nullptr)
spexpire = std::make_unique<expireEntry>(std::move(*pexpireOld));
}
if (o->FExpires())
removeExpire(c->db,c->argv[1]);
serverAssert(!o->FExpires());
incrRefCount(o);
bool fExpire = o->FExpires();
long long whenT = o->expire.when();
dbDelete(src,c->argv[1]);
g_pserver->dirty++;
o->SetFExpires(fExpire);
dbAddCore(dst, szFromObj(c->argv[1]), o, true /*fUpdateMvcc*/, true /*fAssumeNew*/, nullptr, true /*fValExpires*/);
serverAssert(whenT == o->expire.when()); // add/delete must not modify the expire time
dbAdd(dst,c->argv[1],o);
if (spexpire != nullptr) setExpire(c,dst,c->argv[1],std::move(*spexpire));
signalModifiedKey(c,src,c->argv[1]);
signalModifiedKey(c,dst,c->argv[1]);
@@ -1649,7 +1662,7 @@ void copyCommand(client *c) {
addReply(c,shared.czero);
return;
}
expire = o->FExpires() ? &o->expire : nullptr;
expire = c->db->getExpire(key);
/* Return zero if the key already exists in the target DB.
* If REPLACE option is selected, delete newkey from targetDB. */
@@ -1724,9 +1737,6 @@ int dbSwapDatabases(int id1, int id2) {
id2 < 0 || id2 >= cserver.dbnum) return C_ERR;
if (id1 == id2) return C_OK;
std::swap(g_pserver->db[id1], g_pserver->db[id2]);
//swap db's id too, otherwise db does not match its id
std::swap(g_pserver->db[id1]->id, g_pserver->db[id2]->id);
/* Note that we don't swap blocking_keys,
* ready_keys and watched_keys, since we want clients to
@@ -1756,7 +1766,7 @@ int dbSwapDatabases(int id1, int id2) {
/* SWAPDB db1 db2 */
void swapdbCommand(client *c) {
int id1, id2, oriIdx;
int id1, id2;
/* Not allowed in cluster mode: we have just DB 0 there. */
if (g_pserver->cluster_enabled) {
@@ -1773,14 +1783,6 @@ void swapdbCommand(client *c) {
"invalid second DB index") != C_OK)
return;
// get client's original db's index
for (int idb=0; idb < cserver.dbnum; ++idb) {
if (g_pserver->db[idb]->id == c->db->id) {
oriIdx = idb;
break;
}
}
/* Swap... */
if (dbSwapDatabases(id1,id2) == C_ERR) {
addReplyError(c,"DB index is out of range");
@@ -1789,18 +1791,6 @@ void swapdbCommand(client *c) {
RedisModuleSwapDbInfo si = {REDISMODULE_SWAPDBINFO_VERSION,(int32_t)id1,(int32_t)id2};
moduleFireServerEvent(REDISMODULE_EVENT_SWAPDB,0,&si);
g_pserver->dirty++;
// set client's db to original db
c->db=g_pserver->db[oriIdx];
// Persist the databse index to dbid mapping into FLASH for later recovery.
if (g_pserver->m_pstorageFactory != nullptr && g_pserver->metadataDb != nullptr) {
std::string dbid_key = "db-" + std::to_string(id1);
g_pserver->metadataDb->insert(dbid_key.c_str(), dbid_key.length(), &g_pserver->db[id1]->id, sizeof(g_pserver->db[id1]->id), true);
dbid_key = "db-" + std::to_string(id2);
g_pserver->metadataDb->insert(dbid_key.c_str(), dbid_key.length(), &g_pserver->db[id2]->id, sizeof(g_pserver->db[id2]->id), true);
}
addReply(c,shared.ok);
}
}
@@ -1816,48 +1806,63 @@ int redisDbPersistentData::removeExpire(robj *key, dict_iter itr) {
/* An expire may only be removed if there is a corresponding entry in the
* main dict. Otherwise, the key will never be freed. */
serverAssertWithInfo(NULL,key,itr != nullptr);
std::unique_lock<fastlock> ul(g_expireLock);
robj *val = itr.val();
if (!val->FExpires())
return 0;
trackkey(key, true /* fUpdate */);
auto itrExpire = m_setexpire->find(itr.key());
serverAssert(itrExpire != m_setexpire->end());
m_setexpire->erase(itrExpire);
val->SetFExpires(false);
serverAssert(m_numexpires > 0);
m_numexpires--;
return 1;
}
int redisDbPersistentData::removeSubkeyExpire(robj *key, robj *subkey) {
auto de = find(szFromObj(key));
serverAssertWithInfo(NULL,key,de != nullptr);
std::unique_lock<fastlock> ul(g_expireLock);
robj *val = de.val();
if (!val->FExpires())
return 0;
if (!val->expire.FFat())
auto itr = m_setexpire->find(de.key());
serverAssert(itr != m_setexpire->end());
serverAssert(itr->key() == de.key());
if (!itr->FFat())
return 0;
int found = 0;
for (auto subitr : val->expire)
for (auto subitr : *itr)
{
if (subitr.subkey() == nullptr)
continue;
if (sdscmp((sds)subitr.subkey(), szFromObj(subkey)) == 0)
{
val->expire.erase(subitr);
itr->erase(subitr);
found = 1;
break;
}
}
if (val->expire.pfatentry()->size() == 0)
if (itr->pfatentry()->size() == 0)
this->removeExpire(key, de);
return found;
}
void redisDbPersistentData::resortExpire(expireEntry &e)
{
std::unique_lock<fastlock> ul(g_expireLock);
auto itr = m_setexpire->find(e.key());
expireEntry eT = std::move(e);
m_setexpire->erase(itr);
m_setexpire->insert(eT);
}
/* Set an expire to the specified key. If the expire is set in the context
* of an user calling a command 'c' is the client, otherwise 'c' is set
* to NULL. The 'when' parameter is the absolute unix time in milliseconds
@@ -1912,7 +1917,10 @@ void setExpire(client *c, redisDb *db, robj *key, expireEntry &&e)
if (kde.val()->FExpires())
removeExpire(db, key);
db->setExpire(kde.key(), std::move(e));
e.setKeyUnsafe(kde.key());
db->setExpire(std::move(e));
kde.val()->SetFExpires(true);
int writable_slave = listLength(g_pserver->masters) && g_pserver->repl_slave_ro == 0 && !g_pserver->fActiveReplica;
if (c && writable_slave && !(c->flags & CLIENT_MASTER))
@@ -1926,12 +1934,10 @@ expireEntry *redisDbPersistentDataSnapshot::getExpire(const char *key) {
if (expireSize() == 0)
return nullptr;
auto itr = find_cached_threadsafe(key);
if (itr == end())
auto itrExpire = m_setexpire->find(key);
if (itrExpire == m_setexpire->end())
return nullptr;
if (!itr.val()->FExpires())
return nullptr;
return &itr.val()->expire;
return itrExpire.operator->();
}
const expireEntry *redisDbPersistentDataSnapshot::getExpire(const char *key) const
@@ -2032,13 +2038,15 @@ int keyIsExpired(const redisDbPersistentDataSnapshot *db, robj *key) {
/* Don't expire anything while loading. It will be done later. */
if (g_pserver->loading) return 0;
std::unique_lock<fastlock> ul(g_expireLock);
const expireEntry *pexpire = db->getExpire(key);
mstime_t now;
long long when;
if (pexpire == nullptr) return 0; /* No expire for this key */
if (!pexpire->FGetPrimaryExpire(&when))
long long when = pexpire->FGetPrimaryExpire();
if (when == INVALID_EXPIRE)
return 0;
/* If we are in the context of a Lua script, we pretend that time is
@@ -2471,28 +2479,25 @@ void slotToKeyUpdateKeyCore(const char *key, size_t keylen, int add) {
serverAssert(GlobalLocksAcquired());
unsigned int hashslot = keyHashSlot(key,keylen);
unsigned char buf[64];
unsigned char *indexed = buf;
g_pserver->cluster->slots_keys_count[hashslot] += add ? 1 : -1;
if (g_pserver->m_pstorageFactory == nullptr) {
unsigned char buf[64];
unsigned char *indexed = buf;
if (keylen+2 > 64) indexed = (unsigned char*)zmalloc(keylen+2, MALLOC_SHARED);
indexed[0] = (hashslot >> 8) & 0xff;
indexed[1] = hashslot & 0xff;
memcpy(indexed+2,key,keylen);
int fModified = false;
if (add) {
fModified = raxInsert(g_pserver->cluster->slots_to_keys,indexed,keylen+2,NULL,NULL);
} else {
fModified = raxRemove(g_pserver->cluster->slots_to_keys,indexed,keylen+2,NULL);
}
// This assert is disabled when a snapshot depth is >0 because prepOverwriteForSnapshot will add in a tombstone,
// this prevents ensure from adding the key to the dictionary which means the caller isn't aware we're already tracking
// the key.
serverAssert(fModified || g_pserver->db[0]->snapshot_depth() > 0);
if (indexed != buf) zfree(indexed);
if (keylen+2 > 64) indexed = (unsigned char*)zmalloc(keylen+2, MALLOC_SHARED);
indexed[0] = (hashslot >> 8) & 0xff;
indexed[1] = hashslot & 0xff;
memcpy(indexed+2,key,keylen);
int fModified = false;
if (add) {
fModified = raxInsert(g_pserver->cluster->slots_to_keys,indexed,keylen+2,NULL,NULL);
} else {
fModified = raxRemove(g_pserver->cluster->slots_to_keys,indexed,keylen+2,NULL);
}
// This assert is disabled when a snapshot depth is >0 because prepOverwriteForSnapshot will add in a tombstone,
// this prevents ensure from adding the key to the dictionary which means the caller isn't aware we're already tracking
// the key.
serverAssert(fModified || g_pserver->db[0]->snapshot_depth() > 0);
if (indexed != buf) zfree(indexed);
}
void slotToKeyAdd(sds key) {
@@ -2528,67 +2533,47 @@ void slotToKeyFlush(int async) {
* New objects are returned to represent keys, it's up to the caller to
* decrement the reference count to release the keys names. */
unsigned int getKeysInSlot(unsigned int hashslot, robj **keys, unsigned int count) {
if (g_pserver->m_pstorageFactory != nullptr) {
int j = 0;
g_pserver->db[0]->getStorageCache()->enumerate_hashslot([&](const char *key, size_t cchKey, const void *, size_t )->bool {
keys[j++] = createStringObject(key, cchKey);
return --count;
}, hashslot);
return j;
} else {
raxIterator iter;
int j = 0;
unsigned char indexed[2];
raxIterator iter;
int j = 0;
unsigned char indexed[2];
indexed[0] = (hashslot >> 8) & 0xff;
indexed[1] = hashslot & 0xff;
raxStart(&iter,g_pserver->cluster->slots_to_keys);
raxSeek(&iter,">=",indexed,2);
while(count-- && raxNext(&iter)) {
if (iter.key[0] != indexed[0] || iter.key[1] != indexed[1]) break;
keys[j++] = createStringObject((char*)iter.key+2,iter.key_len-2);
}
raxStop(&iter);
return j;
indexed[0] = (hashslot >> 8) & 0xff;
indexed[1] = hashslot & 0xff;
raxStart(&iter,g_pserver->cluster->slots_to_keys);
raxSeek(&iter,">=",indexed,2);
while(count-- && raxNext(&iter)) {
if (iter.key[0] != indexed[0] || iter.key[1] != indexed[1]) break;
keys[j++] = createStringObject((char*)iter.key+2,iter.key_len-2);
}
raxStop(&iter);
return j;
}
/* Remove all the keys in the specified hash slot.
* The number of removed items is returned. */
unsigned int delKeysInSlot(unsigned int hashslot) {
serverAssert(GlobalLocksAcquired());
if (g_pserver->m_pstorageFactory != nullptr) {
int j = 0;
g_pserver->db[0]->getStorageCache()->enumerate_hashslot([&](const char *key, size_t cchKey, const void *, size_t )->bool {
robj *keyobj = createStringObject(key, cchKey);
dbDelete(g_pserver->db[0], keyobj);
decrRefCount(keyobj);
j++;
return true;
}, hashslot);
return j;
} else {
raxIterator iter;
int j = 0;
unsigned char indexed[2];
raxIterator iter;
int j = 0;
unsigned char indexed[2];
indexed[0] = (hashslot >> 8) & 0xff;
indexed[1] = hashslot & 0xff;
raxStart(&iter,g_pserver->cluster->slots_to_keys);
while(g_pserver->cluster->slots_keys_count[hashslot]) {
raxSeek(&iter,">=",indexed,2);
raxNext(&iter);
indexed[0] = (hashslot >> 8) & 0xff;
indexed[1] = hashslot & 0xff;
raxStart(&iter,g_pserver->cluster->slots_to_keys);
while(g_pserver->cluster->slots_keys_count[hashslot]) {
raxSeek(&iter,">=",indexed,2);
raxNext(&iter);
auto count = g_pserver->cluster->slots_keys_count[hashslot];
robj *key = createStringObject((char*)iter.key+2,iter.key_len-2);
dbDelete(g_pserver->db[0],key);
serverAssert(count > g_pserver->cluster->slots_keys_count[hashslot]); // we should have deleted something or we will be in an infinite loop
decrRefCount(key);
j++;
}
raxStop(&iter);
return j;
auto count = g_pserver->cluster->slots_keys_count[hashslot];
robj *key = createStringObject((char*)iter.key+2,iter.key_len-2);
dbDelete(g_pserver->db[0],key);
serverAssert(count > g_pserver->cluster->slots_keys_count[hashslot]); // we should have deleted something or we will be in an infinite loop
decrRefCount(key);
j++;
}
raxStop(&iter);
return j;
}
unsigned int countKeysInSlot(unsigned int hashslot) {
@@ -2600,6 +2585,7 @@ void redisDbPersistentData::initialize()
m_pdbSnapshot = nullptr;
m_pdict = dictCreate(&dbDictType,this);
m_pdictTombstone = dictCreate(&dbTombstoneDictType,this);
m_setexpire = new(MALLOC_LOCAL) expireset();
m_fAllChanged = 0;
m_fTrackingChanges = 0;
}
@@ -2621,20 +2607,10 @@ void clusterStorageLoadCallback(const char *rgchkey, size_t cch, void *)
slotToKeyUpdateKeyCore(rgchkey, cch, true /*add*/);
}
void moduleLoadCallback(const char * rgchKey, size_t, void *data) {
redisObjectStack keyobj;
initStaticStringObject(keyobj, const_cast<char *>(rgchKey));
moduleNotifyKeyspaceEvent(NOTIFY_LOADED, "loaded", &keyobj, *(int *)data);
}
void moduleClusterLoadCallback(const char * rgchKey, size_t cchKey, void *data) {
clusterStorageLoadCallback(rgchKey, cchKey, data);
moduleLoadCallback(rgchKey, cchKey, data);
}
void redisDb::initialize(int id)
{
redisDbPersistentData::initialize();
this->expireitr = setexpire()->end();
this->blocking_keys = dictCreate(&keylistDictType,NULL);
this->ready_keys = dictCreate(&objectKeyPointerValueDictType,NULL);
this->watched_keys = dictCreate(&keylistDictType,NULL);
@@ -2649,8 +2625,8 @@ void redisDb::storageProviderInitialize()
{
if (g_pserver->m_pstorageFactory != nullptr)
{
IStorageFactory::key_load_iterator itr = g_pserver->cluster_enabled ? moduleClusterLoadCallback : moduleLoadCallback;
this->setStorageProvider(StorageCache::create(g_pserver->m_pstorageFactory, id, itr, &id));
IStorageFactory::key_load_iterator itr = (g_pserver->cluster_enabled) ? clusterStorageLoadCallback : nullptr;
this->setStorageProvider(StorageCache::create(g_pserver->m_pstorageFactory, id, itr, nullptr));
}
}
@@ -2680,8 +2656,6 @@ bool redisDbPersistentData::insert(char *key, robj *o, bool fAssumeNew, dict_ite
serverAssert(dictFind(m_pdictTombstone, key) != nullptr);
}
#endif
if (o->FExpires())
++m_numexpires;
trackkey(key, false /* fUpdate */);
}
else
@@ -2703,6 +2677,11 @@ void redisDbPersistentData::prepOverwriteForSnapshot(char *key)
auto itr = m_pdbSnapshot->find_cached_threadsafe(key);
if (itr.key() != nullptr)
{
if (itr.val()->FExpires()) {
// Note: I'm sure we could handle this, but its too risky at the moment.
// There are known bugs doing this with expires
return;
}
sds keyNew = sdsdupshared(itr.key());
if (dictAdd(m_pdictTombstone, keyNew, (void*)dictHashKey(m_pdict, key)) != DICT_OK)
sdsfree(keyNew);
@@ -2724,7 +2703,7 @@ size_t redisDb::clear(bool fAsync, void(callback)(void*))
} else {
redisDbPersistentData::clear(callback);
}
expires_cursor = 0;
expireitr = setexpire()->end();
return removed;
}
@@ -2737,64 +2716,56 @@ void redisDbPersistentData::clear(void(callback)(void*))
m_cnewKeysPending = 0;
m_fAllChanged++;
}
delete m_setexpire;
m_setexpire = new (MALLOC_LOCAL) expireset();
if (m_spstorage != nullptr)
m_spstorage->clear(callback);
dictEmpty(m_pdictTombstone,callback);
// To avoid issues with async rehash we completly free the old dict and create a fresh one
dictRelease(m_pdict);
dictRelease(m_pdictTombstone);
m_pdict = dictCreate(&dbDictType, this);
m_pdictTombstone = dictCreate(&dbTombstoneDictType, this);
m_pdbSnapshot = nullptr;
m_numexpires = 0;
}
void redisDbPersistentData::setExpire(robj *key, robj *subkey, long long when)
{
/* Reuse the sds from the main dict in the expire dict */
std::unique_lock<fastlock> ul(g_expireLock);
dictEntry *kde = dictFind(m_pdict,ptrFromObj(key));
serverAssertWithInfo(NULL,key,kde != NULL);
trackkey(key, true /* fUpdate */);
robj *o = (robj*)dictGetVal(kde);
if (o->getrefcount(std::memory_order_relaxed) == OBJ_SHARED_REFCOUNT)
if (((robj*)dictGetVal(kde))->getrefcount(std::memory_order_relaxed) == OBJ_SHARED_REFCOUNT)
{
// shared objects cannot have the expire bit set, create a real object
dictSetVal(m_pdict, kde, dupStringObject(o));
o = (robj*)dictGetVal(kde);
dictSetVal(m_pdict, kde, dupStringObject((robj*)dictGetVal(kde)));
}
const char *szSubKey = (subkey != nullptr) ? szFromObj(subkey) : nullptr;
if (o->FExpires()) {
o->expire.update(szSubKey, when);
if (((robj*)dictGetVal(kde))->FExpires()) {
auto itr = m_setexpire->find((sds)dictGetKey(kde));
serverAssert(itr != m_setexpire->end());
expireEntry eNew(std::move(*itr));
eNew.update(szSubKey, when);
m_setexpire->erase(itr);
m_setexpire->insert(eNew);
}
else
{
expireEntry e(szSubKey, when);
o->expire = std::move(e);
o->SetFExpires(true);
++m_numexpires;
expireEntry e((sds)dictGetKey(kde), szSubKey, when);
((robj*)dictGetVal(kde))->SetFExpires(true);
m_setexpire->insert(e);
}
}
void redisDbPersistentData::setExpire(const char *key, expireEntry &&e)
void redisDbPersistentData::setExpire(expireEntry &&e)
{
trackkey(key, true /* fUpdate */);
auto itr = find(key);
if (!itr->FExpires())
m_numexpires++;
itr->expire = std::move(e);
itr->SetFExpires(true);
std::unique_lock<fastlock> ul(g_expireLock);
trackkey(e.key(), true /* fUpdate */);
m_setexpire->insert(e);
}
bool redisDb::FKeyExpires(const char *key)
{
auto itr = find(key);
if (itr == end())
return false;
return itr->FExpires();
std::unique_lock<fastlock> ul(g_expireLock);
return setexpireUnsafe()->find(key) != setexpire()->end();
}
void redisDbPersistentData::updateValue(dict_iter itr, robj *val)
@@ -2818,6 +2789,7 @@ void redisDbPersistentData::ensure(const char *sdsKey, dictEntry **pde)
serverAssert(m_refCount == 0);
if (m_pdbSnapshot == nullptr && g_pserver->m_pstorageFactory == nullptr)
return;
std::unique_lock<fastlock> ul(g_expireLock);
// First see if the key can be obtained from a snapshot
if (*pde == nullptr && m_pdbSnapshot != nullptr)
@@ -2839,11 +2811,7 @@ void redisDbPersistentData::ensure(const char *sdsKey, dictEntry **pde)
else
{
sds strT = serializeStoredObject(itr.val());
robj *objNew = deserializeStoredObject(strT, sdslen(strT));
if (itr->FExpires()) {
objNew->expire = itr->expire;
objNew->SetFExpires(true);
}
robj *objNew = deserializeStoredObject(this, sdsKey, strT, sdslen(strT));
sdsfree(strT);
dictAdd(m_pdict, keyNew, objNew);
serverAssert(objNew->getrefcount(std::memory_order_relaxed) == 1);
@@ -2873,19 +2841,25 @@ LNotFound:
std::unique_ptr<expireEntry> spexpire;
m_spstorage->retrieve((sds)sdsKey, [&](const char *, size_t, const void *data, size_t cb){
size_t offset = 0;
spexpire = deserializeExpire((const char*)data, cb, &offset);
o = deserializeStoredObject(reinterpret_cast<const char*>(data) + offset, cb - offset);
spexpire = deserializeExpire(sdsNewKey, (const char*)data, cb, &offset);
o = deserializeStoredObject(this, sdsNewKey, reinterpret_cast<const char*>(data) + offset, cb - offset);
serverAssert(o != nullptr);
});
if (o != nullptr)
{
dictAdd(m_pdict, sdsNewKey, o);
o->SetFExpires(spexpire != nullptr);
if (spexpire != nullptr) {
o->expire = std::move(*spexpire);
if (spexpire != nullptr)
{
auto itr = m_setexpire->find(sdsKey);
if (itr != m_setexpire->end())
m_setexpire->erase(itr);
m_setexpire->insert(std::move(*spexpire));
serverAssert(m_setexpire->find(sdsKey) != m_setexpire->end());
}
serverAssert(o->FExpires() == (m_setexpire->find(sdsKey) != m_setexpire->end()));
g_pserver->stat_storage_provider_read_hits++;
} else {
sdsfree(sdsNewKey);
@@ -2895,11 +2869,17 @@ LNotFound:
*pde = dictFind(m_pdict, sdsKey);
}
}
if (*pde != nullptr && dictGetVal(*pde) != nullptr)
{
robj *o = (robj*)dictGetVal(*pde);
serverAssert(o->FExpires() == (m_setexpire->find(sdsKey) != m_setexpire->end()));
}
}
void redisDbPersistentData::storeKey(sds key, robj *o, bool fOverwrite)
{
sds temp = serializeStoredObjectAndExpire(o);
sds temp = serializeStoredObjectAndExpire(this, key, o);
m_spstorage->insert(key, temp, sdslen(temp), fOverwrite);
sdsfree(temp);
}
@@ -2923,7 +2903,7 @@ void redisDbPersistentData::storeDatabase()
if (itr == nullptr)
return;
robj *o = itr.val();
sds temp = serializeStoredObjectAndExpire(o);
sds temp = serializeStoredObjectAndExpire(db, (const char*) itr.key(), o);
storage->insert((sds)key, temp, sdslen(temp), fUpdate);
sdsfree(temp);
}
@@ -2999,7 +2979,7 @@ void redisDbPersistentData::processChangesAsync(std::atomic<int> &pendingJobs)
while ((de = dictNext(di)) != nullptr)
{
robj *o = (robj*)dictGetVal(de);
sds temp = serializeStoredObjectAndExpire(o);
sds temp = serializeStoredObjectAndExpire(this, (const char*) dictGetKey(de), o);
veckeys.push_back((sds)dictGetKey(de));
veccbkeys.push_back(sdslen((sds)dictGetKey(de)));
vecvals.push_back(temp);
@@ -3014,16 +2994,8 @@ void redisDbPersistentData::processChangesAsync(std::atomic<int> &pendingJobs)
});
}
/* This function is to bulk insert directly to storage provider bypassing in memory, assumes rgKeys and rgVals are not sds strings */
void redisDbPersistentData::bulkDirectStorageInsert(char **rgKeys, size_t *rgcbKeys, char **rgVals, size_t *rgcbVals, size_t celem)
void redisDbPersistentData::bulkStorageInsert(char **rgKeys, size_t *rgcbKeys, char **rgVals, size_t *rgcbVals, size_t celem)
{
if (g_pserver->cluster_enabled) {
aeAcquireLock();
for (size_t i = 0; i < celem; i++) {
slotToKeyUpdateKeyCore(rgKeys[i], rgcbKeys[i], 1);
}
aeReleaseLock();
}
m_spstorage->bulkInsert(rgKeys, rgcbKeys, rgVals, rgcbVals, celem);
}
@@ -3063,7 +3035,9 @@ redisDbPersistentData::~redisDbPersistentData()
if (m_dictChanged)
dictRelease(m_dictChanged);
if (m_dictChangedStorageFlush)
dictRelease(m_dictChangedStorageFlush);
dictRelease(m_dictChangedStorageFlush);
delete m_setexpire;
}
dict_iter redisDbPersistentData::random()
@@ -3217,7 +3191,7 @@ sds serializeExpire(const expireEntry *pexpire)
return str;
}
std::unique_ptr<expireEntry> deserializeExpire(const char *str, size_t cch, size_t *poffset)
std::unique_ptr<expireEntry> deserializeExpire(sds key, const char *str, size_t cch, size_t *poffset)
{
unsigned celem;
if (cch < sizeof(unsigned))
@@ -3249,21 +3223,24 @@ std::unique_ptr<expireEntry> deserializeExpire(const char *str, size_t cch, size
offset += sizeof(long long);
if (spexpire == nullptr)
spexpire = std::make_unique<expireEntry>(subkey, when);
spexpire = std::make_unique<expireEntry>(key, subkey, when);
else
spexpire->update(subkey, when);
if (subkey)
sdsfree(subkey);
}
if (poffset != nullptr)
*poffset = offset;
*poffset = offset;
return spexpire;
}
sds serializeStoredObjectAndExpire(robj_roptr o)
sds serializeStoredObjectAndExpire(redisDbPersistentData *db, const char *key, robj_roptr o)
{
const expireEntry *pexpire = o->FExpires() ? &o->expire : nullptr;
auto itrExpire = db->setexpire()->find(key);
const expireEntry *pexpire = nullptr;
if (itrExpire != db->setexpire()->end())
pexpire = &(*itrExpire);
sds str = serializeExpire(pexpire);
str = serializeStoredObject(o, str);
@@ -3280,7 +3257,7 @@ int dbnumFromDb(redisDb *db)
serverPanic("invalid database pointer");
}
void redisDbPersistentData::prefetchKeysAsync(client *c, parsed_command &command)
bool redisDbPersistentData::prefetchKeysAsync(client *c, parsed_command &command, bool fExecOK)
{
if (m_spstorage == nullptr) {
#if defined(__x86_64__) || defined(__i386__)
@@ -3292,7 +3269,7 @@ void redisDbPersistentData::prefetchKeysAsync(client *c, parsed_command &command
const char *cmd = szFromObj(command.argv[0]);
if (!strcasecmp(cmd, "set") || !strcasecmp(cmd, "get")) {
if (c->db->m_spdbSnapshotHOLDER != nullptr)
return; // this is dangerous enough without a snapshot around
return false; // this is dangerous enough without a snapshot around
auto h = dictSdsHash(szFromObj(command.argv[1]));
for (int iht = 0; iht < 2; ++iht) {
auto hT = h & c->db->m_pdict->ht[iht].sizemask;
@@ -3312,7 +3289,7 @@ void redisDbPersistentData::prefetchKeysAsync(client *c, parsed_command &command
}
}
#endif
return;
return false;
}
AeLocker lock;
@@ -3322,10 +3299,10 @@ void redisDbPersistentData::prefetchKeysAsync(client *c, parsed_command &command
getKeysResult result = GETKEYS_RESULT_INIT;
auto cmd = lookupCommand(szFromObj(command.argv[0]));
if (cmd == nullptr)
return; // Bad command? It's not for us to judge, just bail
return false; // Bad command? It's not for us to judge, just bail
if (command.argc < std::abs(cmd->arity))
return; // Invalid number of args
return false; // Invalid number of args
int numkeys = getKeysFromCommand(cmd, command.argv, command.argc, &result);
for (int ikey = 0; ikey < numkeys; ++ikey)
@@ -3346,8 +3323,8 @@ void redisDbPersistentData::prefetchKeysAsync(client *c, parsed_command &command
robj *o = nullptr;
m_spstorage->retrieve((sds)szFromObj(objKey), [&](const char *, size_t, const void *data, size_t cb){
size_t offset = 0;
spexpire = deserializeExpire((const char*)data, cb, &offset);
o = deserializeStoredObject(reinterpret_cast<const char*>(data) + offset, cb - offset);
spexpire = deserializeExpire(sharedKey, (const char*)data, cb, &offset);
o = deserializeStoredObject(this, sharedKey, reinterpret_cast<const char*>(data) + offset, cb - offset);
serverAssert(o != nullptr);
});
@@ -3358,6 +3335,7 @@ void redisDbPersistentData::prefetchKeysAsync(client *c, parsed_command &command
}
}
bool fNoInsert = false;
if (!vecInserts.empty()) {
lock.arm(c);
for (auto &tuple : vecInserts)
@@ -3373,18 +3351,28 @@ void redisDbPersistentData::prefetchKeysAsync(client *c, parsed_command &command
// While unlocked this was already ensured
decrRefCount(o);
sdsfree(sharedKey);
fNoInsert = true;
}
else
{
if (spexpire != nullptr) {
if (spexpire->when() < mstime()) {
fNoInsert = true;
break;
}
}
dictAdd(m_pdict, sharedKey, o);
if (spexpire != nullptr)
o->expire = std::move(*spexpire);
o->SetFExpires(spexpire != nullptr);
if (spexpire != nullptr)
{
auto itr = m_setexpire->find(sharedKey);
if (itr != m_setexpire->end())
m_setexpire->erase(itr);
m_setexpire->insert(std::move(*spexpire));
serverAssert(m_setexpire->find(sharedKey) != m_setexpire->end());
}
serverAssert(o->FExpires() == (m_setexpire->find(sharedKey) != m_setexpire->end()));
}
}
else
@@ -3396,5 +3384,12 @@ void redisDbPersistentData::prefetchKeysAsync(client *c, parsed_command &command
lock.disarm();
}
return;
}
if (fExecOK && !fNoInsert && cmd->proc == getCommand && !vecInserts.empty()) {
robj *o = std::get<1>(vecInserts[0]);
if (o != nullptr) {
addReplyBulk(c, o);
return true;
}
}
return false;
}
+34 -90
View File
@@ -79,7 +79,6 @@ void printCrashReport(void);
void bugReportEnd(int killViaSignal, int sig);
void logStackTrace(void *eip, int uplevel);
void getTempFileName(char tmpfile[], int tmpfileNum);
bool initializeStorageProvider(const char **err);
/* ================================= Debugging ============================== */
@@ -147,10 +146,11 @@ void mixStringObjectDigest(unsigned char *digest, robj_roptr o) {
* Note that this function does not reset the initial 'digest' passed, it
* will continue mixing this object digest to anything that was already
* present. */
void xorObjectDigest(unsigned char *digest, robj_roptr o) {
void xorObjectDigest(redisDb *db, robj_roptr keyobj, unsigned char *digest, robj_roptr o) {
uint32_t aux = htonl(o->type);
mixDigest(digest,&aux,sizeof(aux));
const expireEntry *pexpire = o->FExpires() ? &o->expire : nullptr;
std::unique_lock<fastlock> ul(g_expireLock);
expireEntry *pexpire = db->getExpire(keyobj);
long long expiretime = INVALID_EXPIRE;
char buf[128];
@@ -309,7 +309,7 @@ void computeDatasetDigest(unsigned char *final) {
mixDigest(final,&aux,sizeof(aux));
/* Iterate this DB writing every entry */
db->iterate_threadsafe([final](const char *key, robj_roptr o)->bool {
db->iterate_threadsafe([final, db](const char *key, robj_roptr o)->bool {
unsigned char digest[20];
robj *keyobj;
@@ -318,7 +318,7 @@ void computeDatasetDigest(unsigned char *final) {
mixDigest(digest,key,sdslen(key));
xorObjectDigest(digest,o);
xorObjectDigest(db,keyobj,digest,o);
/* We can finally xor the key-val digest to the final digest */
xorDigest(final,digest,20);
@@ -341,10 +341,10 @@ void mallctl_int(client *c, robj **argv, int argc) {
}
size_t sz = sizeof(old);
while (sz > 0) {
if ((ret=mallctl(szFromObj(argv[0]), &old, &sz, argc > 1? &val: NULL, argc > 1?sz: 0))) {
if ((ret=je_mallctl(szFromObj(argv[0]), &old, &sz, argc > 1? &val: NULL, argc > 1?sz: 0))) {
if (ret == EPERM && argc > 1) {
/* if this option is write only, try just writing to it. */
if (!(ret=mallctl(szFromObj(argv[0]), NULL, 0, &val, sz))) {
if (!(ret=je_mallctl(szFromObj(argv[0]), NULL, 0, &val, sz))) {
addReply(c, shared.ok);
return;
}
@@ -375,7 +375,7 @@ void mallctl_string(client *c, robj **argv, int argc) {
char *old;
size_t sz = sizeof(old);
/* for strings, it seems we need to first get the old value, before overriding it. */
if ((rret=mallctl(szFromObj(argv[0]), &old, &sz, NULL, 0))) {
if ((rret=je_mallctl(szFromObj(argv[0]), &old, &sz, NULL, 0))) {
/* return error unless this option is write only. */
if (!(rret == EPERM && argc > 1)) {
addReplyErrorFormat(c,"%s", strerror(rret));
@@ -387,7 +387,7 @@ void mallctl_string(client *c, robj **argv, int argc) {
char **valref = &val;
if ((!strcmp(val,"VOID")))
valref = NULL, sz = 0;
wret = mallctl(szFromObj(argv[0]), NULL, 0, valref, sz);
wret = je_mallctl(szFromObj(argv[0]), NULL, 0, valref, sz);
}
if (!rret)
addReplyBulkCString(c, old);
@@ -536,75 +536,30 @@ NULL
return;
}
}
if (g_pserver->m_pstorageFactory) {
protectClient(c);
for (int idb = 0; idb < cserver.dbnum; ++idb) {
if (g_pserver->db[idb]->processChanges(false))
g_pserver->db[idb]->commitChanges();
g_pserver->db[idb]->storageProviderDelete();
}
delete g_pserver->metadataDb;
if (flush) emptyDb(-1,EMPTYDB_NO_FLAGS,NULL);
delete g_pserver->m_pstorageFactory;
const char *err;
if (!initializeStorageProvider(&err))
{
serverLog(LL_WARNING, "Failed to initialize storage provider: %s",err);
exit(EXIT_FAILURE);
}
g_pserver->metadataDb = g_pserver->m_pstorageFactory->createMetadataDb();
for (int idb = 0; idb < cserver.dbnum; ++idb)
{
int dbid = idb;
std::string dbid_key = "db-" + std::to_string(idb);
g_pserver->metadataDb->retrieve(dbid_key.c_str(), dbid_key.length(), [&](const char *, size_t, const void *data, size_t){
dbid = *(int*)data;
});
delete g_pserver->db[idb];
g_pserver->db[idb] = new (MALLOC_LOCAL) redisDb();
g_pserver->db[idb]->initialize(dbid);
}
moduleFireServerEvent(REDISMODULE_EVENT_LOADING, REDISMODULE_SUBEVENT_LOADING_FLASH_START, NULL);
for (int idb = 0; idb < cserver.dbnum; ++idb)
{
g_pserver->db[idb]->storageProviderInitialize();
g_pserver->db[idb]->trackChanges(false);
}
moduleFireServerEvent(REDISMODULE_EVENT_LOADING, REDISMODULE_SUBEVENT_LOADING_ENDED, NULL);
unprotectClient(c);
} else {
/* The default behavior is to save the RDB file before loading
* it back. */
if (save) {
rdbSaveInfo rsi, *rsiptr;
rsiptr = rdbPopulateSaveInfo(&rsi);
if (rdbSave(nullptr, rsiptr) != C_OK) {
addReply(c,shared.err);
return;
}
}
/* The default behavior is to remove the current dataset from
* memory before loading the RDB file, however when MERGE is
* used together with NOFLUSH, we are able to merge two datasets. */
if (flush) emptyDb(-1,EMPTYDB_NO_FLAGS,NULL);
protectClient(c);
int ret = rdbLoadFile(g_pserver->rdb_filename,NULL,flags);
unprotectClient(c);
if (ret != C_OK) {
addReplyError(c,"Error trying to load the RDB dump");
/* The default behavior is to save the RDB file before loading
* it back. */
if (save) {
rdbSaveInfo rsi, *rsiptr;
rsiptr = rdbPopulateSaveInfo(&rsi);
if (rdbSave(nullptr, rsiptr) != C_OK) {
addReply(c,shared.err);
return;
}
}
/* The default behavior is to remove the current dataset from
* memory before loading the RDB file, however when MERGE is
* used together with NOFLUSH, we are able to merge two datasets. */
if (flush) emptyDb(-1,EMPTYDB_NO_FLAGS,NULL);
protectClient(c);
int ret = rdbLoadFile(g_pserver->rdb_filename,NULL,flags);
unprotectClient(c);
if (ret != C_OK) {
addReplyError(c,"Error trying to load the RDB dump");
return;
}
serverLog(LL_WARNING,"DB reloaded by DEBUG RELOAD");
addReply(c,shared.ok);
} else if (!strcasecmp(szFromObj(c->argv[1]),"loadaof")) {
@@ -761,7 +716,7 @@ NULL
* work on logically expired keys */
auto itr = c->db->find(c->argv[j]);
robj* o = (robj*)(itr == NULL ? NULL : itr.val());
if (o) xorObjectDigest(digest,o);
if (o) xorObjectDigest(c->db,c->argv[j],digest,o);
sds d = sdsempty();
for (int i = 0; i < 20; i++) d = sdscatprintf(d, "%02x",digest[i]);
@@ -888,6 +843,10 @@ NULL
g_pserver->db[dbid]->getStats(buf,sizeof(buf));
stats = sdscat(stats,buf);
stats = sdscatprintf(stats,"[Expires set]\n");
g_pserver->db[dbid]->getExpireStats(buf, sizeof(buf));
stats = sdscat(stats, buf);
addReplyVerbatim(c,stats,sdslen(stats),"txt");
sdsfree(stats);
} else if (!strcasecmp(szFromObj(c->argv[1]),"htstats-key") && c->argc == 3) {
@@ -978,21 +937,6 @@ NULL
mallctl_string(c, c->argv+2, c->argc-2);
return;
#endif
} else if(!strcasecmp(szFromObj(c->argv[1]),"flush-storage") && c->argc == 2) {
if (g_pserver->m_pstorageFactory != nullptr) {
for (int i = 0; i < cserver.dbnum; i++) {
g_pserver->db[i]->getStorageCache()->flush();
}
addReply(c,shared.ok);
} else {
addReplyError(c, "Can't flush storage if no storage provider is set");
}
} else if (!strcasecmp(szFromObj(c->argv[1]),"get-storage-usage") && c->argc == 2) {
if (g_pserver->m_pstorageFactory != nullptr) {
addReplyLongLong(c, g_pserver->m_pstorageFactory->totalDiskspaceUsed());
} else {
addReplyLongLong(c, 0);
}
} else {
addReplySubcommandSyntaxError(c);
return;
+24 -1
View File
@@ -47,6 +47,7 @@ extern "C" int je_get_defrag_hint(void* ptr);
/* forward declarations*/
void defragDictBucketCallback(void *privdata, dictEntry **bucketref);
dictEntry* replaceSatelliteDictKeyPtrAndOrDefragDictEntry(dict *d, sds oldkey, sds newkey, uint64_t hash, long *defragged);
bool replaceSatelliteOSetKeyPtr(expireset &set, sds oldkey, sds newkey);
/* Defrag helper for generic allocations.
*
@@ -424,6 +425,20 @@ dictEntry* replaceSatelliteDictKeyPtrAndOrDefragDictEntry(dict *d, sds oldkey, s
return NULL;
}
bool replaceSatelliteOSetKeyPtr(expireset &set, sds oldkey, sds newkey) {
auto itr = set.find(oldkey);
if (itr != set.end())
{
expireEntry eNew(std::move(*itr));
eNew.setKeyUnsafe(newkey);
set.erase(itr);
set.insert(eNew);
serverAssert(set.find(newkey) != set.end());
return true;
}
return false;
}
long activeDefragQuickListNode(quicklist *ql, quicklistNode **node_ref) {
quicklistNode *newnode, *node = *node_ref;
long defragged = 0;
@@ -836,6 +851,7 @@ long defragModule(redisDb *db, dictEntry *kde) {
* all the various pointers it has. Returns a stat of how many pointers were
* moved. */
long defragKey(redisDb *db, dictEntry *de) {
std::unique_lock<fastlock> ul(g_expireLock);
sds keysds = (sds)dictGetKey(de);
robj *newob, *ob;
unsigned char *newzl;
@@ -846,8 +862,15 @@ long defragKey(redisDb *db, dictEntry *de) {
/* Try to defrag the key name. */
newsds = activeDefragSds(keysds);
if (newsds) {
if (newsds)
{
defragged++, de->key = newsds;
if (!db->setexpire()->empty()) {
bool fReplaced = replaceSatelliteOSetKeyPtr(*const_cast<expireset*>(db->setexpire()), keysds, newsds);
serverAssert(fReplaced == ob->FExpires());
} else {
serverAssert(!ob->FExpires());
}
}
if ((newob = activeDefragStringOb(ob, &defragged))) {
+1 -1
View File
@@ -1577,7 +1577,7 @@ char *stringFromLongLong(long long value) {
int len;
char *s;
len = snprintf(buf,sizeof(buf),"%lld",value);
len = sprintf(buf,"%lld",value);
s = zmalloc(len+1);
memcpy(s, buf, len);
s[len] = '\0';
+3 -3
View File
@@ -112,15 +112,15 @@ int endianconvTest(int argc, char *argv[], int accurate) {
UNUSED(argv);
UNUSED(accurate);
snprintf(buf,sizeof(buf),"ciaoroma");
sprintf(buf,"ciaoroma");
memrev16(buf);
printf("%s\n", buf);
snprintf(buf,sizeof(buf),"ciaoroma");
sprintf(buf,"ciaoroma");
memrev32(buf);
printf("%s\n", buf);
snprintf(buf,sizeof(buf),"ciaoroma");
sprintf(buf,"ciaoroma");
memrev64(buf);
printf("%s\n", buf);
+94 -159
View File
@@ -100,36 +100,6 @@ unsigned long long estimateObjectIdleTime(robj_roptr o) {
}
}
unsigned long long getIdle(robj *obj, const expireEntry *e) {
unsigned long long idle;
/* Calculate the idle time according to the policy. This is called
* idle just because the code initially handled LRU, but is in fact
* just a score where an higher score means better candidate. */
if (g_pserver->maxmemory_policy & MAXMEMORY_FLAG_LRU) {
idle = (obj != nullptr) ? estimateObjectIdleTime(obj) : 0;
} else if (g_pserver->maxmemory_policy & MAXMEMORY_FLAG_LFU) {
/* When we use an LRU policy, we sort the keys by idle time
* so that we expire keys starting from greater idle time.
* However when the policy is an LFU one, we have a frequency
* estimation, and we want to evict keys with lower frequency
* first. So inside the pool we put objects using the inverted
* frequency subtracting the actual frequency to the maximum
* frequency of 255. */
idle = 255-LFUDecrAndReturn(obj);
} else if (g_pserver->maxmemory_policy == MAXMEMORY_VOLATILE_TTL) {
/* In this case the sooner the expire the better. */
if (e != nullptr)
idle = ULLONG_MAX - e->when();
else
idle = 0;
} else if (g_pserver->maxmemory_policy & MAXMEMORY_FLAG_ALLKEYS) {
idle = ULLONG_MAX;
} else {
serverPanic("Unknown eviction policy in storage eviction");
}
return idle;
}
/* LRU approximation algorithm
*
* Redis uses an approximation of the LRU algorithm that runs in constant
@@ -167,7 +137,28 @@ void evictionPoolAlloc(void) {
void processEvictionCandidate(int dbid, sds key, robj *o, const expireEntry *e, struct evictionPoolEntry *pool)
{
unsigned long long idle = getIdle(o,e);
unsigned long long idle;
/* Calculate the idle time according to the policy. This is called
* idle just because the code initially handled LRU, but is in fact
* just a score where an higher score means better candidate. */
if (g_pserver->maxmemory_policy & MAXMEMORY_FLAG_LRU) {
idle = (o != nullptr) ? estimateObjectIdleTime(o) : 0;
} else if (g_pserver->maxmemory_policy & MAXMEMORY_FLAG_LFU) {
/* When we use an LRU policy, we sort the keys by idle time
* so that we expire keys starting from greater idle time.
* However when the policy is an LFU one, we have a frequency
* estimation, and we want to evict keys with lower frequency
* first. So inside the pool we put objects using the inverted
* frequency subtracting the actual frequency to the maximum
* frequency of 255. */
idle = 255-LFUDecrAndReturn(o);
} else if (g_pserver->maxmemory_policy == MAXMEMORY_VOLATILE_TTL) {
/* In this case the sooner the expire the better. */
idle = ULLONG_MAX - e->when();
} else {
serverPanic("Unknown eviction policy in evictionPoolPopulate()");
}
/* Insert the element inside the pool.
* First, find the first empty bucket or the first populated
@@ -231,23 +222,52 @@ void processEvictionCandidate(int dbid, sds key, robj *o, const expireEntry *e,
* idle time are on the left, and keys with the higher idle time on the
* right. */
int evictionPoolPopulate(int dbid, redisDb *db, bool fVolatile, struct evictionPoolEntry *pool)
struct visitFunctor
{
int returnCount = 0;
dictEntry **samples = (dictEntry**)alloca(g_pserver->maxmemory_samples * sizeof(dictEntry*));
int count = dictGetSomeKeys(db->dictUnsafeKeyOnly(),samples,g_pserver->maxmemory_samples);
for (int j = 0; j < count; j++) {
robj *o = (robj*)dictGetVal(samples[j]);
// If the object is in second tier storage we don't need to evict it (since it already is)
if (o != nullptr)
int dbid;
dict *dbdict;
struct evictionPoolEntry *pool;
int count = 0;
int tries = 0;
bool operator()(const expireEntry &e)
{
dictEntry *de = dictFind(dbdict, e.key());
if (de != nullptr)
{
if (!fVolatile || o->FExpires()) {
processEvictionCandidate(dbid, (sds)dictGetKey(samples[j]), o, &o->expire, pool);
processEvictionCandidate(dbid, (sds)dictGetKey(de), (robj*)dictGetVal(de), &e, pool);
++count;
}
++tries;
return tries < g_pserver->maxmemory_samples;
}
};
int evictionPoolPopulate(int dbid, redisDb *db, expireset *setexpire, struct evictionPoolEntry *pool)
{
if (setexpire != nullptr)
{
std::unique_lock<fastlock> ul(g_expireLock);
visitFunctor visitor { dbid, db->dictUnsafeKeyOnly(), pool, 0 };
setexpire->random_visit(visitor);
return visitor.count;
}
else
{
int returnCount = 0;
dictEntry **samples = (dictEntry**)alloca(g_pserver->maxmemory_samples * sizeof(dictEntry*));
int count = dictGetSomeKeys(db->dictUnsafeKeyOnly(),samples,g_pserver->maxmemory_samples);
for (int j = 0; j < count; j++) {
robj *o = (robj*)dictGetVal(samples[j]);
// If the object is in second tier storage we don't need to evict it (since it alrady is)
if (o != nullptr)
{
processEvictionCandidate(dbid, (sds)dictGetKey(samples[j]), o, nullptr, pool);
++returnCount;
}
}
return returnCount;
}
return returnCount;
return 0;
}
/* ----------------------------------------------------------------------------
@@ -360,7 +380,7 @@ size_t freeMemoryGetNotCountedMemory(void) {
/* also don't count the replication backlog memory
* that's where the replication clients get their memory from */
overhead += g_pserver->repl_backlog_size - g_pserver->repl_backlog_config_size;
overhead += g_pserver->repl_backlog_size;
if (g_pserver->aof_state != AOF_OFF) {
overhead += sdsalloc(g_pserver->aof_buf)+aofRewriteBufferSize();
@@ -391,13 +411,8 @@ size_t freeMemoryGetNotCountedMemory(void) {
* memory currently used. May be > 1 if we are over the memory
* limit.
* (Populated both for C_ERR and C_OK)
*
* 'reason' the reason why the memory limit was exceeded
* EVICT_REASON_USER: reported user memory exceeded maxmemory
* EVICT_REASON_SYS: available system memory under configurable threshold
* (Populated when C_ERR is returned)
*/
int getMaxmemoryState(size_t *total, size_t *logical, size_t *tofree, float *level, EvictReason *reason, bool fQuickCycle, bool fPreSnapshot) {
int getMaxmemoryState(size_t *total, size_t *logical, size_t *tofree, float *level, bool fQuickCycle, bool fPreSnapshot) {
size_t mem_reported, mem_used, mem_tofree;
/* Check if we are over the memory usage limit. If we are not, no need
@@ -406,22 +421,10 @@ int getMaxmemoryState(size_t *total, size_t *logical, size_t *tofree, float *lev
if (total) *total = mem_reported;
size_t maxmemory = g_pserver->maxmemory;
if (fPreSnapshot)
maxmemory = static_cast<size_t>(maxmemory*0.9); // derate memory by 10% since we won't be able to free during snapshot
if (g_pserver->FRdbSaveInProgress() && !cserver.fForkBgSave)
maxmemory = static_cast<size_t>(maxmemory * 0.9); // derate memory by 10% since we won't be able to free during snapshot
if (g_pserver->FRdbSaveInProgress())
maxmemory = static_cast<size_t>(maxmemory*1.2);
/* If available system memory is below a certain threshold, force eviction */
long long sys_available_mem_buffer = 0;
if (g_pserver->force_eviction_percent && g_pserver->cron_malloc_stats.sys_total) {
float available_mem_ratio = (float)(100 - g_pserver->force_eviction_percent)/100;
size_t min_available_mem = static_cast<size_t>(g_pserver->cron_malloc_stats.sys_total * available_mem_ratio);
sys_available_mem_buffer = static_cast<long>(g_pserver->cron_malloc_stats.sys_available - min_available_mem);
if (sys_available_mem_buffer < 0) {
long long mem_threshold = mem_reported + sys_available_mem_buffer;
maxmemory = ((long long)maxmemory < mem_threshold) ? maxmemory : static_cast<size_t>(mem_threshold);
}
}
/* We may return ASAP if there is no need to compute the level. */
int return_ok_asap = !maxmemory || mem_reported <= maxmemory;
if (return_ok_asap && !level) return C_OK;
@@ -432,12 +435,6 @@ int getMaxmemoryState(size_t *total, size_t *logical, size_t *tofree, float *lev
size_t overhead = freeMemoryGetNotCountedMemory();
mem_used = (mem_used > overhead) ? mem_used-overhead : 0;
/* If system available memory is too low, we want to force evictions no matter
* what so we also offset the overhead from maxmemory. */
if (sys_available_mem_buffer < 0) {
maxmemory = (maxmemory > overhead) ? maxmemory-overhead : 0;
}
/* Compute the ratio of memory usage. */
if (level) {
if (!maxmemory) {
@@ -462,8 +459,6 @@ int getMaxmemoryState(size_t *total, size_t *logical, size_t *tofree, float *lev
if (logical) *logical = mem_used;
if (tofree) *tofree = mem_tofree;
if (reason) *reason = sys_available_mem_buffer < 0 ? EvictReason::System : EvictReason::User;
return C_ERR;
}
@@ -488,7 +483,6 @@ public:
for (auto de : pair.second) {
dictFreeUnlinkedEntry(pair.first, de);
}
dictRelease(pair.first);
}
aeReleaseLock();
--s_clazyFreesInProgress;
@@ -519,7 +513,6 @@ public:
);
if (itr == vecdictvecde.end() || itr->first != d) {
itr = vecdictvecde.insert(itr, std::make_pair(d, std::vector<dictEntry*>()));
__atomic_fetch_add(&d->refcount, 1, __ATOMIC_ACQ_REL);
}
serverAssert(itr->first == d);
itr->second.push_back(de);
@@ -559,7 +552,7 @@ static int evictionTimeProc(
UNUSED(clientData);
serverAssert(GlobalLocksAcquired());
if (performEvictions((bool)clientData) == EVICT_RUNNING) return 0; /* keep evicting */
if (performEvictions(false) == EVICT_RUNNING) return 0; /* keep evicting */
/* For EVICT_OK - things are good, no need to keep evicting.
* For EVICT_FAIL - there is nothing left to evict. */
@@ -609,37 +602,6 @@ static unsigned long evictionTimeLimitUs() {
return ULONG_MAX; /* No limit to eviction time */
}
void evict(redisDb *db, robj *keyobj) {
mstime_t eviction_latency;
propagateExpire(db,keyobj,g_pserver->lazyfree_lazy_eviction);
/* We compute the amount of memory freed by db*Delete() alone.
* It is possible that actually the memory needed to propagate
* the DEL in AOF and replication link is greater than the one
* we are freeing removing the key, but we can't account for
* that otherwise we would never exit the loop.
*
* AOF and Output buffer memory will be freed eventually so
* we only care about memory used by the key space. */
latencyStartMonitor(eviction_latency);
if (g_pserver->lazyfree_lazy_eviction)
dbAsyncDelete(db,keyobj);
else
dbSyncDelete(db,keyobj);
latencyEndMonitor(eviction_latency);
latencyAddSampleIfNeeded("eviction-del",eviction_latency);
signalModifiedKey(NULL,db,keyobj);
notifyKeyspaceEvent(NOTIFY_EVICTED, "evicted",
keyobj, db->id);
decrRefCount(keyobj);
}
static void updateSysAvailableMemory() {
if (g_pserver->force_eviction_percent) {
g_pserver->cron_malloc_stats.sys_available = getMemAvailable();
}
}
/* Check that memory usage is within the current "maxmemory" limit. If over
* "maxmemory", attempt to free memory by evicting data (if it's safe to do so).
*
@@ -671,17 +633,16 @@ int performEvictions(bool fPreSnapshot) {
int keys_freed = 0;
size_t mem_reported, mem_tofree;
long long mem_freed; /* May be negative */
mstime_t latency;
mstime_t latency, eviction_latency;
long long delta;
int slaves = listLength(g_pserver->slaves);
const bool fEvictToStorage = !cserver.delete_on_evict && g_pserver->db[0]->FStorageProvider();
int result = EVICT_FAIL;
int ckeysFailed = 0;
EvictReason evictReason;
std::unique_ptr<FreeMemoryLazyFree> splazy = std::make_unique<FreeMemoryLazyFree>();
if (getMaxmemoryState(&mem_reported,NULL,&mem_tofree,NULL,&evictReason,false,fPreSnapshot) == C_OK)
if (getMaxmemoryState(&mem_reported,NULL,&mem_tofree,NULL,false,fPreSnapshot) == C_OK)
return EVICT_OK;
if (g_pserver->maxmemory_policy == MAXMEMORY_NO_EVICTION)
@@ -696,43 +657,6 @@ int performEvictions(bool fPreSnapshot) {
monotime evictionTimer;
elapsedStart(&evictionTimer);
if (g_pserver->maxstorage && g_pserver->m_pstorageFactory != nullptr) {
while (g_pserver->m_pstorageFactory->totalDiskspaceUsed() >= g_pserver->maxstorage && elapsedUs(evictionTimer) < eviction_time_limit_us) {
redisDb *db;
std::vector<std::string> evictionPool;
robj *bestkey = nullptr;
redisDb *bestdb = nullptr;
unsigned long long bestidle = 0;
for (int i = 0; i < cserver.dbnum; i++) {
db = g_pserver->db[i];
evictionPool = db->getStorageCache()->getEvictionCandidates(g_pserver->maxmemory_samples);
for (std::string key : evictionPool) {
robj *keyobj = createStringObject(key.c_str(), key.size());
robj *obj = db->find(szFromObj(keyobj));
if (obj != nullptr) {
expireEntry *e = db->getExpire(keyobj);
unsigned long long idle = getIdle(obj, e);
if (bestkey == nullptr || bestidle < idle) {
if (bestkey != nullptr)
decrRefCount(bestkey);
incrRefCount(keyobj);
bestkey = keyobj;
bestidle = idle;
bestdb = db;
}
}
decrRefCount(keyobj);
}
}
if (bestkey) {
evict(bestdb, bestkey);
} else {
break; //could not find a key to evict so stop now
}
}
}
if (g_pserver->maxstorage && g_pserver->m_pstorageFactory != nullptr && g_pserver->m_pstorageFactory->totalDiskspaceUsed() >= g_pserver->maxstorage)
goto cant_free_storage;
@@ -760,14 +684,14 @@ int performEvictions(bool fPreSnapshot) {
if (g_pserver->maxmemory_policy & MAXMEMORY_FLAG_ALLKEYS)
{
if ((keys = db->size()) != 0) {
total_keys += evictionPoolPopulate(i, db, false, pool);
total_keys += evictionPoolPopulate(i, db, nullptr, pool);
}
}
else
{
keys = db->expireSize();
if (keys != 0)
total_keys += evictionPoolPopulate(i, db, true, pool);
total_keys += evictionPoolPopulate(i, db, db->setexpireUnsafe(), pool);
}
}
if (!total_keys) break; /* No keys to evict. */
@@ -828,7 +752,7 @@ int performEvictions(bool fPreSnapshot) {
{
if (db->expireSize())
{
db->random_expire(&bestkey);
bestkey = (sds)db->random_expire().key();
bestdbid = j;
break;
}
@@ -847,7 +771,6 @@ int performEvictions(bool fPreSnapshot) {
if (db->removeCachedValue(bestkey, &deT)) {
mem_freed += splazy->addEntry(db->dictUnsafeKeyOnly(), deT);
ckeysFailed = 0;
g_pserver->stat_evictedkeys++;
}
else {
delta = 0;
@@ -859,11 +782,30 @@ int performEvictions(bool fPreSnapshot) {
else
{
robj *keyobj = createStringObject(bestkey,sdslen(bestkey));
propagateExpire(db,keyobj,g_pserver->lazyfree_lazy_eviction);
/* We compute the amount of memory freed by db*Delete() alone.
* It is possible that actually the memory needed to propagate
* the DEL in AOF and replication link is greater than the one
* we are freeing removing the key, but we can't account for
* that otherwise we would never exit the loop.
*
* AOF and Output buffer memory will be freed eventually so
* we only care about memory used by the key space. */
delta = (long long) zmalloc_used_memory();
evict(db, keyobj);
latencyStartMonitor(eviction_latency);
if (g_pserver->lazyfree_lazy_eviction)
dbAsyncDelete(db,keyobj);
else
dbSyncDelete(db,keyobj);
latencyEndMonitor(eviction_latency);
latencyAddSampleIfNeeded("eviction-del",eviction_latency);
delta -= (long long) zmalloc_used_memory();
mem_freed += delta;
g_pserver->stat_evictedkeys++;
signalModifiedKey(NULL,db,keyobj);
notifyKeyspaceEvent(NOTIFY_EVICTED, "evicted",
keyobj, db->id);
decrRefCount(keyobj);
}
keys_freed++;
@@ -882,9 +824,6 @@ int performEvictions(bool fPreSnapshot) {
* across the dbAsyncDelete() call, while the thread can
* release the memory all the time. */
if (g_pserver->lazyfree_lazy_eviction) {
if (evictReason == EvictReason::System) {
updateSysAvailableMemory();
}
if (getMaxmemoryState(NULL,NULL,NULL,NULL) == C_OK) {
break;
}
@@ -898,7 +837,7 @@ int performEvictions(bool fPreSnapshot) {
if (!isEvictionProcRunning && serverTL->el != nullptr) {
isEvictionProcRunning = 1;
aeCreateTimeEvent(serverTL->el, 0,
evictionTimeProc, (void*)fPreSnapshot, NULL);
evictionTimeProc, NULL, NULL);
}
break;
}
@@ -912,13 +851,9 @@ int performEvictions(bool fPreSnapshot) {
if (splazy != nullptr && splazy->memory_queued() > 0 && !serverTL->gcEpoch.isReset()) {
g_pserver->garbageCollector.enqueue(serverTL->gcEpoch, std::move(splazy));
}
cant_free:
if (mem_freed > 0 && evictReason == EvictReason::System) {
updateSysAvailableMemory();
}
cant_free:
if (g_pserver->m_pstorageFactory)
{
if (mem_reported < g_pserver->maxmemory*1.2) {
+79 -192
View File
@@ -33,6 +33,8 @@
#include "server.h"
#include "cron.h"
fastlock g_expireLock {"Expire"};
/* Helper function for the activeExpireCycle() function.
* This function will try to expire the key that is stored in the hash table
* entry 'de' of the 'expires' hash table of a Redis database.
@@ -72,20 +74,21 @@ void activeExpireCycleExpireFullKey(redisDb *db, const char *key) {
*----------------------------------------------------------------------------*/
int activeExpireCycleExpire(redisDb *db, const char *key, expireEntry &e, long long now, size_t &tried) {
int activeExpireCycleExpire(redisDb *db, expireEntry &e, long long now, size_t &tried) {
if (!e.FFat())
{
activeExpireCycleExpireFullKey(db, key);
activeExpireCycleExpireFullKey(db, e.key());
++tried;
return 1;
}
expireEntryFat *pfat = e.pfatentry();
robj *val = db->find(key);
robj *val = db->find(e.key());
int deleted = 0;
redisObjectStack objKey;
initStaticStringObject(objKey, (char*)key);
initStaticStringObject(objKey, (char*)e.key());
bool fTtlChanged = false;
while (!pfat->FEmpty())
{
@@ -96,7 +99,7 @@ int activeExpireCycleExpire(redisDb *db, const char *key, expireEntry &e, long l
// Is it the full key expiration?
if (pfat->nextExpireEntry().spsubkey == nullptr)
{
activeExpireCycleExpireFullKey(db, key);
activeExpireCycleExpireFullKey(db, e.key());
return ++deleted;
}
@@ -106,7 +109,7 @@ int activeExpireCycleExpire(redisDb *db, const char *key, expireEntry &e, long l
if (setTypeRemove(val,pfat->nextExpireEntry().spsubkey.get())) {
deleted++;
if (setTypeSize(val) == 0) {
activeExpireCycleExpireFullKey(db, key);
activeExpireCycleExpireFullKey(db, e.key());
return deleted;
}
}
@@ -116,7 +119,7 @@ int activeExpireCycleExpire(redisDb *db, const char *key, expireEntry &e, long l
if (hashTypeDelete(val,(sds)pfat->nextExpireEntry().spsubkey.get())) {
deleted++;
if (hashTypeLength(val) == 0) {
activeExpireCycleExpireFullKey(db, key);
activeExpireCycleExpireFullKey(db, e.key());
return deleted;
}
}
@@ -126,7 +129,7 @@ int activeExpireCycleExpire(redisDb *db, const char *key, expireEntry &e, long l
if (zsetDel(val,(sds)pfat->nextExpireEntry().spsubkey.get())) {
deleted++;
if (zsetLength(val) == 0) {
activeExpireCycleExpireFullKey(db, key);
activeExpireCycleExpireFullKey(db, e.key());
return deleted;
}
}
@@ -134,15 +137,15 @@ int activeExpireCycleExpire(redisDb *db, const char *key, expireEntry &e, long l
case OBJ_CRON:
{
sds keyCopy = sdsdup(key);
sds keyCopy = sdsdup(e.key());
incrRefCount(val);
aePostFunction(g_pserver->rgthreadvar[IDX_EVENT_LOOP_MAIN].el, [keyCopy, val]{
executeCronJobExpireHook(keyCopy, val);
sdsfree(keyCopy);
decrRefCount(val);
}, true /*fLock*/, true /*fForceQueue*/);
break;
}
return deleted;
case OBJ_LIST:
default:
@@ -154,6 +157,7 @@ int activeExpireCycleExpire(redisDb *db, const char *key, expireEntry &e, long l
propagateSubkeyExpire(db, val->type, &objKey, &objSubkey);
pfat->popfrontExpireEntry();
fTtlChanged = true;
if ((tried % ACTIVE_EXPIRE_CYCLE_SUBKEY_LOOKUPS_PER_LOOP) == 0) {
break;
}
@@ -163,6 +167,11 @@ int activeExpireCycleExpire(redisDb *db, const char *key, expireEntry &e, long l
{
removeExpire(db, &objKey);
}
else if (!pfat->FEmpty() && fTtlChanged)
{
// We need to resort the expire entry since it may no longer be in the correct position
db->resortExpire(e);
}
if (deleted)
{
@@ -308,26 +317,8 @@ void pexpireMemberAtCommand(client *c)
* If type is ACTIVE_EXPIRE_CYCLE_SLOW, that normal expire cycle is
* executed, where the time limit is a percentage of the REDIS_HZ period
* as specified by the ACTIVE_EXPIRE_CYCLE_SLOW_TIME_PERC define. */
#define ACTIVE_EXPIRE_CYCLE_KEYS_PER_LOOP 20 /* Keys for each DB loop. */
#define ACTIVE_EXPIRE_CYCLE_FAST_DURATION 1000 /* Microseconds. */
#define ACTIVE_EXPIRE_CYCLE_SLOW_TIME_PERC 25 /* Max % of CPU to use. */
#define ACTIVE_EXPIRE_CYCLE_ACCEPTABLE_STALE 10 /* % of stale keys after which
we do extra efforts. */
/*static*/ void redisDbPersistentData::activeExpireCycleCore(int type) {
/* Adjust the running parameters according to the configured expire
* effort. The default effort is 1, and the maximum configurable effort
* is 10. */
unsigned long
effort = g_pserver->active_expire_effort-1, /* Rescale from 0 to 9. */
config_keys_per_loop = ACTIVE_EXPIRE_CYCLE_KEYS_PER_LOOP +
ACTIVE_EXPIRE_CYCLE_KEYS_PER_LOOP/4*effort,
config_cycle_fast_duration = ACTIVE_EXPIRE_CYCLE_FAST_DURATION +
ACTIVE_EXPIRE_CYCLE_FAST_DURATION/4*effort,
config_cycle_slow_time_perc = ACTIVE_EXPIRE_CYCLE_SLOW_TIME_PERC +
2*effort,
config_cycle_acceptable_stale = ACTIVE_EXPIRE_CYCLE_ACCEPTABLE_STALE-
effort;
void activeExpireCycleCore(int type) {
/* This function has some global state in order to continue the work
* incrementally across calls. */
static unsigned int current_db = 0; /* Next DB to test. */
@@ -345,16 +336,10 @@ void pexpireMemberAtCommand(client *c)
if (type == ACTIVE_EXPIRE_CYCLE_FAST) {
/* Don't start a fast cycle if the previous cycle did not exit
* for time limit, unless the percentage of estimated stale keys is
* too high. Also never repeat a fast cycle for the same period
* for time limit. Also don't repeat a fast cycle for the same period
* as the fast cycle total duration itself. */
if (!timelimit_exit &&
g_pserver->stat_expired_stale_perc < config_cycle_acceptable_stale)
return;
if (start < last_fast_cycle + (long long)config_cycle_fast_duration*2)
return;
if (!timelimit_exit) return;
if (start < last_fast_cycle + ACTIVE_EXPIRE_CYCLE_FAST_DURATION*2) return;
last_fast_cycle = start;
}
@@ -368,16 +353,16 @@ void pexpireMemberAtCommand(client *c)
if (dbs_per_call > cserver.dbnum || timelimit_exit)
dbs_per_call = cserver.dbnum;
/* We can use at max 'config_cycle_slow_time_perc' percentage of CPU
* time per iteration. Since this function gets called with a frequency of
* server.hz times per second, the following is the max amount of
/* We can use at max ACTIVE_EXPIRE_CYCLE_SLOW_TIME_PERC percentage of CPU time
* per iteration. Since this function gets called with a frequency of
* g_pserver->hz times per second, the following is the max amount of
* microseconds we can spend in this function. */
timelimit = config_cycle_slow_time_perc*1000000/g_pserver->hz/100;
timelimit = 1000000*ACTIVE_EXPIRE_CYCLE_SLOW_TIME_PERC/g_pserver->hz/100;
timelimit_exit = 0;
if (timelimit <= 0) timelimit = 1;
if (type == ACTIVE_EXPIRE_CYCLE_FAST)
timelimit = config_cycle_fast_duration; /* in microseconds. */
timelimit = ACTIVE_EXPIRE_CYCLE_FAST_DURATION; /* in microseconds. */
/* Accumulate some global stats as we expire keys, to have some idea
* about the number of keys that are already logically expired, but still
@@ -386,9 +371,6 @@ void pexpireMemberAtCommand(client *c)
long total_expired = 0;
for (j = 0; j < dbs_per_call && timelimit_exit == 0; j++) {
/* Expired and checked in a single loop. */
unsigned long expired, sampled;
redisDb *db = g_pserver->db[(current_db % cserver.dbnum)];
/* Increment the DB now so we are sure if we run out of time
@@ -396,156 +378,48 @@ void pexpireMemberAtCommand(client *c)
* distribute the time evenly across DBs. */
current_db++;
if (g_pserver->m_pstorageFactory == nullptr) {
/* Continue to expire if at the end of the cycle there are still
* a big percentage of keys to expire, compared to the number of keys
* we scanned. The percentage, stored in config_cycle_acceptable_stale
* is not fixed, but depends on the Redis configured "expire effort". */
do {
unsigned long num, slots;
long long now, ttl_sum;
int ttl_samples;
iteration++;
long long now;
iteration++;
now = mstime();
/* If there is nothing to expire try next DB ASAP. */
if (db->expireSize() == 0) {
db->avg_ttl = 0;
break;
}
num = dictSize(db->m_pdict);
slots = dictSlots(db->m_pdict);
now = mstime();
/* When there are less than 1% filled slots, sampling the key
* space is expensive, so stop here waiting for better times...
* The dictionary will be resized asap. */
if (slots > DICT_HT_INITIAL_SIZE &&
(num*100/slots < 1)) break;
/* The main collection cycle. Sample random keys among keys
* with an expire set, checking for expired ones. */
expired = 0;
sampled = 0;
ttl_sum = 0;
ttl_samples = 0;
if (num > config_keys_per_loop)
num = config_keys_per_loop;
/* Here we access the low level representation of the hash table
* for speed concerns: this makes this code coupled with dict.c,
* but it hardly changed in ten years.
*
* Note that certain places of the hash table may be empty,
* so we want also a stop condition about the number of
* buckets that we scanned. However scanning for free buckets
* is very fast: we are in the cache line scanning a sequential
* array of NULL pointers, so we can scan a lot more buckets
* than keys in the same time. */
long max_buckets = num*20;
long checked_buckets = 0;
while (sampled < num && checked_buckets < max_buckets) {
for (int table = 0; table < 2; table++) {
if (table == 1 && !dictIsRehashing(db->m_pdict)) break;
unsigned long idx = db->expires_cursor;
idx &= db->m_pdict->ht[table].sizemask;
dictEntry *de = db->m_pdict->ht[table].table[idx];
long long ttl;
/* Scan the current bucket of the current table. */
checked_buckets++;
while(de) {
/* Get the next entry now since this entry may get
* deleted. */
dictEntry *e = de;
robj *o = (robj*)dictGetVal(de);
de = de->next;
if (!o->FExpires())
continue;
expireEntry *exp = &o->expire;
serverAssert(exp->when() > 0);
ttl = exp->when()-now;
size_t tried = 0;
if (exp->when() <= now) {
if (activeExpireCycleExpire(db,(const char*)dictGetKey(e),*exp,now,tried)) expired++;
serverAssert(ttl <= 0);
} else {
serverAssert(ttl > 0);
}
if (ttl > 0) {
/* We want the average TTL of keys yet
* not expired. */
ttl_sum += ttl;
ttl_samples++;
}
sampled++;
}
}
db->expires_cursor++;
}
total_expired += expired;
total_sampled += sampled;
/* Update the average TTL stats for this database. */
if (ttl_samples) {
long long avg_ttl = ttl_sum/ttl_samples;
/* Do a simple running average with a few samples.
* We just use the current estimate with a weight of 2%
* and the previous estimate with a weight of 98%. */
if (db->avg_ttl == 0) db->avg_ttl = avg_ttl;
db->avg_ttl = (db->avg_ttl/50)*49 + (avg_ttl/50);
}
/* If there is nothing to expire try next DB ASAP. */
if (db->setexpireUnsafe()->empty())
{
db->avg_ttl = 0;
db->last_expire_set = now;
continue;
}
std::unique_lock<fastlock> ul(g_expireLock);
size_t expired = 0;
size_t tried = 0;
long long check = ACTIVE_EXPIRE_CYCLE_FAST_DURATION; // assume a check is roughly 1us. It isn't but good enough
db->expireitr = db->setexpireUnsafe()->enumerate(db->expireitr, now, [&](expireEntry &e) __attribute__((always_inline)) {
if (e.when() < now)
{
expired += activeExpireCycleExpire(db, e, now, tried);
}
if ((tried % ACTIVE_EXPIRE_CYCLE_LOOKUPS_PER_LOOP) == 0)
{
/* We can't block forever here even if there are many keys to
* expire. So after a given amount of milliseconds return to the
* caller waiting for the other active expire cycle. */
if ((iteration & 0xf) == 0) { /* check once every 16 iterations. */
elapsed = ustime()-start;
if (elapsed > timelimit) {
timelimit_exit = 1;
g_pserver->stat_expired_time_cap_reached_count++;
break;
}
}
/* We don't repeat the cycle for the current database if there are
* an acceptable amount of stale keys (logically expired but yet
* not reclaimed). */
} while (sampled == 0 ||
(expired*100/sampled) > config_cycle_acceptable_stale);
} else {
long prev_expired;
long long now = mstime();
size_t tried = 0;
std::vector<std::string> keys;
do {
prev_expired = total_expired;
keys = db->getStorageCache()->getExpirationCandidates(ACTIVE_EXPIRE_CYCLE_LOOKUPS_PER_LOOP);
for (std::string key : keys) {
robj* keyobj = createStringObject(key.c_str(), key.size());
db->find(szFromObj(keyobj));
expireEntry *e = db->getExpire(keyobj);
if (e != nullptr && e->when() < now)
total_expired += activeExpireCycleExpire(db, szFromObj(keyobj), *e, now, tried);
decrRefCount(keyobj);
}
total_sampled += keys.size();
elapsed = ustime()-start;
} while (keys.size() > 0 && (elapsed < timelimit) && (total_expired - prev_expired) > 0);
if (ustime()-start > timelimit) {
timelimit_exit = 1;
g_pserver->stat_expired_time_cap_reached_count++;
if (elapsed > timelimit) {
timelimit_exit = 1;
g_pserver->stat_expired_time_cap_reached_count++;
return false;
}
check = ACTIVE_EXPIRE_CYCLE_FAST_DURATION;
}
}
return true;
}, &check);
total_expired += expired;
}
elapsed = ustime()-start;
g_pserver->stat_expire_cycle_time_used += elapsed;
latencyAddSampleIfNeeded("expire-cycle",elapsed/1000);
/* Update our estimate of keys existing but yet to be expired.
@@ -561,7 +435,7 @@ void pexpireMemberAtCommand(client *c)
void activeExpireCycle(int type)
{
runAndPropogateToReplicas(redisDbPersistentData::activeExpireCycleCore, type);
runAndPropogateToReplicas(activeExpireCycleCore, type);
}
/*-----------------------------------------------------------------------------
@@ -621,14 +495,19 @@ void expireSlaveKeys(void) {
while(dbids && dbid < cserver.dbnum) {
if ((dbids & 1) != 0) {
redisDb *db = g_pserver->db[dbid];
// the expire is hashed based on the key pointer, so we need the point in the main db
auto itrDB = db->find(keyname);
auto itrExpire = db->setexpire()->end();
if (itrDB != nullptr)
itrExpire = db->setexpireUnsafe()->find(itrDB.key());
int expired = 0;
if (itrDB != db->end() && itrDB->FExpires())
if (itrExpire != db->setexpire()->end())
{
if (itrDB->expire.when() < start) {
if (itrExpire->when() < start) {
size_t tried = 0;
expired = activeExpireCycleExpire(g_pserver->db[dbid],itrDB.key(),itrDB->expire,start,tried);
expired = activeExpireCycleExpire(g_pserver->db[dbid],*itrExpire,start,tried);
}
}
@@ -636,7 +515,7 @@ void expireSlaveKeys(void) {
* corresponding bit in the new bitmap we set as value.
* At the end of the loop if the bitmap is zero, it means we
* no longer need to keep track of this key. */
if (itrDB != db->end() && itrDB->FExpires() && !expired) {
if (itrExpire != db->setexpire()->end() && !expired) {
noexpire++;
new_dbids |= (uint64_t)1 << dbid;
}
@@ -814,6 +693,7 @@ void ttlGenericCommand(client *c, int output_ms) {
/* The key exists. Return -1 if it has no expire, or the actual
* TTL value otherwise. */
std::unique_lock<fastlock> ul(g_expireLock);
expireEntry *pexpire = c->db->getExpire(c->argv[1]);
if (c->argc == 2) {
@@ -903,11 +783,18 @@ expireEntryFat::~expireEntryFat()
}
expireEntryFat::expireEntryFat(const expireEntryFat &e)
: m_vecexpireEntries(e.m_vecexpireEntries)
: m_keyPrimary(e.m_keyPrimary), m_vecexpireEntries(e.m_vecexpireEntries)
{
// Note: dictExpires is not copied
}
expireEntryFat::expireEntryFat(expireEntryFat &&e)
: m_keyPrimary(std::move(e.m_keyPrimary)), m_vecexpireEntries(std::move(e.m_vecexpireEntries))
{
m_dictIndex = e.m_dictIndex;
e.m_dictIndex = nullptr;
}
void expireEntryFat::createIndex()
{
serverAssert(m_dictIndex == nullptr);
+109 -125
View File
@@ -22,11 +22,9 @@ public:
{}
subexpireEntry(const subexpireEntry &other)
: spsubkey(nullptr, sdsfree)
: spsubkey((const char*)sdsdupshared(other.spsubkey.get()), sdsfree)
{
when = other.when;
if (other.spsubkey != nullptr)
spsubkey = std::unique_ptr<const char, void(*)(const char*)>((const char*)sdsdupshared(other.spsubkey.get()), sdsfree);
}
subexpireEntry(subexpireEntry &&) = default;
@@ -43,30 +41,27 @@ public:
};
private:
sdsimmutablestring m_keyPrimary;
std::vector<subexpireEntry> m_vecexpireEntries; // Note a NULL for the sds portion means the expire is for the primary key
dict *m_dictIndex = nullptr;
long long m_whenPrimary = LLONG_MAX;
void createIndex();
public:
expireEntryFat() = default;
expireEntryFat(const expireEntryFat &);
expireEntryFat(const sdsimmutablestring &keyPrimary)
: m_keyPrimary(keyPrimary)
{}
~expireEntryFat();
expireEntryFat(const expireEntryFat &e);
expireEntryFat(expireEntryFat &&e);
long long when() const noexcept { return m_vecexpireEntries.front().when; }
const char *key() const noexcept { return static_cast<const char*>(m_keyPrimary); }
bool operator<(long long when) const noexcept { return this->when() < when; }
void expireSubKey(const char *szSubkey, long long when);
bool FGetPrimaryExpire(long long *pwhen) const {
if (m_whenPrimary != LLONG_MAX) {
*pwhen = m_whenPrimary;
return true;
}
return false;
}
bool FEmpty() const noexcept { return m_vecexpireEntries.empty(); }
const subexpireEntry &nextExpireEntry() const noexcept { return m_vecexpireEntries.front(); }
void popfrontExpireEntry();
@@ -75,11 +70,19 @@ public:
};
class expireEntry {
struct {
uint64_t m_whenAndPtrUnion : 63,
fFat : 1;
} s;
static_assert(sizeof(expireEntryFat*) <= sizeof(int64_t), "The pointer must fit in the union");
struct
{
sdsimmutablestring m_key;
expireEntryFat *m_pfatentry = nullptr;
} u;
long long m_when; // bit wise and with FFatMask means this is a fat entry and we should use the pointer
/* Mask to check if an entry is Fat, most significant bit of m_when being set means it is Fat otherwise it is not */
long long FFatMask() const noexcept {
return (1LL) << (sizeof(long long)*CHAR_BIT - 1);
}
expireEntry() = default;
public:
class iter
{
@@ -115,107 +118,92 @@ public:
const iter &operator*() const { return *this; }
};
expireEntry()
{
s.fFat = 0;
s.m_whenAndPtrUnion = 0;
}
expireEntry(const char *subkey, long long when)
expireEntry(sds key, const char *subkey, long long when)
{
if (subkey != nullptr)
{
auto pfatentry = new (MALLOC_LOCAL) expireEntryFat();
pfatentry->expireSubKey(subkey, when);
s.m_whenAndPtrUnion = reinterpret_cast<long long>(pfatentry);
s.fFat = true;
m_when = FFatMask() | INVALID_EXPIRE;
u.m_pfatentry = new (MALLOC_LOCAL) expireEntryFat(sdsimmutablestring(sdsdupshared(key)));
u.m_pfatentry->expireSubKey(subkey, when);
}
else
{
s.m_whenAndPtrUnion = when;
s.fFat = false;
u.m_key = sdsimmutablestring(sdsdupshared(key));
m_when = when;
}
}
expireEntry(const expireEntry &e)
{
*this = e;
}
expireEntry(expireEntry &&e)
{
u.m_key = std::move(e.u.m_key);
u.m_pfatentry = std::move(e.u.m_pfatentry);
m_when = e.m_when;
e.m_when = 0;
e.u.m_pfatentry = nullptr;
}
expireEntry(expireEntryFat *pfatentry)
{
assert(pfatentry != nullptr);
s.m_whenAndPtrUnion = reinterpret_cast<long long>(pfatentry);
s.fFat = true;
}
expireEntry(const expireEntry &e) {
if (e.FFat()) {
s.m_whenAndPtrUnion = reinterpret_cast<long long>(new expireEntryFat(*e.pfatentry()));
s.fFat = true;
} else {
s = e.s;
u.m_pfatentry = pfatentry;
m_when = FFatMask() | INVALID_EXPIRE;
for (auto itr : *this)
{
if (itr.subkey() == nullptr)
{
m_when = FFatMask() | itr.when();
break;
}
}
}
expireEntry(expireEntry &&e)
{
s = e.s;
}
expireEntry &operator=(expireEntry &&e)
{
if (FFat())
delete pfatentry();
s = e.s;
e.s.m_whenAndPtrUnion = 0;
e.s.fFat = false;
return *this;
}
expireEntry &operator=(expireEntry &e) {
if (FFat())
delete pfatentry();
if (e.FFat()) {
s.m_whenAndPtrUnion = reinterpret_cast<long long>(new expireEntryFat(*e.pfatentry()));
s.fFat = true;
} else {
s = e.s;
}
return *this;
}
// Duplicate the expire, note this is intended to be passed directly to setExpire
expireEntry duplicate() const {
expireEntry dst;
dst.m_when = m_when;
if (FFat()) {
auto pfatentry = new expireEntryFat(*expireEntry::pfatentry());
dst.s.m_whenAndPtrUnion = reinterpret_cast<long long>(pfatentry);
dst.s.fFat = true;
dst.u.m_pfatentry = new expireEntryFat(*u.m_pfatentry);
} else {
dst.s.m_whenAndPtrUnion = s.m_whenAndPtrUnion;
dst.s.fFat = false;
dst.u.m_key = u.m_key;
}
return dst;
}
void reset() {
if (FFat())
delete pfatentry();
s.fFat = false;
s.m_whenAndPtrUnion = 0;
}
~expireEntry()
{
if (FFat())
delete pfatentry();
delete u.m_pfatentry;
}
inline bool FFat() const noexcept { return s.fFat; }
expireEntryFat *pfatentry() {
assert(FFat());
return reinterpret_cast<expireEntryFat*>(s.m_whenAndPtrUnion);
}
const expireEntryFat *pfatentry() const {
return const_cast<expireEntry*>(this)->pfatentry();
expireEntry &operator=(const expireEntry &e)
{
u.m_key = e.u.m_key;
m_when = e.m_when;
if (e.FFat())
u.m_pfatentry = new (MALLOC_LOCAL) expireEntryFat(*e.u.m_pfatentry);
return *this;
}
void setKeyUnsafe(sds key)
{
if (FFat())
u.m_pfatentry->m_keyPrimary = sdsimmutablestring(sdsdupshared(key));
else
u.m_key = sdsimmutablestring(sdsdupshared(key));
}
inline bool FFat() const noexcept { return m_when & FFatMask(); }
expireEntryFat *pfatentry() { assert(FFat()); return u.m_pfatentry; }
const expireEntryFat *pfatentry() const { assert(FFat()); return u.m_pfatentry; }
bool operator==(const sdsview &key) const noexcept
{
return key == this->key();
}
bool operator<(const expireEntry &e) const noexcept
{
@@ -226,11 +214,17 @@ public:
return this->when() < when;
}
const char *key() const noexcept
{
if (FFat())
return u.m_pfatentry->key();
return static_cast<const char*>(u.m_key);
}
long long when() const noexcept
{
if (FFat())
return pfatentry()->when();
return s.m_whenAndPtrUnion;
return u.m_pfatentry->when();
return FGetPrimaryExpire();
}
void update(const char *subkey, long long when)
@@ -239,27 +233,30 @@ public:
{
if (subkey == nullptr)
{
s.m_whenAndPtrUnion = when;
m_when = when;
return;
}
else
{
// we have to upgrade to a fat entry
auto pfatentry = new (MALLOC_LOCAL) expireEntryFat();
pfatentry->expireSubKey(nullptr, s.m_whenAndPtrUnion);
s.m_whenAndPtrUnion = reinterpret_cast<long long>(pfatentry);
s.fFat = true;
long long whenT = m_when;
sdsimmutablestring keyPrimary = u.m_key;
m_when |= FFatMask();
u.m_pfatentry = new (MALLOC_LOCAL) expireEntryFat(keyPrimary);
u.m_pfatentry->expireSubKey(nullptr, whenT);
// at this point we're fat so fall through
}
}
pfatentry()->expireSubKey(subkey, when);
if (subkey == nullptr)
m_when = when | FFatMask();
u.m_pfatentry->expireSubKey(subkey, when);
}
iter begin() const { return iter(this, 0); }
iter end() const
{
if (FFat())
return iter(this, pfatentry()->size());
return iter(this, u.m_pfatentry->size());
return iter(this, 1);
}
@@ -271,39 +268,26 @@ public:
pfatentry()->m_vecexpireEntries.begin() + itr.m_idx);
}
size_t size() const {
size_t size() const
{
if (FFat())
return pfatentry()->size();
return u.m_pfatentry->size();
return 1;
}
long long FGetPrimaryExpire() const noexcept
{
return m_when & (~FFatMask());
}
bool FGetPrimaryExpire(long long *pwhen) const noexcept
{
if (FFat()) {
return pfatentry()->FGetPrimaryExpire(pwhen);
} else {
*pwhen = s.m_whenAndPtrUnion;
return true;
}
}
void *release_as_void() {
uint64_t whenT = s.m_whenAndPtrUnion;
whenT |= static_cast<uint64_t>(s.fFat) << 63;
s.m_whenAndPtrUnion = 0;
s.fFat = 0;
return reinterpret_cast<void*>(whenT);
}
static expireEntry *from_void(void **src) {
uintptr_t llV = reinterpret_cast<uintptr_t>(src);
return reinterpret_cast<expireEntry*>(llV);
}
static const expireEntry *from_void(void *const*src) {
uintptr_t llV = reinterpret_cast<uintptr_t>(src);
return reinterpret_cast<expireEntry*>(llV);
*pwhen = FGetPrimaryExpire();
return *pwhen != INVALID_EXPIRE;
}
explicit operator sdsview() const noexcept { return key(); }
explicit operator long long() const noexcept { return when(); }
};
static_assert(sizeof(expireEntry) == sizeof(long long), "This must fit in a long long so it can be put in a dictEntry");
typedef semiorderedset<expireEntry, sdsview, true /*expireEntry can be memmoved*/> expireset;
extern fastlock g_expireLock;
+1 -1
View File
@@ -904,7 +904,7 @@ int main(int argc, const char **argv) {
while (self_threads < config.max_threads) {
for (int i = 0; i < config.numclients; i++) {
snprintf(command, sizeof(command), "SET %d %s\r\n", self_threads * config.numclients + i, set_value);
sprintf(command, "SET %d %s\r\n", self_threads * config.numclients + i, set_value);
createClient(command, strlen(command), NULL,self_threads);
}
+6 -2
View File
@@ -20,9 +20,11 @@ void lazyfreeFreeObject(void *args[]) {
* when the database was logically deleted. */
void lazyfreeFreeDatabase(void *args[]) {
dict *ht1 = (dict *) args[0];
expireset *setexpire = (expireset *) args[1];
size_t numkeys = dictSize(ht1);
dictRelease(ht1);
delete setexpire;
atomicDecr(lazyfree_objects,numkeys);
atomicIncr(lazyfreed_objects,numkeys);
}
@@ -215,15 +217,17 @@ void freeObjAsync(robj *key, robj *obj) {
* create a new empty set of hash tables and scheduling the old ones for
* lazy freeing. */
void redisDbPersistentData::emptyDbAsync() {
std::unique_lock<fastlock> ul(g_expireLock);
dict *oldht1 = m_pdict;
auto *set = m_setexpire;
m_setexpire = new (MALLOC_LOCAL) expireset();
m_pdict = dictCreate(&dbDictType,this);
if (m_spstorage != nullptr)
m_spstorage->clearAsync();
if (m_fTrackingChanges)
m_fAllChanged = true;
atomicIncr(lazyfree_objects,dictSize(oldht1));
m_numexpires = 0;
bioCreateLazyFreeJob(lazyfreeFreeDatabase,2,oldht1,nullptr);
bioCreateLazyFreeJob(lazyfreeFreeDatabase,2,oldht1,set);
}
/* Release the radix tree mapping Redis Cluster keys to slots asynchronously. */
-33
View File
@@ -1,33 +0,0 @@
#include <string>
#include <fstream>
#include <limits>
static size_t getMemKey(std::string key) {
# ifdef __linux__
std::string token;
std::ifstream f("/proc/meminfo");
while (f >> token) {
if (token == key) {
size_t mem_val;
if (f >> mem_val) {
return mem_val * 1024; // values are in kB
} else {
return 0;
}
f.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
}
return 0;
# else
(void)key;
return 0;
# endif
}
size_t getMemAvailable() {
return getMemKey("MemAvailable:");
}
size_t getMemTotal() {
return getMemKey("MemTotal:");
}
+9 -9
View File
@@ -656,7 +656,7 @@ void moduleHandlePropagationAfterCommandCallback(RedisModuleCtx *ctx) {
/* We don't need to do anything here if the server isn't inside
* a transaction. */
if (!serverTL->propagate_in_transaction) return;
if (!g_pserver->propagate_in_transaction) return;
/* If this command is executed from with Lua or MULTI/EXEC we do not
* need to propagate EXEC */
@@ -690,9 +690,8 @@ void moduleHandlePropagationAfterCommandCallback(RedisModuleCtx *ctx) {
}
/* Free the context after the user function was called. */
void moduleFreeContext(RedisModuleCtx *ctx, bool propogate) {
if (propogate)
moduleHandlePropagationAfterCommandCallback(ctx);
void moduleFreeContext(RedisModuleCtx *ctx) {
moduleHandlePropagationAfterCommandCallback(ctx);
autoMemoryCollect(ctx);
poolAllocRelease(ctx);
if (ctx->postponed_arrays) {
@@ -1815,7 +1814,7 @@ void moduleReplicateMultiIfNeeded(RedisModuleCtx *ctx) {
* the module command was called by a script. */
if (serverTL->in_eval || serverTL->in_exec) return;
/* If we already emitted MULTI return ASAP. */
if (serverTL->propagate_in_transaction) return;
if (g_pserver->propagate_in_transaction) return;
/* If this is a thread safe context, we do not want to wrap commands
* executed into MULTI/EXEC, they are executed as single commands
* from an external client in essence. */
@@ -2443,10 +2442,11 @@ int RM_UnlinkKey(RedisModuleKey *key) {
* If no TTL is associated with the key or if the key is empty,
* REDISMODULE_NO_EXPIRE is returned. */
mstime_t RM_GetExpire(RedisModuleKey *key) {
auto itr = key->db->find(key->key);
std::unique_lock<fastlock> ul(g_expireLock);
expireEntry *pexpire = key->db->getExpire(key->key);
mstime_t expire = INVALID_EXPIRE;
if (itr->FExpires())
itr->expire.FGetPrimaryExpire(&expire);
if (pexpire != nullptr)
pexpire->FGetPrimaryExpire(&expire);
if (expire == INVALID_EXPIRE || key->value == NULL)
return REDISMODULE_NO_EXPIRE;
@@ -7058,7 +7058,7 @@ RedisModuleString *RM_DictPrev(RedisModuleCtx *ctx, RedisModuleDictIter *di, voi
/* Compare the element currently pointed by the iterator to the specified
* element given by key/keylen, according to the operator 'op' (the set of
* valid operators are the same valid for RedisModule_DictIteratorStart).
* If the comparison is successful the command returns REDISMODULE_OK
* If the comparision is successful the command returns REDISMODULE_OK
* otherwise REDISMODULE_ERR is returned.
*
* This is useful when we want to just emit a lexicographical range, so
+1 -5
View File
@@ -13,10 +13,7 @@ endif
.SUFFIXES: .c .so .xo .o
all: helloworld.so hellotype.so helloblock.so hellocluster.so hellotimer.so hellodict.so hellohook.so helloacl.so build-keydb_modstatsd
build-keydb_modstatsd:
$(MAKE) -C keydb_modstatsd
all: helloworld.so hellotype.so helloblock.so hellocluster.so hellotimer.so hellodict.so hellohook.so helloacl.so
.c.xo:
$(CC) -I. $(CFLAGS) $(SHOBJ_CFLAGS) -fPIC -c $< -o $@
@@ -63,4 +60,3 @@ helloacl.so: helloacl.xo
clean:
rm -rf *.xo *.so
$(MAKE) -C keydb_modstatsd clean
+2 -3
View File
@@ -51,9 +51,8 @@ int TimerCommand_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int
for (int j = 0; j < 10; j++) {
int delay = rand() % 5000;
int bufsize = 256;
char *buf = RedisModule_Alloc(bufsize);
snprintf(buf,bufsize,"After %d", delay);
char *buf = RedisModule_Alloc(256);
snprintf(buf,256,"After %d", delay);
RedisModuleTimerID tid = RedisModule_CreateTimer(ctx,delay,timerHandler,buf);
REDISMODULE_NOT_USED(tid);
}
-13
View File
@@ -1,13 +0,0 @@
MODULE_FLAGS := -fPIC -O2 -Wall -Werror
OBJECT_FILES := modmain.o
MODSNAP_CXX_FLAGS := -std=gnu++14
%.o: %.cpp
$(CXX) -o $@ -c $< $(MODULE_FLAGS) -I../../../deps/cpp-statsd-client/include $(MODSNAP_CXX_FLAGS) -g
modstatsd.so: $(OBJECT_FILES)
$(CXX) -shared $(OBJECT_FILES) -o modstatsd.so
clean:
rm -f $(OBJECT_FILES) modstatsd.so
-722
View File
@@ -1,722 +0,0 @@
#include "redismodule.h"
#include <stdlib.h>
#include <cpp-statsd-client/StatsdClient.hpp>
#include <unordered_map>
#include <sys/utsname.h>
#include <algorithm>
#ifdef __linux__
#include <sys/sysinfo.h>
#include <sys/resource.h>
#endif
#include <inttypes.h>
#include <sys/time.h>
#include <regex>
#include <sstream>
#include <iostream>
#include <fstream>
using namespace Statsd;
class StatsdClientWrapper
{
private:
StatsdClient *m_stats;
StatsdClient *m_stats_noprefix;
public:
StatsdClientWrapper(const std::string& host,
const uint16_t port,
const std::string& prefix,
const uint64_t batchsize,
const uint64_t sendInterval) {
m_stats = new StatsdClient(host, port, prefix, batchsize, sendInterval);
m_stats_noprefix = new StatsdClient(host, port, "keydb", batchsize, sendInterval);
}
~StatsdClientWrapper() {
delete m_stats;
delete m_stats_noprefix;
}
void increment(const std::string& key, const bool prefixOnly = true) {
m_stats->increment(key);
if (!prefixOnly) m_stats_noprefix->increment(key);
}
void decrement(const std::string& key, const bool prefixOnly = true) {
m_stats->decrement(key);
if (!prefixOnly) m_stats_noprefix->decrement(key);
}
void count(const std::string& key, const int delta, const bool prefixOnly = true) {
m_stats->count(key, delta);
if (!prefixOnly) m_stats_noprefix->count(key, delta);
}
template <typename T>
void gauge(const std::string& key, const T value, const bool prefixOnly = true) {
m_stats->gauge(key, value);
if (!prefixOnly) m_stats_noprefix->gauge(key, value);
}
void timing(const std::string& key, const unsigned int ms, const bool prefixOnly = true) {
m_stats->timing(key, ms);
if (!prefixOnly) m_stats_noprefix->timing(key, ms);
}
};
/* constants */
static time_t c_infoUpdateSeconds = 10;
// the current Redis Cluster setup we configure replication factor as 2, each non-empty master node should have 2 replicas, given that there are 3 zones in each regions
static const int EXPECTED_NUMBER_OF_REPLICAS = 2;
StatsdClientWrapper *g_stats = nullptr;
std::string m_strPrefix { "keydb" };
const std::regex g_replica_or_db_info_regex { "^(slave|db)(\\d+)" };
const char *g_string_counter_separator = "__";
const uint64_t g_stats_buffer_size_bytes = 1600;
std::string nodeName;
int unameResult;
enum class StatsD_Type {
STATSD_GAUGE_LONGLONG,
STATSD_GAUGE_FLOAT,
STATSD_GAUGE_BYTES,
STATSD_DELTA,
STATSD_COUNTER_STRING
};
struct StatsRecord {
StatsD_Type type;
bool prefixOnly = true;
const char *szAlternate = nullptr;
/* Dynamic Values */
long long prevVal = 0;
};
std::unordered_map<std::string, StatsRecord> g_mapInfoFields = {
// info
{ "used_memory", { StatsD_Type::STATSD_GAUGE_BYTES, false /* prefixOnly */}},
{ "used_memory_rss", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "maxmemory", { StatsD_Type::STATSD_GAUGE_BYTES, false /* prefixOnly */}},
{ "used_memory_dataset_perc", { StatsD_Type::STATSD_GAUGE_FLOAT }},
{ "avg_lock_contention", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "repl_backlog_size", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "connected_slaves", { StatsD_Type::STATSD_GAUGE_LONGLONG, true, "connected_replicas" }},
{ "errorstat_ERR", { StatsD_Type::STATSD_DELTA }},
{ "connected_clients", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "cluster_connections", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "instantaneous_ops_per_sec", { StatsD_Type::STATSD_GAUGE_LONGLONG, false /* prefixOnly */}},
{ "instantaneous_input_kbps", { StatsD_Type::STATSD_GAUGE_FLOAT, false /* prefixOnly */}},
{ "instantaneous_output_kbps", { StatsD_Type::STATSD_GAUGE_FLOAT, false /* prefixOnly */}},
{ "server_threads", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "mvcc_depth", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "sync_full", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "sync_partial_ok", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "sync_partial_err", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "rdb_bgsave_in_progress", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "rdb_last_bgsave_time_sec", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "used_memory_overhead", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "master_sync_in_progress", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "uptime_in_seconds", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "hz", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "configured_hz", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "maxclients", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "client_recent_max_input_buffer", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "client_recent_max_output_buffer", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "blocked_clients", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "tracking_clients", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "clients_in_timeout_table", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "used_memory_peak", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "used_memory_startup", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "used_memory_dataset", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "allocator_allocated", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "allocator_active", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "allocator_resident", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "total_system_memory", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "used_memory_lua", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "used_memory_scripts", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "number_of_cached_scripts", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "allocator_frag_ratio", { StatsD_Type::STATSD_GAUGE_FLOAT }},
{ "allocator_frag_bytes", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "allocator_rss_ratio", { StatsD_Type::STATSD_GAUGE_FLOAT }},
{ "allocator_rss_bytes", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "rss_overhead_ratio", { StatsD_Type::STATSD_GAUGE_FLOAT }},
{ "rss_overhead_bytes", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "mem_fragmentation_ratio", { StatsD_Type::STATSD_GAUGE_FLOAT }},
{ "mem_fragmentation_bytes", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "mem_not_counted_for_evict", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "mem_replication_backlog", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "mem_clients_slaves", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "mem_clients_normal", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "mem_aof_buffer", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "active_defrag_running", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "lazyfree_pending_objects", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "lazyfreed_objects", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "loading", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "current_cow_peak", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "current_cow_size", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "current_cow_size_age", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "current_fork_perc", { StatsD_Type::STATSD_GAUGE_FLOAT }},
{ "current_save_keys_processed", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "current_save_keys_total", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "rdb_changes_since_last_save", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "rdb_last_save_time", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "rdb_last_cow_size", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "aof_enabled", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "aof_rewrite_in_progress", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "aof_rewrite_scheduled", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "aof_last_cow_size", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "module_fork_in_progress", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "module_fork_last_cow_size", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "aof_current_size", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "aof_base_size", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "aof_pending_rewrite", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "aof_buffer_length", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "aof_rewrite_buffer_length", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "aof_pending_bio_fsync", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "aof_delayed_fsync", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "total_connections_received", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "total_commands_processed", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "total_net_input_bytes", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "total_net_output_bytes", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "rejected_connections", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "expired_keys", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "expired_stale_perc", { StatsD_Type::STATSD_GAUGE_FLOAT }},
{ "expired_time_cap_reached_count", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "expire_cycle_cpu_milliseconds", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "evicted_keys", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "keyspace_hits", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "keyspace_misses", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "pubsub_channels", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "pubsub_patterns", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "latest_fork_usec", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "total_forks", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "migrate_cached_sockets", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "slave_expires_tracked_keys", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "active_defrag_hits", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "active_defrag_misses", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "active_defrag_key_hits", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "active_defrag_key_misses", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "tracking_total_keys", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "tracking_total_items", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "tracking_total_prefixes", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "unexpected_error_replies", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "total_error_replies", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "dump_payload_sanitizations", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "total_reads_processed", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "total_writes_processed", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "instantaneous_lock_contention", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "avg_lock_contention", { StatsD_Type::STATSD_GAUGE_FLOAT }},
{ "storage_provider_read_hits", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "storage_provider_read_misses", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "repl_backlog_active", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "repl_backlog_size", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "repl_backlog_first_byte_offset", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "repl_backlog_histlen", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "used_cpu_sys", { StatsD_Type::STATSD_GAUGE_FLOAT }},
{ "used_cpu_user", { StatsD_Type::STATSD_GAUGE_FLOAT }},
{ "used_cpu_sys_children", { StatsD_Type::STATSD_GAUGE_FLOAT }},
{ "used_cpu_user_children", { StatsD_Type::STATSD_GAUGE_FLOAT }},
{ "used_cpu_user_children", { StatsD_Type::STATSD_GAUGE_FLOAT }},
{ "long_lock_waits", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "used_cpu_sys_main_thread", { StatsD_Type::STATSD_GAUGE_FLOAT }},
{ "used_cpu_user_main_thread", { StatsD_Type::STATSD_GAUGE_FLOAT }},
{ "master_sync_total_bytes", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "master_sync_read_bytes", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "master_sync_last_io_seconds_ago", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "master_link_down_since_seconds", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "maxmemory_policy", { StatsD_Type::STATSD_COUNTER_STRING }},
{ "role", { StatsD_Type::STATSD_COUNTER_STRING }},
{ "master_global_link_status", { StatsD_Type::STATSD_COUNTER_STRING }},
{ "master_link_status", { StatsD_Type::STATSD_COUNTER_STRING }},
{ "master_failover_state", { StatsD_Type::STATSD_COUNTER_STRING }},
{ "rdb_last_bgsave_status", { StatsD_Type::STATSD_COUNTER_STRING }},
{ "rdb_saves", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "instantaneous_input_repl_kbps", { StatsD_Type::STATSD_GAUGE_FLOAT }},
{ "instantaneous_output_repl_kbps", { StatsD_Type::STATSD_GAUGE_FLOAT }},
{ "master_host", { StatsD_Type::STATSD_COUNTER_STRING }},
{ "master_repl_offset", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "second_repl_offset", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "slave_repl_offset", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "redis_version", { StatsD_Type::STATSD_COUNTER_STRING }},
{ "redis_git_sha1", { StatsD_Type::STATSD_COUNTER_STRING }},
// cluster info
{ "cluster_state", { StatsD_Type::STATSD_COUNTER_STRING }},
{ "cluster_slots_assigned", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "cluster_slots_ok", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "cluster_slots_pfail", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "cluster_slots_fail", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "cluster_known_nodes", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "cluster_size", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "storage_flash_available_bytes", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "storage_flash_total_bytes", { StatsD_Type::STATSD_GAUGE_BYTES }},
};
/* Globals */
static uint64_t g_cclients = 0;
long long ustime(void) {
struct timeval tv;
long long ust;
gettimeofday(&tv, NULL);
ust = ((long long)tv.tv_sec)*1000000;
ust += tv.tv_usec;
return ust;
}
void event_client_change_handler(struct RedisModuleCtx *ctx, RedisModuleEvent eid, uint64_t subevent, void *data) {
if (eid.id != REDISMODULE_EVENT_CLIENT_CHANGE)
return;
uint64_t clientsStart = g_cclients;
switch (subevent) {
case REDISMODULE_SUBEVENT_CLIENT_CHANGE_CONNECTED:
++g_cclients;
g_stats->increment("clients_added");
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_DEBUG, "Emitting metric increment for \"clients_added\"");
break;
case REDISMODULE_SUBEVENT_CLIENT_CHANGE_DISCONNECTED:
--g_cclients;
g_stats->increment("clients_disconnected");
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_DEBUG, "Emitting metric increment for \"clients_disconnected\"");
break;
}
if (g_cclients != clientsStart) {
g_stats->gauge("clients", g_cclients);
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_DEBUG, "Emitting metric \"clients\": %" PRIu64, g_cclients);
}
}
void handleStatItem(struct RedisModuleCtx *ctx, std::string name, StatsRecord &record, const char *pchValue) {
switch (record.type) {
case StatsD_Type::STATSD_GAUGE_LONGLONG: {
long long val = strtoll(pchValue, nullptr, 10);
g_stats->gauge(name, val, record.prefixOnly);
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_DEBUG, "Emitting metric \"%s\": %lld", name.c_str(), val);
break;
}
case StatsD_Type::STATSD_GAUGE_FLOAT: {
double val = strtod(pchValue, nullptr);
g_stats->gauge(name, val, record.prefixOnly);
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_DEBUG, "Emitting metric \"%s\": %f", name.c_str(), val);
break;
}
case StatsD_Type::STATSD_GAUGE_BYTES: {
long long val = strtoll(pchValue, nullptr, 10);
g_stats->gauge(name + "_MB", val / 1024/1024, record.prefixOnly);
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_DEBUG, "Emitting metric \"%s\": %llu", (name + "_MB").c_str(), val / 1024/1024);
break;
}
case StatsD_Type::STATSD_DELTA: {
long long val = strtoll(pchValue, nullptr, 10);
g_stats->count(name, val - record.prevVal, record.prefixOnly);
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_DEBUG, "Emitting metric count for \"%s\": %lld", name.c_str() , val - record.prevVal);
record.prevVal = val;
break;
}
case StatsD_Type::STATSD_COUNTER_STRING: {
// parse val string
const char *pNewLine = strchr(pchValue, '\r');
if (pNewLine == nullptr) {
pNewLine = strchr(pchValue, '\n');
}
if (pNewLine == nullptr) {
g_stats->increment("STATSD_COUNTER_STRING_failed", 1);
return;
}
std::string val(pchValue, pNewLine - pchValue);
std::replace(val.begin(), val.end(), '.', '-');
// metrics emit
std::string metricsName = name + g_string_counter_separator + val;
g_stats->increment(metricsName, 1);
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_DEBUG, "Emitting metric \"%s\"", metricsName.c_str());
break;
}
default:
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_WARNING, "Unknown stats record type for the key \"%s\": %u", name.c_str(), (unsigned)record.type);
break;
}
}
void handleErrorStatItem(struct RedisModuleCtx *ctx, std::string name, std::string rest) {
size_t idx = rest.find('=');
if (idx != std::string::npos) {
std::string statValue = rest.substr(idx + 1);
long long val = strtoll(statValue.c_str(), nullptr, 10);
g_stats->gauge(name, val);
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_DEBUG, "Emitting metric \"%s\": %lld", name.c_str(), val);
} else {
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_WARNING, "Unexpected errorstat line format returned by \"INFO\" command: \"%s\"", (name + rest).c_str());
}
}
void handleReplicaOrDbInfoItem(struct RedisModuleCtx *ctx, std::string name, std::string rest) {
//use a stringstream to extract each metric of the form <name>=<value>
std::stringstream metrics(rest);
while (metrics.good()) {
std::string metric;
std::getline(metrics, metric, ',');
size_t idx = metric.find('=');
if (idx != std::string::npos) {
std::string stat = metric.substr(0, idx);
std::string statName = name + '-' + stat;
//idx + 1 to ignore the = sign
std::string statValue = metric.substr(idx + 1);
// string values
if (stat == "ip" || stat == "state") {
std::replace(statValue.begin(), statValue.end(), '.', '-');
statName += g_string_counter_separator + statValue;
g_stats->increment(statName, 1);
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_DEBUG, "Emitting metric \"%s\"", statName.c_str());
} else {
long long val = strtoll(statValue.c_str(), nullptr, 10);
g_stats->gauge(statName, val);
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_DEBUG, "Emitting metric \"%s\": %lld", statName.c_str(), val);
}
}
}
}
void handle_info_response(struct RedisModuleCtx *ctx, const char *szReply, size_t len, const char *command) {
#define SAFETY_CHECK_POINTER(_p) ((_p) < (szReply + len))
// Parse the INFO reply string line by line
const char *pchLineStart = szReply;
while (SAFETY_CHECK_POINTER(pchLineStart) && *pchLineStart != '\0') {
// Loop Each Line
const char *pchColon = pchLineStart;
while (SAFETY_CHECK_POINTER(pchColon) && *pchColon != ':' && *pchColon != '\r') {
++pchColon;
}
if (!SAFETY_CHECK_POINTER(pchColon)) {
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_WARNING, "Unexpected line termination when parsing response from %s command: \"%s\"", command, pchLineStart);
break; // BUG
}
const char *pchLineEnd = pchColon;
while (SAFETY_CHECK_POINTER(pchLineEnd) && *pchLineEnd != '\n')
++pchLineEnd;
std::string strCheck(pchLineStart, pchColon - pchLineStart);
if (strCheck.find("errorstat_") != std::string::npos) {
std::string remainder(pchColon + 1, pchLineEnd - (pchColon + 1));
handleErrorStatItem(ctx, strCheck, remainder);
} else if (std::regex_match(strCheck, g_replica_or_db_info_regex)) {
std::string remainder(pchColon + 1, pchLineEnd - (pchColon + 1));
handleReplicaOrDbInfoItem(ctx, strCheck, remainder);
} else {
auto itr = g_mapInfoFields.find(strCheck);
if (itr != g_mapInfoFields.end()) {
// This is an info field we care about
if (itr->second.szAlternate != nullptr)
strCheck = itr->second.szAlternate;
handleStatItem(ctx, strCheck, itr->second, pchColon+1);
}
}
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_DEBUG, "INFO response line: \"%s\"", std::string(pchLineStart, pchLineEnd - pchLineStart).c_str());
pchLineStart = pchLineEnd + 1; // start of next line, if we're over the loop will catch it
}
#undef SAFETY_CHECK_POINTER
}
void handle_cluster_nodes_response(struct RedisModuleCtx *ctx, const char *szReply, size_t len) {
#define SAFETY_CHECK_POINTER(_p) ((_p) < (szReply + len))
const char *pchLineStart = szReply;
long long primaries = 0;
long long replicas = 0;
while (SAFETY_CHECK_POINTER(pchLineStart) && *pchLineStart != '\0') {
// Loop Each Line
const char *pchLineEnd = pchLineStart;
while (SAFETY_CHECK_POINTER(pchLineEnd) && (*pchLineEnd != '\r') && (*pchLineEnd != '\n')) {
++pchLineEnd;
}
std::string line(pchLineStart, pchLineEnd - pchLineStart);
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_DEBUG, "Cluster Nodes Line: \"%s\"", line.c_str());
if (std::string::npos != line.find("master")) {
++primaries;
} else if (std::string::npos != line.find("slave")) {
++replicas;
} else {
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_WARNING, "Unexpected NODE format returned by \"CLUSTER NODES\" command: \"%s\"", line.c_str());
}
// emit myself stat
if (line.find("myself") != std::string::npos) {
size_t firstSpaceIdx = line.find(' ');
// emit cluster node id
if (firstSpaceIdx != std::string::npos) {
std::string nodeIdStat = "cluster_node_id";
nodeIdStat += g_string_counter_separator + line.substr(0, firstSpaceIdx);
g_stats->increment(nodeIdStat);
}
// emit node ip
size_t firstColonIdx = line.find(':');
if (firstColonIdx != std::string::npos) {
std::string nodeIpStat = "cluster_node_ip";
std::string nodeIP = line.substr(firstSpaceIdx+1, firstColonIdx-firstSpaceIdx-1);
std::replace(nodeIP.begin(), nodeIP.end(), '.', '-');
nodeIpStat += g_string_counter_separator + nodeIP;
g_stats->increment(nodeIpStat);
}
}
pchLineStart = pchLineEnd;
while (SAFETY_CHECK_POINTER(pchLineStart) && ((*pchLineStart == '\r') || (*pchLineStart == '\n'))) {
++pchLineStart;
}
}
g_stats->gauge("primaries", primaries);
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_DEBUG, "Emitting metric \"primaries\": %llu", primaries);
g_stats->gauge("replicas", replicas);
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_DEBUG, "Emitting metric \"replicas\": %llu", replicas);
#undef SAFETY_CHECK_POINTER
}
void handle_client_list_response(struct RedisModuleCtx *ctx, const char *szReply, size_t len) {
size_t totalClientOutputBuffer = 0;
size_t totalReplicaClientOutputBuffer = 0;
#define SAFETY_CHECK_POINTER(_p) ((_p) < (szReply + len))
const char *pchLineStart = szReply;
while (SAFETY_CHECK_POINTER(pchLineStart) && *pchLineStart != '\0') {
// Loop Each Line
const char *pchLineEnd = pchLineStart;
while (SAFETY_CHECK_POINTER(pchLineEnd) && (*pchLineEnd != '\r') && (*pchLineEnd != '\n')) {
++pchLineEnd;
}
std::string line(pchLineStart, pchLineEnd - pchLineStart);
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_DEBUG, "Client List Line: \"%s\"", line.c_str());
// recover output buffer size for client
bool lineFailed = false;
bool replica = line.find("flags=S") != std::string::npos;
size_t idx = line.find("omem");
if (!(lineFailed = (idx == std::string::npos))) {
std::string rest = line.substr(idx);
size_t startIdx = rest.find("=");
if (!(lineFailed = (startIdx == std::string::npos))) {
size_t endIdx = rest.find(" ");
if (!(lineFailed = (endIdx == std::string::npos))) {
// use startIdx + 1 and endIdx - 1 to exclude the '=' and ' ' characters
std::string valueString = rest.substr(startIdx + 1, (endIdx - 1) - (startIdx + 1));
size_t value = strtoll(valueString.c_str(), nullptr, 10);
totalClientOutputBuffer += value;
if (replica) {
totalReplicaClientOutputBuffer += value;
}
}
}
}
if (lineFailed) {
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_WARNING, "Unexpected CLIENT format returned by \"CLIENT LIST\" command: \"%s\"", line.c_str());
}
pchLineStart = pchLineEnd;
while (SAFETY_CHECK_POINTER(pchLineStart) && ((*pchLineStart == '\r') || (*pchLineStart == '\n'))) {
++pchLineStart;
}
}
#undef SAFETY_CHECK_POINTER
g_stats->gauge("total_client_output_buffer", totalClientOutputBuffer);
g_stats->gauge("total_replica_client_output_buffer", totalReplicaClientOutputBuffer);
}
void emit_system_free_memory() {
std::ifstream meminfo("/proc/meminfo");
std::string line;
while (std::getline(meminfo, line)) {
if (line.find("MemAvailable:") != std::string::npos) {
unsigned long memAvailableInKB;
std::sscanf(line.c_str(), "MemAvailable: %lu kB", &memAvailableInKB);
g_stats->gauge("systemAvailableMemory_MB", memAvailableInKB / 1024);
return;
}
}
}
void emit_metrics_for_insufficient_replicas(struct RedisModuleCtx *ctx, long long keys) {
// non-empty
if (keys <= 0) {
return;
}
RedisModuleCallReply *reply = RedisModule_Call(ctx, "ROLE", "");
if (RedisModule_CallReplyType(reply) != REDISMODULE_REPLY_ARRAY) {
RedisModule_FreeCallReply(reply);
return;
}
RedisModuleCallReply *roleReply = RedisModule_CallReplyArrayElement(reply, 0);
if (RedisModule_CallReplyType(roleReply) != REDISMODULE_REPLY_STRING) {
RedisModule_FreeCallReply(reply);
return;
}
size_t len;
const char *role = RedisModule_CallReplyStringPtr(roleReply, &len);
// check if the current node is a primary
if (strncmp(role, "master", len) == 0) {
RedisModuleCallReply *replicasReply = RedisModule_CallReplyArrayElement(reply, 2);
// check if there are less than 2 connected replicas
if (RedisModule_CallReplyLength(replicasReply) < EXPECTED_NUMBER_OF_REPLICAS) {
g_stats->increment("lessThanExpectedReplicas_error", 1);
}
}
RedisModule_FreeCallReply(reply);
}
void event_cron_handler(struct RedisModuleCtx *ctx, RedisModuleEvent eid, uint64_t subevent, void *data) {
static time_t lastTime = 0;
time_t curTime = time(nullptr);
if ((curTime - lastTime) > c_infoUpdateSeconds) {
size_t startTime = ustime();
#ifdef __linux__
/* Log CPU Usage */
static long long s_mscpuLast = 0;
struct rusage self_ru;
getrusage(RUSAGE_SELF, &self_ru);
long long mscpuCur = (self_ru.ru_utime.tv_sec * 1000) + (self_ru.ru_utime.tv_usec / 1000)
+ (self_ru.ru_stime.tv_sec * 1000) + (self_ru.ru_stime.tv_usec / 1000);
g_stats->gauge("cpu_load_perc", ((double)(mscpuCur - s_mscpuLast) / ((curTime - lastTime)*1000))*100, false /* prefixOnly */);
s_mscpuLast = mscpuCur;
#endif
/* Log clients */
g_stats->gauge("clients", g_cclients);
/* node name */
if (unameResult == 0) {
g_stats->increment("node_name" + std::string(g_string_counter_separator) + nodeName);
}
/* Log INFO Fields */
size_t commandStartTime = ustime();
RedisModuleCallReply *reply = RedisModule_Call(ctx, "INFO", "");
size_t len = 0;
const char *szReply = RedisModule_CallReplyStringPtr(reply, &len);
g_stats->timing("info_time_taken_us", ustime() - commandStartTime);
commandStartTime = ustime();
handle_info_response(ctx, szReply, len, "INFO");
g_stats->timing("handle_info_time_taken_us", ustime() - commandStartTime);
RedisModule_FreeCallReply(reply);
/* Log CLUSTER INFO Fields */
commandStartTime = ustime();
reply = RedisModule_Call(ctx, "CLUSTER", "c", "INFO");
szReply = RedisModule_CallReplyStringPtr(reply, &len);
g_stats->timing("cluster_info_time_taken_us", ustime() - commandStartTime);
commandStartTime = ustime();
handle_info_response(ctx, szReply, len, "CLUSTER INFO");
g_stats->timing("handle_cluster_info_time_taken_us", ustime() - commandStartTime);
RedisModule_FreeCallReply(reply);
/* Log Cluster Topology */
commandStartTime = ustime();
reply = RedisModule_Call(ctx, "CLUSTER", "c", "NODES");
szReply = RedisModule_CallReplyStringPtr(reply, &len);
g_stats->timing("cluster_nodes_time_taken_us", ustime() - commandStartTime);
commandStartTime = ustime();
handle_cluster_nodes_response(ctx, szReply, len);
g_stats->timing("handle_cluster_nodes_time_taken_us", ustime() - commandStartTime);
RedisModule_FreeCallReply(reply);
/* Log Client Info */
// commandStartTime = ustime();
// reply = RedisModule_Call(ctx, "CLIENT", "c", "LIST");
// szReply = RedisModule_CallReplyStringPtr(reply, &len);
// g_stats->timing("client_info_time_taken_us", ustime() - commandStartTime);
// commandStartTime = ustime();
// handle_client_list_response(ctx, szReply, len);
// g_stats->timing("handle_client_info_time_taken_us", ustime() - commandStartTime);
// RedisModule_FreeCallReply(reply);
commandStartTime = ustime();
emit_system_free_memory();
g_stats->timing("emit_free_system_memory_time_taken_us", ustime() - commandStartTime);
/* Log Keys */
commandStartTime = ustime();
reply = RedisModule_Call(ctx, "dbsize", "");
long long keys = RedisModule_CallReplyInteger(reply);
RedisModule_FreeCallReply(reply);
g_stats->gauge("keys", keys, false /* prefixOnly */);
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_DEBUG, "Emitting metric \"keys\": %llu", keys);
g_stats->timing("emit_keys_metric_time_taken_us", ustime() - commandStartTime);
emit_metrics_for_insufficient_replicas(ctx, keys);
g_stats->timing("metrics_time_taken_us", ustime() - startTime);
lastTime = curTime;
}
}
extern "C" int RedisModule_OnLoad(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
if (RedisModule_Init(ctx,"statsd",1,REDISMODULE_APIVER_1) == REDISMODULE_ERR)
return REDISMODULE_ERR;
RedisModule_AutoMemory(ctx);
/* Use pod name if available*/
const char *podName = getenv("POD_NAME");
utsname sysName;
unameResult = uname(&sysName);
if (unameResult == 0) {
nodeName = std::string(sysName.nodename);
std::replace(nodeName.begin(), nodeName.end(), '.', '-');
}
if (podName != nullptr) {
m_strPrefix = podName;
std::replace(m_strPrefix.begin(), m_strPrefix.end(), '.', '-');
}
else if (unameResult == 0) {
m_strPrefix = nodeName;
unameResult = 1;
}
for (int iarg = 0; iarg < argc; ++iarg) {
size_t len = 0;
const char *rgchArg = RedisModule_StringPtrLen(argv[iarg], &len);
if (len == 6 && memcmp(rgchArg, "prefix", 6) == 0) {
if ((iarg+1) >= argc) {
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_WARNING, "Expected a value after 'prefix'");
return REDISMODULE_ERR;
}
++iarg;
size_t lenPrefix = 0;
const char *rgchPrefix = RedisModule_StringPtrLen(argv[iarg], &lenPrefix);
m_strPrefix = std::string(rgchPrefix, lenPrefix);
} else {
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_WARNING, "Unrecognized configuration flag");
return REDISMODULE_ERR;
}
}
g_stats = new StatsdClientWrapper("localhost", 8125, m_strPrefix, g_stats_buffer_size_bytes, c_infoUpdateSeconds * 1000);
if (RedisModule_SubscribeToServerEvent(ctx, RedisModuleEvent_ClientChange, event_client_change_handler) == REDISMODULE_ERR)
return REDISMODULE_ERR;
if (RedisModule_SubscribeToServerEvent(ctx, RedisModuleEvent_CronLoop, event_cron_handler) == REDISMODULE_ERR)
return REDISMODULE_ERR;
return REDISMODULE_OK;
}
extern "C" int RedisModule_OnUnload(RedisModuleCtx *ctx) {
delete g_stats;
return REDISMODULE_OK;
}
File diff suppressed because it is too large. Load diff
+5 -5
View File
@@ -118,14 +118,14 @@ void discardCommand(client *c) {
void beforePropagateMulti() {
/* Propagating MULTI */
serverAssert(!serverTL->propagate_in_transaction);
serverTL->propagate_in_transaction = 1;
serverAssert(!g_pserver->propagate_in_transaction);
g_pserver->propagate_in_transaction = 1;
}
void afterPropagateExec() {
/* Propagating EXEC */
serverAssert(serverTL->propagate_in_transaction == 1);
serverTL->propagate_in_transaction = 0;
serverAssert(g_pserver->propagate_in_transaction == 1);
g_pserver->propagate_in_transaction = 0;
}
/* Send a MULTI command to all the slaves and AOF file. Check the execCommand
@@ -264,7 +264,7 @@ void execCommand(client *c) {
/* Make sure the EXEC command will be propagated as well if MULTI
* was already propagated. */
if (serverTL->propagate_in_transaction) {
if (g_pserver->propagate_in_transaction) {
int is_master = listLength(g_pserver->masters) == 0;
g_pserver->dirty++;
/* If inside the MULTI/EXEC block this instance was suddenly
+27 -36
View File
@@ -145,7 +145,7 @@ client *createClient(connection *conn, int iel) {
client_id = g_pserver->next_client_id.fetch_add(1);
c->iel = iel;
c->id = client_id;
snprintf(c->lock.szName, sizeof(c->lock.szName), "client %" PRIu64, client_id);
sprintf(c->lock.szName, "client %" PRIu64, client_id);
c->resp = 2;
c->conn = conn;
c->name = NULL;
@@ -777,11 +777,11 @@ void setDeferredAggregateLen(client *c, void *node, long length, char prefix) {
* we return NULL in addReplyDeferredLen() */
if (node == NULL) return;
char lenstr[128];
size_t lenstr_len = snprintf(lenstr, sizeof(lenstr), "%c%ld\r\n", prefix, length);
size_t lenstr_len = sprintf(lenstr, "%c%ld\r\n", prefix, length);
setDeferredReply(c, node, lenstr, lenstr_len);
} else {
char lenstr[128];
int lenstr_len = snprintf(lenstr, sizeof(lenstr), "%c%ld\r\n", prefix, length);
int lenstr_len = sprintf(lenstr, "%c%ld\r\n", prefix, length);
size_t idxSplice = (size_t)node;
serverAssert(idxSplice <= c->replyAsync->used);
@@ -1177,11 +1177,6 @@ int chooseBestThreadForAccept()
void clientAcceptHandler(connection *conn) {
client *c = (client*)connGetPrivateData(conn);
if (conn->flags & CONN_FLAG_AUDIT_LOGGING_REQUIRED) {
c->flags |= CLIENT_AUDIT_LOGGING;
c->fprint = conn->fprint;
}
if (connGetState(conn) != CONN_STATE_CONNECTED) {
serverLog(LL_WARNING,
"Error accepting a client connection: %s",
@@ -1245,7 +1240,6 @@ void clientAcceptHandler(connection *conn) {
#define MAX_ACCEPTS_PER_CALL 1000
#define MAX_ACCEPTS_PER_CALL_TLS 100
static void acceptCommonHandler(connection *conn, int flags, char *ip, int iel) {
client *c;
char conninfo[100];
@@ -1282,27 +1276,24 @@ static void acceptCommonHandler(connection *conn, int flags, char *ip, int iel)
* called, because we don't want to even start transport-level negotiation
* if rejected. */
if (listLength(g_pserver->clients) + getClusterConnectionsCount()
>= (g_pserver->maxclients - g_pserver->maxclientsReserved))
>= g_pserver->maxclients)
{
// Allow the connection if it comes from localhost and we're within the maxclientReserved buffer range
if ((listLength(g_pserver->clients) + getClusterConnectionsCount()) >= g_pserver->maxclients || strcmp("127.0.0.1", ip)) {
const char *err;
if (g_pserver->cluster_enabled)
err = "-ERR max number of clients + cluster "
"connections reached\r\n";
else
err = "-ERR max number of clients reached\r\n";
const char *err;
if (g_pserver->cluster_enabled)
err = "-ERR max number of clients + cluster "
"connections reached\r\n";
else
err = "-ERR max number of clients reached\r\n";
/* That's a best effort error message, don't check write errors.
* Note that for TLS connections, no handshake was done yet so nothing
* is written and the connection will just drop. */
if (connWrite(conn,err,strlen(err)) == -1) {
/* Nothing to do, Just to avoid the warning... */
}
g_pserver->stat_rejected_conn++;
connClose(conn);
return;
/* That's a best effort error message, don't check write errors.
* Note that for TLS connections, no handshake was done yet so nothing
* is written and the connection will just drop. */
if (connWrite(conn,err,strlen(err)) == -1) {
/* Nothing to do, Just to avoid the warning... */
}
g_pserver->stat_rejected_conn++;
connClose(conn);
return;
}
/* Create connection and client */
@@ -2604,7 +2595,9 @@ void parseClientCommandBuffer(client *c) {
(g_pserver->m_pstorageFactory || aeLockContested(cserver.cthreads/2) || cserver.cthreads == 1) && !GlobalLocksAcquired()) {
auto &query = c->vecqueuedcmd.back();
if (query.argc > 0 && query.argc == query.argcMax) {
c->db->prefetchKeysAsync(c, query);
if (c->db->prefetchKeysAsync(c, query, c->vecqueuedcmd.size() == 1)) {
c->vecqueuedcmd.erase(c->vecqueuedcmd.begin());
}
}
}
c->reqtype = 0;
@@ -2762,7 +2755,7 @@ void readQueryFromClient(connection *conn) {
if (cserver.cthreads > 1 || g_pserver->m_pstorageFactory) {
parseClientCommandBuffer(c);
if (g_pserver->enable_async_commands && !serverTL->disable_async_commands && listLength(g_pserver->monitors) == 0 && (aeLockContention() || serverTL->rgdbSnapshot[c->db->id] || g_fTestMode) && !serverTL->in_eval && !serverTL->in_exec) {
if (g_pserver->enable_async_commands && !serverTL->disable_async_commands && listLength(g_pserver->monitors) == 0 && (aeLockContention() || serverTL->rgdbSnapshot[c->db->id] || g_fTestMode)) {
// Frequent writers aren't good candidates for this optimization, they cause us to renew the snapshot too often
// so we exclude them unless the snapshot we need already exists.
// Note: In test mode we want to create snapshots as often as possibl to excercise them - we don't care about perf
@@ -3257,18 +3250,16 @@ NULL
}
else
{
int iel = client->iel;
freeClientAsync(client);
aePostFunction(g_pserver->rgthreadvar[client->iel].el, [iel] { // note: failure is OK
freeClientsInAsyncFreeQueue(iel);
});
}
}
killed++;
}
for (int iel = 0; iel < cserver.cthreads; ++iel) {
aePostFunction(g_pserver->rgthreadvar[iel].el, [iel] { // note: failure is OK
freeClientsInAsyncFreeQueue(iel);
});
}
/* Reply according to old/new format. */
if (c->argc == 3) {
if (killed == 0)
@@ -4006,7 +3997,7 @@ void pauseClients(mstime_t end, pause_type type) {
* to track this state so that we don't assert
* in propagate(). */
if (serverTL->in_exec) {
serverTL->client_pause_in_transaction = 1;
g_pserver->client_pause_in_transaction = 1;
}
}
+7
View File
@@ -41,3 +41,10 @@ void operator delete(void *p, std::size_t) noexcept
}
#endif
#if defined(USE_JEMALLOC)
extern "C" size_t malloc_usable_size(void *ptr)
{
return zmalloc_usable_size(ptr);
}
#endif
+13 -5
View File
@@ -46,7 +46,6 @@ robj *createObject(int type, void *ptr) {
char *oB = (char*)zcalloc(sizeof(robj)+mvccExtraBytes, MALLOC_SHARED);
robj *o = reinterpret_cast<robj*>(oB + mvccExtraBytes);
new (o) redisObject;
o->type = type;
o->encoding = OBJ_ENCODING_RAW;
o->m_ptr = ptr;
@@ -419,7 +418,6 @@ void decrRefCount(robj_roptr o) {
case OBJ_NESTEDHASH: freeNestedHashObject(o); break;
default: serverPanic("Unknown object type"); break;
}
o->~redisObject();
if (g_pserver->fActiveReplica) {
zfree(reinterpret_cast<redisObjectExtended*>(o.unsafe_robjcast())-1);
} else {
@@ -1143,7 +1141,10 @@ struct redisMemOverhead *getMemoryOverheadData(void) {
mh->db[mh->num_dbs].overhead_ht_main = mem;
mem_total+=mem;
mh->db[mh->num_dbs].overhead_ht_expires = 0;
std::unique_lock<fastlock> ul(g_expireLock);
mem = db->setexpire()->estimated_bytes_used();
mh->db[mh->num_dbs].overhead_ht_expires = mem;
mem_total+=mem;
mh->num_dbs++;
}
@@ -1540,7 +1541,7 @@ void memoryCommand(client *c) {
} else if (!strcasecmp(szFromObj(c->argv[1]),"malloc-stats") && c->argc == 2) {
#if defined(USE_JEMALLOC)
sds info = sdsempty();
malloc_stats_print(inputCatSds, &info, NULL);
je_malloc_stats_print(inputCatSds, &info, NULL);
addReplyVerbatim(c,info,sdslen(info),"txt");
sdsfree(info);
#else
@@ -1627,7 +1628,7 @@ robj *deserializeStoredStringObject(const char *data, size_t cb)
return newObject;
}
robj *deserializeStoredObject(const void *data, size_t cb)
robj *deserializeStoredObjectCore(const void *data, size_t cb)
{
switch (((char*)data)[0])
{
@@ -1664,6 +1665,13 @@ robj *deserializeStoredObject(const void *data, size_t cb)
serverPanic("Unknown object type loading from storage");
}
robj *deserializeStoredObject(const redisDbPersistentData *db, const char *key, const void *data, size_t cb)
{
robj *o = deserializeStoredObjectCore(data, cb);
o->SetFExpires(db->setexpire()->exists(key));
return o;
}
sds serializeStoredObject(robj_roptr o, sds sdsPrefix)
{
switch (o->type)
+67 -139
View File
@@ -1163,7 +1163,7 @@ int rdbSaveKeyValuePair(rio *rdb, robj_roptr key, robj_roptr val, const expireEn
char szT[32];
if (g_pserver->fActiveReplica) {
snprintf(szT, sizeof(szT), "%" PRIu64, mvccFromObj(val));
snprintf(szT, 32, "%" PRIu64, mvccFromObj(val));
if (rdbSaveAuxFieldStrStr(rdb,"mvcc-tstamp", szT) == -1) return -1;
}
@@ -1190,7 +1190,7 @@ int rdbSaveKeyValuePair(rio *rdb, robj_roptr key, robj_roptr val, const expireEn
{
if (itr.subkey() == nullptr)
continue; // already saved
snprintf(szT, sizeof(szT), "%lld", itr.when());
snprintf(szT, 32, "%lld", itr.when());
rdbSaveAuxFieldStrStr(rdb,"keydb-subexpire-key",itr.subkey());
rdbSaveAuxFieldStrStr(rdb,"keydb-subexpire-when",szT);
}
@@ -1237,14 +1237,18 @@ int rdbSaveInfoAuxFields(rio *rdb, int rdbflags, rdbSaveInfo *rsi) {
return 1;
}
int saveKey(rio *rdb, int flags, size_t *processed, const char *keystr, robj_roptr o)
int saveKey(rio *rdb, const redisDbPersistentDataSnapshot *db, int flags, size_t *processed, const char *keystr, robj_roptr o)
{
redisObjectStack key;
initStaticStringObject(key,(char*)keystr);
std::unique_lock<fastlock> ul(g_expireLock, std::defer_lock);
const expireEntry *pexpire = nullptr;
if (o->FExpires()) {
pexpire = &o->expire;
if (o->FExpires())
{
ul.lock();
pexpire = db->getExpire(&key);
serverAssert((o->FExpires() && pexpire != nullptr) || (!o->FExpires() && pexpire == nullptr));
}
if (rdbSaveKeyValuePair(rdb,&key,o,pexpire) == -1)
@@ -1330,7 +1334,7 @@ int rdbSaveRio(rio *rdb, const redisDbPersistentDataSnapshot **rgpdb, int *error
if (rdbSaveModulesAux(rdb, REDISMODULE_AUX_BEFORE_RDB) == -1) goto werr;
for (j = 0; j < cserver.dbnum; j++) {
const redisDbPersistentDataSnapshot *db = rgpdb != nullptr ? rgpdb[j] : g_pserver->db[j];
const redisDbPersistentDataSnapshot *db = rgpdb[j];
if (db->size() == 0) continue;
/* Write the SELECT DB opcode */
@@ -1351,7 +1355,7 @@ int rdbSaveRio(rio *rdb, const redisDbPersistentDataSnapshot **rgpdb, int *error
if (o->FExpires())
++ckeysExpired;
if (!saveKey(rdb, rdbflags, &processed, keystr, o))
if (!saveKey(rdb, db, rdbflags, &processed, keystr, o))
return false;
/* Update child info every 1 second (approximately).
@@ -1486,7 +1490,7 @@ int rdbSaveFile(char *filename, const redisDbPersistentDataSnapshot **rgpdb, rdb
rio rdb;
int error = 0;
getTempFileName(tmpfile, g_pserver->rdbThreadVars.tmpfileNum);
snprintf(tmpfile,256,"temp-%d-%d.rdb", getpid(), g_pserver->rdbThreadVars.tmpfileNum);
fp = fopen(tmpfile,"w");
if (!fp) {
char *cwdp = getcwd(cwd,MAXPATHLEN);
@@ -1656,14 +1660,12 @@ int launchRdbSaveThread(pthread_t &child, rdbSaveInfo *rsi)
pthread_attr_t tattr;
pthread_attr_init(&tattr);
pthread_attr_setstacksize(&tattr, 1 << 23); // 8 MB
openChildInfoPipe();
if (pthread_create(&child, &tattr, rdbSaveThread, args)) {
pthread_attr_destroy(&tattr);
for (int idb = 0; idb < cserver.dbnum; ++idb)
g_pserver->db[idb]->endSnapshot(args->rgpdb[idb]);
args->~rdbSaveThreadArgs();
zfree(args);
closeChildInfoPipe();
return C_ERR;
}
pthread_attr_destroy(&tattr);
@@ -1677,23 +1679,24 @@ int rdbSaveBackground(rdbSaveInfo *rsi) {
pthread_t child;
long long start;
if (hasActiveChildProcessOrBGSave()) return C_ERR;
if (hasActiveChildProcess()) return C_ERR;
g_pserver->dirty_before_bgsave = g_pserver->dirty;
g_pserver->lastbgsave_try = time(NULL);
openChildInfoPipe();
start = ustime();
latencyStartMonitor(g_pserver->rdb_save_latency);
g_pserver->stat_fork_time = ustime()-start;
g_pserver->stat_fork_rate = (double) zmalloc_used_memory() * 1000000 / g_pserver->stat_fork_time / (1024*1024*1024); /* GB per second. */
if (launchRdbSaveThread(child, rsi) != C_OK) {
closeChildInfoPipe();
g_pserver->lastbgsave_status = C_ERR;
serverLog(LL_WARNING,"Can't save in background: fork: %s",
strerror(errno));
return C_ERR;
}
g_pserver->stat_fork_time = ustime()-start;
g_pserver->stat_fork_rate = (double) zmalloc_used_memory() * 1000000 / g_pserver->stat_fork_time / (1024*1024*1024); /* GB per second. */
latencyAddSampleIfNeeded("fork",g_pserver->stat_fork_time/1000);
serverLog(LL_NOTICE,"Background saving started");
g_pserver->rdb_save_time_start = time(NULL);
@@ -1711,7 +1714,7 @@ void getTempFileName(char tmpfile[], int tmpfileNum) {
char tmpfileNumString[214];
/* Generate temp rdb file name using aync-signal safe functions. */
int pid_len = ll2string(pid, sizeof(pid), g_pserver->in_fork_child ? getppid() : getpid());
int pid_len = ll2string(pid, sizeof(pid), getpid());
int tmpfileNum_len = ll2string(tmpfileNumString, sizeof(tmpfileNumString), tmpfileNum);
strcpy(tmpfile, "temp-");
strncpy(tmpfile+5, pid, pid_len);
@@ -2542,7 +2545,7 @@ robj *rdbLoadObject(int rdbtype, rio *rdb, sds key, int *error, uint64_t mvcc_ts
* encoding version in the lower 10 bits of the module ID. */
void *ptr = mt->rdb_load(&io,moduleid&1023);
if (io.ctx) {
moduleFreeContext(io.ctx, false /* propogate */);
moduleFreeContext(io.ctx);
zfree(io.ctx);
}
@@ -3598,8 +3601,6 @@ static void backgroundSaveDoneHandlerDisk(int exitcode, bool fCancelled) {
g_pserver->dirty = g_pserver->dirty - g_pserver->dirty_before_bgsave;
g_pserver->lastsave = time(NULL);
g_pserver->lastbgsave_status = C_OK;
latencyEndMonitor(g_pserver->rdb_save_latency);
latencyAddSampleIfNeeded("rdb-save",g_pserver->rdb_save_latency);
} else if (!fCancelled && exitcode != 0) {
serverLog(LL_WARNING, "Background saving error");
g_pserver->lastbgsave_status = C_ERR;
@@ -3690,7 +3691,7 @@ void killRDBChild(bool fSynchronous) {
serverAssert(GlobalLocksAcquired());
if (cserver.fForkBgSave) {
kill(g_pserver->child_pid,SIGUSR1);
kill(g_pserver->rdb_child_pid,SIGUSR1);
} else {
g_pserver->rdbThreadVars.fRdbThreadCancel = true;
if (g_pserver->rdb_child_type == RDB_CHILD_TYPE_SOCKET) {
@@ -3781,7 +3782,7 @@ int rdbSaveToSlavesSockets(rdbSaveInfo *rsi) {
int pipefds[2];
rdbSaveSocketThreadArgs *args = nullptr;
if (hasActiveChildProcessOrBGSave()) return C_ERR;
if (hasActiveChildProcess()) return C_ERR;
/* Even if the previous fork child exited, don't start a new one until we
* drained the pipe. */
@@ -3828,130 +3829,57 @@ int rdbSaveToSlavesSockets(rdbSaveInfo *rsi) {
}
/* Create the child process. */
if (cserver.fForkBgSave) {
pid_t childpid;
if ((childpid = redisFork(CHILD_TYPE_RDB)) == 0) {
/* Child */
int retval, dummy;
rio rdb;
openChildInfoPipe();
rioInitWithFd(&rdb,args->rdb_pipe_write);
for (int idb = 0; idb < cserver.dbnum; ++idb)
args->rgpdb[idb] = g_pserver->db[idb]->createSnapshot(getMvccTstamp(), false /*fOptional*/);
redisSetProcTitle("keydb-rdb-to-slaves");
redisSetCpuAffinity(g_pserver->bgsave_cpulist);
retval = rdbSaveRioWithEOFMark(&rdb,nullptr,nullptr,rsi);
if (retval == C_OK && rioFlush(&rdb) == 0)
retval = C_ERR;
if (retval == C_OK) {
sendChildCowInfo(CHILD_INFO_TYPE_RDB_COW_SIZE, "RDB");
}
rioFreeFd(&rdb);
/* wake up the reader, tell it we're done. */
close(args->rdb_pipe_write);
close(g_pserver->rdb_child_exit_pipe); /* close write end so that we can detect the close on the parent. */
/* hold exit until the parent tells us it's safe. we're not expecting
* to read anything, just get the error when the pipe is closed. */
dummy = read(args->safe_to_exit_pipe, pipefds, 1);
UNUSED(dummy);
exitFromChild((retval == C_OK) ? 0 : 1);
} else {
/* Parent */
close(args->safe_to_exit_pipe);
if (childpid == -1) {
serverLog(LL_WARNING,"Can't save in background: fork: %s",
strerror(errno));
/* Undo the state change. The caller will perform cleanup on
* all the slaves in BGSAVE_START state, but an early call to
* replicationSetupSlaveForFullResync() turned it into BGSAVE_END */
listRewind(g_pserver->slaves,&li);
while((ln = listNext(&li))) {
client *replica = (client*)ln->value;
if (replica->replstate == SLAVE_STATE_WAIT_BGSAVE_END) {
replica->replstate = SLAVE_STATE_WAIT_BGSAVE_START;
}
}
close(args->rdb_pipe_write);
close(g_pserver->rdb_pipe_read);
zfree(g_pserver->rdb_pipe_conns);
g_pserver->rdb_pipe_conns = NULL;
g_pserver->rdb_pipe_numconns = 0;
g_pserver->rdb_pipe_numconns_writing = 0;
args->rsi.~rdbSaveInfo();
zfree(args);
} else {
serverLog(LL_NOTICE,"Background RDB transfer started by pid %ld",
(long)childpid);
g_pserver->rdb_save_time_start = time(NULL);
g_pserver->rdb_child_type = RDB_CHILD_TYPE_SOCKET;
g_pserver->rdbThreadVars.fRdbThreadActive = true;
updateDictResizePolicy();
close(args->rdb_pipe_write); /* close write in parent so that it can detect the close on the child. */
aePostFunction(g_pserver->rgthreadvar[IDX_EVENT_LOOP_MAIN].el, []{
if (aeCreateFileEvent(serverTL->el, g_pserver->rdb_pipe_read, AE_READABLE, rdbPipeReadHandler, nullptr) == AE_ERR) {
serverPanic("Unrecoverable error creating g_pserver->rdb_pipe_read file event.");
}
});
}
return (childpid == -1) ? C_ERR : C_OK;
}
}
else {
openChildInfoPipe();
for (int idb = 0; idb < cserver.dbnum; ++idb)
args->rgpdb[idb] = g_pserver->db[idb]->createSnapshot(getMvccTstamp(), false /*fOptional*/);
g_pserver->rdbThreadVars.tmpfileNum++;
g_pserver->rdbThreadVars.fRdbThreadCancel = false;
pthread_attr_t tattr;
pthread_attr_init(&tattr);
pthread_attr_setstacksize(&tattr, 1 << 23); // 8 MB
if (pthread_create(&child, &tattr, rdbSaveToSlavesSocketsThread, args)) {
pthread_attr_destroy(&tattr);
serverLog(LL_WARNING,"Can't save in background: fork: %s",
strerror(errno));
/* Undo the state change. The caller will perform cleanup on
* all the slaves in BGSAVE_START state, but an early call to
* replicationSetupSlaveForFullResync() turned it into BGSAVE_END */
listRewind(g_pserver->slaves,&li);
while((ln = listNext(&li))) {
client *replica = (client*)ln->value;
if (replica->replstate == SLAVE_STATE_WAIT_BGSAVE_END) {
replica->replstate = SLAVE_STATE_WAIT_BGSAVE_START;
}
}
close(args->rdb_pipe_write);
close(g_pserver->rdb_pipe_read);
zfree(g_pserver->rdb_pipe_conns);
close(args->safe_to_exit_pipe);
g_pserver->rdb_pipe_conns = NULL;
g_pserver->rdb_pipe_numconns = 0;
g_pserver->rdb_pipe_numconns_writing = 0;
args->rsi.~rdbSaveInfo();
zfree(args);
closeChildInfoPipe();
return C_ERR;
}
g_pserver->rdbThreadVars.tmpfileNum++;
g_pserver->rdbThreadVars.fRdbThreadCancel = false;
pthread_attr_t tattr;
pthread_attr_init(&tattr);
pthread_attr_setstacksize(&tattr, 1 << 23); // 8 MB
if (pthread_create(&child, &tattr, rdbSaveToSlavesSocketsThread, args)) {
pthread_attr_destroy(&tattr);
g_pserver->child_type = CHILD_TYPE_RDB;
serverLog(LL_WARNING,"Can't save in background: fork: %s",
strerror(errno));
serverLog(LL_NOTICE,"Background RDB transfer started");
g_pserver->rdb_save_time_start = time(NULL);
serverAssert(!g_pserver->rdbThreadVars.fRdbThreadActive);
g_pserver->rdbThreadVars.rdb_child_thread = child;
g_pserver->rdbThreadVars.fRdbThreadActive = true;
g_pserver->rdb_child_type = RDB_CHILD_TYPE_SOCKET;
aePostFunction(g_pserver->rgthreadvar[IDX_EVENT_LOOP_MAIN].el, []{
if (aeCreateFileEvent(serverTL->el, g_pserver->rdb_pipe_read, AE_READABLE, rdbPipeReadHandler, nullptr) == AE_ERR) {
serverPanic("Unrecoverable error creating server.rdb_pipe_read file event.");
/* Undo the state change. The caller will perform cleanup on
* all the slaves in BGSAVE_START state, but an early call to
* replicationSetupSlaveForFullResync() turned it into BGSAVE_END */
listRewind(g_pserver->slaves,&li);
while((ln = listNext(&li))) {
client *replica = (client*)ln->value;
if (replica->replstate == SLAVE_STATE_WAIT_BGSAVE_END) {
replica->replstate = SLAVE_STATE_WAIT_BGSAVE_START;
}
});
}
close(args->rdb_pipe_write);
close(g_pserver->rdb_pipe_read);
zfree(g_pserver->rdb_pipe_conns);
close(args->safe_to_exit_pipe);
g_pserver->rdb_pipe_conns = NULL;
g_pserver->rdb_pipe_numconns = 0;
g_pserver->rdb_pipe_numconns_writing = 0;
args->rsi.~rdbSaveInfo();
zfree(args);
closeChildInfoPipe();
return C_ERR;
}
pthread_attr_destroy(&tattr);
g_pserver->child_type = CHILD_TYPE_RDB;
serverLog(LL_NOTICE,"Background RDB transfer started");
g_pserver->rdb_save_time_start = time(NULL);
serverAssert(!g_pserver->rdbThreadVars.fRdbThreadActive);
g_pserver->rdbThreadVars.rdb_child_thread = child;
g_pserver->rdbThreadVars.fRdbThreadActive = true;
g_pserver->rdb_child_type = RDB_CHILD_TYPE_SOCKET;
aePostFunction(g_pserver->rgthreadvar[IDX_EVENT_LOOP_MAIN].el, []{
if (aeCreateFileEvent(serverTL->el, g_pserver->rdb_pipe_read, AE_READABLE, rdbPipeReadHandler,NULL) == AE_ERR) {
serverPanic("Unrecoverable error creating server.rdb_pipe_read file event.");
}
});
return C_OK; /* Unreached. */
}
-1
View File
@@ -151,7 +151,6 @@ int rdbLoad(rdbSaveInfo *rsi, int rdbflags);
int rdbLoadFile(const char *filename, rdbSaveInfo *rsi, int rdbflags);
int rdbSaveBackground(rdbSaveInfo *rsi);
int rdbSaveToSlavesSockets(rdbSaveInfo *rsi);
void getTempFileName(char tmpfile[], int tmpfileNum);
void rdbRemoveTempFile(pid_t childpid, int from_signal);
int rdbSave(const redisDbPersistentDataSnapshot **rgpdb, rdbSaveInfo *rsi);
int rdbSaveFile(char *filename, const redisDbPersistentDataSnapshot **rgpdb, rdbSaveInfo *rsi);
+28 -49
View File
@@ -8,46 +8,37 @@ class readWriteLock {
int m_readCount = 0;
int m_writeCount = 0;
bool m_writeWaiting = false;
bool m_multi = true;
public:
readWriteLock(const char *name) : m_readLock(name), m_writeLock(name) {}
void acquireRead() {
std::unique_lock<fastlock> rm(m_readLock, std::defer_lock);
if (m_multi) {
rm.lock();
while (m_writeCount > 0 || m_writeWaiting)
m_cv.wait(rm);
}
std::unique_lock<fastlock> rm(m_readLock);
while (m_writeCount > 0 || m_writeWaiting)
m_cv.wait(rm);
m_readCount++;
}
bool tryAcquireRead() {
std::unique_lock<fastlock> rm(m_readLock, std::defer_lock);
if (m_multi) {
if (!rm.try_lock())
return false;
if (m_writeCount > 0 || m_writeWaiting)
return false;
}
if (!rm.try_lock())
return false;
if (m_writeCount > 0 || m_writeWaiting)
return false;
m_readCount++;
return true;
}
void acquireWrite(bool exclusive = true) {
std::unique_lock<fastlock> rm(m_readLock, std::defer_lock);
if (m_multi) {
rm.lock();
m_writeWaiting = true;
while (m_readCount > 0)
std::unique_lock<fastlock> rm(m_readLock);
m_writeWaiting = true;
while (m_readCount > 0)
m_cv.wait(rm);
if (exclusive) {
/* Another thread might have the write lock while we have the read lock
but won't be able to release it until they can acquire the read lock
so release the read lock and try again instead of waiting to avoid deadlock */
while(!m_writeLock.try_lock())
m_cv.wait(rm);
if (exclusive) {
/* Another thread might have the write lock while we have the internal lock
but won't be able to release it until they can acquire the internal lock
so release the internal lock and try again instead of waiting to avoid deadlock */
while(!m_writeLock.try_lock())
m_cv.wait(rm);
}
}
m_writeCount++;
m_writeWaiting = false;
@@ -60,38 +51,30 @@ public:
bool tryAcquireWrite(bool exclusive = true) {
std::unique_lock<fastlock> rm(m_readLock, std::defer_lock);
if (m_multi) {
if (!rm.try_lock())
if (!rm.try_lock())
return false;
if (m_readCount > 0)
return false;
if (exclusive)
if (!m_writeLock.try_lock())
return false;
if (m_readCount > 0)
return false;
if (exclusive)
if (!m_writeLock.try_lock())
return false;
}
m_writeCount++;
return true;
}
void releaseRead() {
std::unique_lock<fastlock> rm(m_readLock, std::defer_lock);
if (m_multi) {
rm.lock();
m_cv.notify_all();
}
std::unique_lock<fastlock> rm(m_readLock);
m_readCount--;
m_cv.notify_all();
}
void releaseWrite(bool exclusive = true) {
std::unique_lock<fastlock> rm(m_readLock, std::defer_lock);
std::unique_lock<fastlock> rm(m_readLock);
serverAssert(m_writeCount > 0);
if (m_multi) {
rm.lock();
if (exclusive)
m_writeLock.unlock();
m_cv.notify_all();
}
if (exclusive)
m_writeLock.unlock();
m_writeCount--;
m_cv.notify_all();
}
void downgradeWrite(bool exclusive = true) {
@@ -99,10 +82,6 @@ public:
acquireRead();
}
void setMulti(bool multi) {
m_multi = multi;
}
bool hasReader() {
return m_readCount > 0;
}
+2 -2
View File
@@ -445,7 +445,7 @@ extern "C" void clusterManagerWaitForClusterJoin(void) {
int counter = 0,
check_after = CLUSTER_JOIN_CHECK_AFTER +
(int)(listLength(cluster_manager.nodes) * 0.15f);
while(!clusterManagerIsConfigConsistent(0 /*fLog*/)) {
while(!clusterManagerIsConfigConsistent()) {
printf(".");
fflush(stdout);
sleep(1);
@@ -588,7 +588,7 @@ extern "C" int clusterManagerCheckCluster(int quiet) {
int do_fix = config.cluster_manager_command.flags &
CLUSTER_MANAGER_CMD_FLAG_FIX;
if (!quiet) clusterManagerShowNodes();
consistent = clusterManagerIsConfigConsistent(1 /*fLog*/);
consistent = clusterManagerIsConfigConsistent();
if (!consistent) {
sds err = sdsnew("[ERR] Nodes don't agree about configuration!");
clusterManagerOnError(err);
+19 -28
View File
@@ -1618,8 +1618,6 @@ static int parseOptions(int argc, char **argv) {
fprintf(stderr, "Unknown --show-pushes value '%s' "
"(valid: '[y]es', '[n]o')\n", argval);
}
} else if (!strcmp(argv[i],"--force")) {
config.force_mode = 1;
} else if (CLUSTER_MANAGER_MODE() && argv[i][0] != '-') {
if (config.cluster_manager_command.argc == 0) {
int j = i + 1;
@@ -1795,7 +1793,6 @@ static void usage(void) {
" --verbose Verbose mode.\n"
" --no-auth-warning Don't show warning message when using password on command\n"
" line interface.\n"
" --force Ignore validation and safety checks\n"
" --help Output this help and exit.\n"
" --version Output version and exit.\n"
"\n");
@@ -3296,8 +3293,8 @@ static redisReply *clusterManagerMigrateKeysInReply(clusterManagerNode *source,
argv_len = zcalloc(argc * sizeof(size_t), MALLOC_LOCAL);
char portstr[255];
char timeoutstr[255];
snprintf(portstr, sizeof(portstr), "%d", target->port);
snprintf(timeoutstr, sizeof(timeoutstr), "%d", timeout);
snprintf(portstr, 10, "%d", target->port);
snprintf(timeoutstr, 10, "%d", timeout);
argv[0] = "MIGRATE";
argv_len[0] = 7;
argv[1] = target->ip;
@@ -3996,13 +3993,12 @@ cleanup:
return signature;
}
int clusterManagerIsConfigConsistent(int fLog) {
int clusterManagerIsConfigConsistent(void) {
if (cluster_manager.nodes == NULL) return 0;
int consistent = (listLength(cluster_manager.nodes) <= 1);
// If the Cluster has only one node, it's always consistent
if (consistent) return 1;
sds first_cfg = NULL;
const char *firstNode = NULL;
listIter li;
listNode *ln;
listRewind(cluster_manager.nodes, &li);
@@ -4013,14 +4009,10 @@ int clusterManagerIsConfigConsistent(int fLog) {
consistent = 0;
break;
}
if (first_cfg == NULL) {
first_cfg = cfg;
firstNode = node->name;
} else {
if (first_cfg == NULL) first_cfg = cfg;
else {
consistent = !sdscmp(first_cfg, cfg);
sdsfree(cfg);
if (fLog && !consistent)
clusterManagerLogInfo("\tNode %s (%s:%d) is inconsistent with %s\n", node->name, node->ip, node->port, firstNode);
if (!consistent) break;
}
}
@@ -5169,7 +5161,7 @@ static int clusterManagerCommandReshard(int argc, char **argv) {
clusterManagerNode *node = clusterManagerNewNode(ip, port);
if (!clusterManagerLoadInfoFromNode(node, 0)) return 0;
clusterManagerCheckCluster(0);
if (cluster_manager.errors && listLength(cluster_manager.errors) > 0 && !config.force_mode) {
if (cluster_manager.errors && listLength(cluster_manager.errors) > 0) {
fflush(stdout);
fprintf(stderr,
"*** Please fix your cluster problems before resharding\n");
@@ -5402,7 +5394,7 @@ static int clusterManagerCommandRebalance(int argc, char **argv) {
if (weightedNodes == NULL) goto cleanup;
/* Check cluster, only proceed if it looks sane. */
clusterManagerCheckCluster(1);
if (cluster_manager.errors && listLength(cluster_manager.errors) > 0 && !config.force_mode) {
if (cluster_manager.errors && listLength(cluster_manager.errors) > 0) {
clusterManagerLogErr("*** Please fix your cluster problems "
"before rebalancing\n");
result = 0;
@@ -6833,7 +6825,7 @@ static long getLongInfoField(char *info, char *field) {
/* Convert number of bytes into a human readable string of the form:
* 100B, 2G, 100M, 4K, and so forth. */
void bytesToHuman(char *s, long long n, size_t bufsize) {
void bytesToHuman(char *s, long long n) {
double d;
if (n < 0) {
@@ -6843,17 +6835,17 @@ void bytesToHuman(char *s, long long n, size_t bufsize) {
}
if (n < 1024) {
/* Bytes */
snprintf(s,bufsize,"%lldB",n);
sprintf(s,"%lldB",n);
return;
} else if (n < (1024*1024)) {
d = (double)n/(1024);
snprintf(s,bufsize,"%.2fK",d);
sprintf(s,"%.2fK",d);
} else if (n < (1024LL*1024*1024)) {
d = (double)n/(1024*1024);
snprintf(s,bufsize,"%.2fM",d);
sprintf(s,"%.2fM",d);
} else if (n < (1024LL*1024*1024*1024)) {
d = (double)n/(1024LL*1024*1024);
snprintf(s,bufsize,"%.2fG",d);
sprintf(s,"%.2fG",d);
}
}
@@ -6883,38 +6875,38 @@ static void statMode(void) {
for (j = 0; j < 20; j++) {
long k;
snprintf(buf,sizeof(buf),"db%d:keys",j);
sprintf(buf,"db%d:keys",j);
k = getLongInfoField(reply->str,buf);
if (k == LONG_MIN) continue;
aux += k;
}
snprintf(buf,sizeof(buf),"%ld",aux);
sprintf(buf,"%ld",aux);
printf("%-11s",buf);
/* Used memory */
aux = getLongInfoField(reply->str,"used_memory");
bytesToHuman(buf,aux,sizeof(buf));
bytesToHuman(buf,aux);
printf("%-8s",buf);
/* Clients */
aux = getLongInfoField(reply->str,"connected_clients");
snprintf(buf,sizeof(buf),"%ld",aux);
sprintf(buf,"%ld",aux);
printf(" %-8s",buf);
/* Blocked (BLPOPPING) Clients */
aux = getLongInfoField(reply->str,"blocked_clients");
snprintf(buf,sizeof(buf),"%ld",aux);
sprintf(buf,"%ld",aux);
printf("%-8s",buf);
/* Requests */
aux = getLongInfoField(reply->str,"total_commands_processed");
snprintf(buf,sizeof(buf),"%ld (+%ld)",aux,requests == 0 ? 0 : aux-requests);
sprintf(buf,"%ld (+%ld)",aux,requests == 0 ? 0 : aux-requests);
printf("%-19s",buf);
requests = aux;
/* Connections */
aux = getLongInfoField(reply->str,"total_connections_received");
snprintf(buf,sizeof(buf),"%ld",aux);
sprintf(buf,"%ld",aux);
printf(" %-12s",buf);
/* Children */
@@ -7193,7 +7185,6 @@ int main(int argc, char **argv) {
config.set_errcode = 0;
config.no_auth_warning = 0;
config.in_multi = 0;
config.force_mode = 0;
config.cluster_manager_command.name = NULL;
config.cluster_manager_command.argc = 0;
config.cluster_manager_command.argv = NULL;
+1 -2
View File
@@ -195,7 +195,6 @@ extern struct config {
int in_multi;
int pre_multi_dbnum;
int quoted_input; /* Force input args to be treated as quoted strings */
int force_mode;
} config;
struct clusterManager {
@@ -283,7 +282,7 @@ int clusterManagerFixOpenSlot(int slot);
void clusterManagerPrintSlotsList(list *slots);
int clusterManagerGetCoveredSlots(char *all_slots);
void clusterManagerOnError(sds err);
int clusterManagerIsConfigConsistent(int fLog);
int clusterManagerIsConfigConsistent(void);
void freeClusterManagerNode(clusterManagerNode *node);
void clusterManagerLog(int level, const char* fmt, ...);
int parseClusterNodeAddress(char *addr, char **ip_ptr, int *port_ptr,
-1
View File
@@ -326,7 +326,6 @@ static const RedisModuleEvent
#define REDISMODULE_SUBEVENT_LOADING_ENDED 3
#define REDISMODULE_SUBEVENT_LOADING_FAILED 4
#define _REDISMODULE_SUBEVENT_LOADING_NEXT 5
#define REDISMODULE_SUBEVENT_LOADING_FLASH_START 6
#define REDISMODULE_SUBEVENT_CLIENT_CHANGE_CONNECTED 0
#define REDISMODULE_SUBEVENT_CLIENT_CHANGE_DISCONNECTED 1
+11 -17
View File
@@ -188,8 +188,6 @@ int bg_unlink(const char *filename) {
/* ---------------------------------- MASTER -------------------------------- */
bool createDiskBacklog() {
if (g_pserver->repl_backlog_disk != nullptr)
return true; // already exists
// Lets create some disk backed pages and add them here
std::string path = "./repl-backlog-temp" + std::to_string(gettid());
#if (defined __APPLE__ || defined __FreeBSD__)
@@ -347,8 +345,7 @@ void freeReplicationBacklog(void) {
client *c = (client*)listNodeValue(ln);
serverAssert(c->flags & CLIENT_CLOSE_ASAP || FMasterHost(c));
}
if (g_pserver->repl_backlog != g_pserver->repl_backlog_disk)
zfree(g_pserver->repl_backlog);
zfree(g_pserver->repl_backlog);
g_pserver->repl_backlog = NULL;
}
@@ -413,7 +410,7 @@ void feedReplicationBacklog(const void *ptr, size_t len) {
if (minimumsize > g_pserver->repl_backlog_size && listening_replicas) {
// This is an emergency overflow, we better resize to fit
long long newsize = std::max(g_pserver->repl_backlog_size*2, minimumsize);
serverLog(LL_WARNING, "Replication backlog is too small, resizing from %lld to %lld bytes", g_pserver->repl_backlog_size, newsize);
serverLog(LL_WARNING, "Replication backlog is too small, resizing to: %lld bytes", newsize);
resizeReplicationBacklog(newsize);
} else if (!listening_replicas) {
// We need to update a few variables or later asserts will notice we dropped data
@@ -1145,7 +1142,7 @@ public:
}
};
int rdbSaveSnapshotForReplication(rdbSaveInfo *rsi) {
int rdbSaveSnapshotForReplication(struct rdbSaveInfo *rsi) {
// TODO: This needs to be on a background thread
int retval = C_OK;
serverAssert(GlobalLocksAcquired());
@@ -1541,7 +1538,7 @@ void syncCommand(client *c) {
} else {
/* We don't have a BGSAVE in progress, let's start one. Diskless
* or disk-based mode is determined by replica's capacity. */
if (!hasActiveChildProcessOrBGSave()) {
if (!hasActiveChildProcess()) {
startBgsaveForReplication(c->slave_capa);
} else {
serverLog(LL_NOTICE,
@@ -3735,12 +3732,12 @@ retry_connect:
}
/* Prepare a suitable temp file for bulk transfer */
if (!useDisklessLoad() && !mi->isRocksdbSnapshotRepl) {
if (!useDisklessLoad()) {
while(maxtries--) {
auto dt = std::chrono::system_clock::now().time_since_epoch();
auto dtMillisecond = std::chrono::duration_cast<std::chrono::milliseconds>(dt);
snprintf(tmpfile,sizeof(tmpfile),
"temp-%lld.%ld.rdb",(long long)dtMillisecond.count(),(long int)getpid());
snprintf(tmpfile,256,
"temp-%d.%ld.rdb",(int)dtMillisecond.count(),(long int)getpid());
dfd = open(tmpfile,O_CREAT|O_WRONLY|O_EXCL,0644);
if (dfd != -1) break;
sleep(1);
@@ -3800,11 +3797,9 @@ int connectWithMaster(redisMaster *mi) {
connSetPrivateData(mi->repl_transfer_s, mi);
if (connConnect(mi->repl_transfer_s, mi->masterhost, mi->masterport,
NET_FIRST_BIND_ADDR, syncWithMaster) == C_ERR) {
const char *err = "Unknown Error";
if (mi->repl_transfer_s->last_errno != 0)
err = connGetLastError(mi->repl_transfer_s);
int sev = g_pserver->enable_multimaster ? LL_NOTICE : LL_WARNING; // with multimaster its not unheard of to intentionally have downed masters
serverLog(sev, "Unable to connect to MASTER: %s", err);
int sev = g_pserver->enable_multimaster ? LL_NOTICE : LL_WARNING; // with multimaster its not unheard of to intentiallionall have downed masters
serverLog(sev,"Unable to connect to MASTER: %s",
connGetLastError(mi->repl_transfer_s));
connClose(mi->repl_transfer_s);
mi->repl_transfer_s = NULL;
return C_ERR;
@@ -4989,7 +4984,7 @@ void replicationStartPendingFork(void) {
* In case of diskless replication, we make sure to wait the specified
* number of seconds (according to configuration) so that other slaves
* have the time to arrive before we start streaming. */
if (!hasActiveChildProcessOrBGSave()) {
if (!hasActiveChildProcess()) {
time_t idle, max_idle = 0;
int slaves_waiting = 0;
int mincapa = -1;
@@ -5625,7 +5620,6 @@ void flushReplBacklogToClients()
// Ensure no overflow if we get here
serverAssert(g_pserver->master_repl_offset - g_pserver->repl_batch_offStart <= g_pserver->repl_backlog_size);
serverAssert(g_pserver->repl_batch_idxStart != g_pserver->repl_backlog_idx);
// Repl backlog writes must become visible to all threads at this point
std::atomic_thread_fence(std::memory_order_release);
-3
View File
@@ -1264,9 +1264,6 @@ void scriptingInit(int setup) {
/* Finally set the table as 'redis' global var. */
lua_setglobal(lua,"redis");
/* Set table as 'keydb' global var as well */
lua_getglobal(lua,"redis");
lua_setglobal(lua,"keydb");
/* Replace math.random and math.randomseed with our implementations. */
lua_getglobal(lua,"math");
+2 -6
View File
@@ -27,7 +27,6 @@ namespace keydbutils
template<>
size_t hash(const sdsview &);
}
extern size_t g_semiOrderedSetTargetBucketSize;
template<typename T, typename T_KEY = T, bool MEMMOVE_SAFE = false>
class semiorderedset
@@ -42,14 +41,11 @@ class semiorderedset
size_t idxRehash = (1ULL << bits_min);
int cfPauseRehash = 0;
inline size_t targetElementsPerBucket()
constexpr size_t targetElementsPerBucket()
{
// Aim for roughly 4 cache lines per bucket (determined by imperical testing)
// lower values are faster but use more memory
if (g_semiOrderedSetTargetBucketSize == 0)
return std::max((64/sizeof(T))*8, (size_t)2);
else
return g_semiOrderedSetTargetBucketSize;
return std::max((64/sizeof(T))*8, (size_t)2);
}
public:
+92 -183
View File
@@ -70,7 +70,6 @@
#ifdef __linux__
#include <sys/prctl.h>
#include <sys/mman.h>
#include <sys/sysinfo.h>
#endif
int g_fTestMode = false;
@@ -1518,16 +1517,6 @@ dictType dbDictType = {
dictGCAsyncFree /* async free destructor */
};
dictType dbExpiresDictType = {
dictSdsHash, /* hash function */
NULL, /* key dup */
NULL, /* val dup */
dictSdsKeyCompare, /* key compare */
NULL, /* key destructor */
NULL, /* val destructor */
dictExpandAllowed /* allow to expand */
};
/* db->pdict, keys are sds strings, vals are Redis objects. */
dictType dbTombstoneDictType = {
dictSdsHash, /* hash function */
@@ -1560,6 +1549,17 @@ dictType shaScriptObjectDictType = {
NULL /* allow to expand */
};
/* Db->expires */
dictType dbExpiresDictType = {
dictSdsHash, /* hash function */
NULL, /* key dup */
NULL, /* val dup */
dictSdsKeyCompare, /* key compare */
NULL, /* key destructor */
NULL, /* val destructor */
dictExpandAllowed /* allow to expand */
};
/* Command table. sds string -> command struct pointer. */
dictType commandTableDictType = {
dictSdsCaseHash, /* hash function */
@@ -1706,7 +1706,7 @@ int redisDbPersistentData::incrementallyRehash() {
* for dict.c to resize the hash tables accordingly to the fact we have an
* active fork child running. */
void updateDictResizePolicy(void) {
if (!hasActiveChildProcess())
if (!hasActiveChildProcess() || (g_pserver->FRdbSaveInProgress() && !cserver.fForkBgSave))
dictEnableResize();
else
dictDisableResize();
@@ -1725,11 +1725,7 @@ const char *strChildType(int type) {
/* Return true if there are active children processes doing RDB saving,
* AOF rewriting, or some side process spawned by a loaded module. */
int hasActiveChildProcess() {
return g_pserver->child_pid != -1;
}
int hasActiveChildProcessOrBGSave() {
return g_pserver->FRdbSaveInProgress() || hasActiveChildProcess();
return g_pserver->FRdbSaveInProgress() || g_pserver->child_pid != -1;
}
void resetChildState() {
@@ -1870,9 +1866,6 @@ VersionCompareResult compareVersion(SymVer *pver)
if ((symVerThis.major == 0 && symVerThis.minor == 0 && symVerThis.build == 0)
|| (pver->major == 0 && pver->minor == 0 && pver->build == 0))
return VersionCompareResult::EqualVersion;
if (pver->major <= 6 && pver->minor <= 3 && pver->build <= 3)
return VersionCompareResult::IncompatibleVersion;
for (int iver = 0; iver < 3; ++iver)
{
@@ -1961,16 +1954,6 @@ void getExpansiveClientsInfo(size_t *in_usage, size_t *out_usage) {
*out_usage = o;
}
int closeClientOnOverload(client *c) {
if (g_pserver->overload_closed_clients > MAX_CLIENTS_SHED_PER_PERIOD) return false;
if (!g_pserver->is_overloaded) return false;
// Don't close masters, replicas, or pub/sub clients
if (c->flags & (CLIENT_MASTER | CLIENT_SLAVE | CLIENT_PENDING_WRITE | CLIENT_PUBSUB | CLIENT_BLOCKED)) return false;
freeClient(c);
++g_pserver->overload_closed_clients;
return true;
}
/* This function is called by serverCron() and is used in order to perform
* operations on clients that are important to perform constantly. For instance
* we use this function in order to disconnect clients after a timeout, including
@@ -2041,7 +2024,6 @@ void clientsCron(int iel) {
if (clientsCronTrackExpansiveClients(c, curr_peak_mem_usage_slot)) goto LContinue;
if (clientsCronTrackClientsMemUsage(c)) goto LContinue;
if (closeClientOnOutputBufferLimitReached(c, 0)) continue; // Client also free'd
if (closeClientOnOverload(c)) continue;
LContinue:
fastlock_unlock(&c->lock);
}
@@ -2092,7 +2074,7 @@ void databasesCron(bool fMainThread) {
/* Perform hash tables rehashing if needed, but only if there are no
* other processes saving the DB on disk. Otherwise rehashing is bad
* as will cause a lot of copy-on-write of memory pages. */
if (!hasActiveChildProcess()) {
if (!hasActiveChildProcess() || g_pserver->FRdbSaveInProgress()) {
/* We use global counters so if we stop the computation at a given
* DB we'll be able to start from the successive in the next
* cron loop iteration. */
@@ -2137,7 +2119,7 @@ void databasesCron(bool fMainThread) {
::dict *dict = g_pserver->db[rehash_db]->dictUnsafeKeyOnly();
/* Are we async rehashing? And if so is it time to re-calibrate? */
/* The recalibration limit is a prime number to ensure balancing across threads */
if (g_pserver->enable_async_rehash && rehashes_per_ms > 0 && async_rehashes < 131 && !cserver.active_defrag_enabled && cserver.cthreads > 1 && dictSize(dict) > 2048 && dictIsRehashing(dict) && !g_pserver->loading && aeLockContention() > 1) {
if (rehashes_per_ms > 0 && async_rehashes < 131 && !cserver.active_defrag_enabled && cserver.cthreads > 1 && dictSize(dict) > 2048 && dictIsRehashing(dict) && !g_pserver->loading) {
serverTL->rehashCtl = dictRehashAsyncStart(dict, rehashes_per_ms * ((1000 / g_pserver->hz) / 10)); // Estimate 10% CPU time spent in lock contention
if (serverTL->rehashCtl)
++async_rehashes;
@@ -2233,7 +2215,6 @@ void checkChildrenDone(void) {
g_pserver->rdbThreadVars.fRdbThreadCancel = false;
g_pserver->rdbThreadVars.fDone = false;
if (exitcode == 0) receiveChildInfo();
closeChildInfoPipe();
}
}
else if ((pid = waitpid(-1, &statloc, WNOHANG)) != 0) {
@@ -2315,10 +2296,6 @@ void cronUpdateMemoryStats() {
g_pserver->cron_malloc_stats.allocator_active = g_pserver->cron_malloc_stats.allocator_resident;
if (!g_pserver->cron_malloc_stats.allocator_allocated)
g_pserver->cron_malloc_stats.allocator_allocated = g_pserver->cron_malloc_stats.zmalloc_used;
if (g_pserver->force_eviction_percent) {
g_pserver->cron_malloc_stats.sys_available = getMemAvailable();
}
}
}
@@ -2491,14 +2468,14 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
/* Start a scheduled AOF rewrite if this was requested by the user while
* a BGSAVE was in progress. */
if (!hasActiveChildProcessOrBGSave() &&
if (!hasActiveChildProcess() &&
g_pserver->aof_rewrite_scheduled)
{
rewriteAppendOnlyFileBackground();
}
/* Check if a background saving or AOF rewrite in progress terminated. */
if (hasActiveChildProcessOrBGSave() || ldbPendingChildren())
if (hasActiveChildProcess() || ldbPendingChildren())
{
run_with_period(1000) receiveChildInfo();
checkChildrenDone();
@@ -2540,7 +2517,7 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
/* Trigger an AOF rewrite if needed. */
if (g_pserver->aof_state == AOF_ON &&
!hasActiveChildProcessOrBGSave() &&
!hasActiveChildProcess() &&
g_pserver->aof_rewrite_perc &&
g_pserver->aof_current_size > g_pserver->aof_rewrite_min_size)
{
@@ -2599,26 +2576,6 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
migrateCloseTimedoutSockets();
}
/* Check for CPU Overload */
run_with_period(10'000) {
g_pserver->is_overloaded = false;
g_pserver->overload_closed_clients = 0;
static clock_t last = 0;
if (g_pserver->overload_protect_threshold > 0) {
clock_t cur = clock();
double perc = static_cast<double>(cur - last) / (CLOCKS_PER_SEC*10);
perc /= cserver.cthreads;
perc *= 100.0;
serverLog(LL_WARNING, "CPU Used: %.2f", perc);
if (perc > g_pserver->overload_protect_threshold) {
serverLog(LL_WARNING, "\tWARNING: CPU overload detected.");
g_pserver->is_overloaded = true;
}
last = cur;
}
}
/* Tune the fastlock to CPU load */
run_with_period(30000) {
/* Tune the fastlock to CPU load */
fastlock_auto_adjust_waits();
@@ -2644,7 +2601,7 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
* Note: this code must be after the replicationCron() call above so
* make sure when refactoring this file to keep this order. This is useful
* because we want to give priority to RDB savings for replication. */
if (!hasActiveChildProcessOrBGSave() &&
if (!hasActiveChildProcess() &&
g_pserver->rdb_bgsave_scheduled &&
(g_pserver->unixtime-g_pserver->lastbgsave_try > CONFIG_BGSAVE_RETRY_DELAY ||
g_pserver->lastbgsave_status == C_OK))
@@ -2858,6 +2815,9 @@ void beforeSleep(struct aeEventLoop *eventLoop) {
runAndPropogateToReplicas(processClients);
/* Handle precise timeouts of blocked clients. */
handleBlockedClientsTimeout();
/* Just call a subset of vital functions in case we are re-entering
* the event loop from processEventsWhileBlocked(). Note that in this
* case we keep track of the number of events we are processing, since
@@ -3919,25 +3879,9 @@ void initServer(void) {
g_pserver->db = (redisDb**)zmalloc(sizeof(redisDb*)*cserver.dbnum, MALLOC_LOCAL);
/* Create the Redis databases, and initialize other internal state. */
if (g_pserver->m_pstorageFactory == nullptr) {
for (int j = 0; j < cserver.dbnum; j++) {
g_pserver->db[j] = new (MALLOC_LOCAL) redisDb();
g_pserver->db[j]->initialize(j);
}
} else {
// Read FLASH metadata and load the appropriate dbid into each databse index, as each DB index can have different dbid mapped due to the swapdb command.
g_pserver->metadataDb = g_pserver->m_pstorageFactory->createMetadataDb();
for (int idb = 0; idb < cserver.dbnum; ++idb)
{
int dbid = idb;
std::string dbid_key = "db-" + std::to_string(idb);
g_pserver->metadataDb->retrieve(dbid_key.c_str(), dbid_key.length(), [&](const char *, size_t, const void *data, size_t){
dbid = *(int*)data;
});
g_pserver->db[idb] = new (MALLOC_LOCAL) redisDb();
g_pserver->db[idb]->initialize(dbid);
}
for (int j = 0; j < cserver.dbnum; j++) {
g_pserver->db[j] = new (MALLOC_LOCAL) redisDb();
g_pserver->db[j]->initialize(j);
}
for (int i = 0; i < MAX_EVENT_LOOPS; ++i)
@@ -3999,6 +3943,8 @@ void initServer(void) {
g_pserver->pubsub_channels = dictCreate(&keylistDictType,NULL);
g_pserver->pubsub_patterns = dictCreate(&keylistDictType,NULL);
g_pserver->cronloops = 0;
g_pserver->propagate_in_transaction = 0;
g_pserver->client_pause_in_transaction = 0;
g_pserver->child_pid = -1;
g_pserver->child_type = CHILD_TYPE_NONE;
g_pserver->rdbThreadVars.fRdbThreadCancel = false;
@@ -4038,8 +3984,6 @@ void initServer(void) {
g_pserver->cron_malloc_stats.allocator_allocated = 0;
g_pserver->cron_malloc_stats.allocator_active = 0;
g_pserver->cron_malloc_stats.allocator_resident = 0;
g_pserver->cron_malloc_stats.sys_available = 0;
g_pserver->cron_malloc_stats.sys_total = g_pserver->force_eviction_percent ? getMemTotal() : 0;
g_pserver->lastbgsave_status = C_OK;
g_pserver->aof_last_write_status = C_OK;
g_pserver->aof_last_write_errno = 0;
@@ -4047,7 +3991,6 @@ void initServer(void) {
g_pserver->mvcc_tstamp = 0;
/* Create the timer callback, this is our way to process many background
* operations incrementally, like clients timeout, eviction of unaccessed
* expired keys and so forth. */
@@ -4088,6 +4031,7 @@ void initServer(void) {
latencyMonitorInit();
if (g_pserver->m_pstorageFactory) {
g_pserver->metadataDb = g_pserver->m_pstorageFactory->createMetadataDb();
if (g_pserver->metadataDb) {
g_pserver->metadataDb->retrieve("repl-id", 7, [&](const char *, size_t, const void *data, size_t cb){
if (cb == sizeof(g_pserver->replid)) {
@@ -4123,6 +4067,12 @@ void initServer(void) {
}
}
/* We have to initialize storage providers after the cluster has been initialized */
for (int idb = 0; idb < cserver.dbnum; ++idb)
{
g_pserver->db[idb]->storageProviderInitialize();
}
saveMasterStatusToStorage(false); // eliminate the repl-offset field
/* Initialize ACL default password if it exists */
@@ -4135,15 +4085,6 @@ void initServer(void) {
* Thread Local Storage initialization collides with dlopen call.
* see: https://sourceware.org/bugzilla/show_bug.cgi?id=19329 */
void InitServerLast() {
/* We have to initialize storage providers after the cluster has been initialized */
moduleFireServerEvent(REDISMODULE_EVENT_LOADING, REDISMODULE_SUBEVENT_LOADING_FLASH_START, NULL);
for (int idb = 0; idb < cserver.dbnum; ++idb)
{
g_pserver->db[idb]->storageProviderInitialize();
}
moduleFireServerEvent(REDISMODULE_EVENT_LOADING, REDISMODULE_SUBEVENT_LOADING_ENDED, NULL);
bioInit();
set_jemalloc_bg_thread(cserver.jemalloc_bg_thread);
g_pserver->initial_memory_usage = zmalloc_used_memory();
@@ -4374,12 +4315,12 @@ void propagate(struct redisCommand *cmd, int dbid, robj **argv, int argc,
* This way we'll deliver the MULTI/..../EXEC block as a whole and
* both the AOF and the replication link will have the same consistency
* and atomicity guarantees. */
if (serverTL->in_exec && !serverTL->propagate_in_transaction)
if (serverTL->in_exec && !g_pserver->propagate_in_transaction)
execCommandPropagateMulti(dbid);
/* This needs to be unreachable since the dataset should be fixed during
* client pause, otherwise data may be lossed during a failover. */
serverAssert(!(areClientsPaused() && !serverTL->client_pause_in_transaction));
serverAssert(!(areClientsPaused() && !g_pserver->client_pause_in_transaction));
if (g_pserver->aof_state != AOF_OFF && flags & PROPAGATE_AOF)
feedAppendOnlyFile(cmd,dbid,argv,argc);
@@ -4701,8 +4642,8 @@ void call(client *c, int flags) {
/* Client pause takes effect after a transaction has finished. This needs
* to be located after everything is propagated. */
if (!serverTL->in_exec && serverTL->client_pause_in_transaction) {
serverTL->client_pause_in_transaction = 0;
if (!serverTL->in_exec && g_pserver->client_pause_in_transaction) {
g_pserver->client_pause_in_transaction = 0;
}
/* If the client has keys tracking enabled for client side caching,
@@ -4793,9 +4734,8 @@ int processCommand(client *c, int callFlags) {
/* Both EXEC and EVAL call call() directly so there should be
* no way in_exec or in_eval or propagate_in_transaction is 1.
* That is unless lua_timedout, in which case client may run
* some commands. Also possible that some other thread set
* propagate_in_transaction if this is an async command. */
serverAssert(!serverTL->propagate_in_transaction);
* some commands. */
serverAssert(!g_pserver->propagate_in_transaction);
serverAssert(!serverTL->in_exec);
serverAssert(!serverTL->in_eval);
}
@@ -5092,29 +5032,10 @@ int processCommand(client *c, int callFlags) {
} else {
/* If the command was replication or admin related we *must* flush our buffers first. This is in case
something happens which would modify what we would send to replicas */
if (c->cmd->flags & (CMD_MODULE | CMD_ADMIN))
flushReplBacklogToClients();
if (c->flags & CLIENT_AUDIT_LOGGING){
getKeysResult result = GETKEYS_RESULT_INIT;
int numkeys = getKeysFromCommand(c->cmd, c->argv, c->argc, &result);
int *keyindex = result.keys;
sds str = sdsempty();
for (int j = 0; j < numkeys; j++) {
sdscatsds(str, (sds)ptrFromObj(c->argv[keyindex[j]]));
sdscat(str, " ");
}
if (numkeys > 0)
{
serverLog(LL_NOTICE, "Audit Log: %s, cmd %s, keys: %s", c->fprint, c->cmd->name, str);
} else {
serverLog(LL_NOTICE, "Audit Log: %s, cmd %s", c->fprint, c->cmd->name);
}
sdsfree(str);
}
call(c,callFlags);
c->woff = g_pserver->master_repl_offset;
@@ -5246,7 +5167,7 @@ int prepareForShutdown(int flags) {
* to unlink file actully) in background thread.
* The temp rdb file fd may won't be closed when redis exits quickly,
* but OS will close this fd when process exits. */
rdbRemoveTempFile(g_pserver->rdbThreadVars.tmpfileNum, 0);
rdbRemoveTempFile(g_pserver->child_pid, 0);
}
/* Kill module child if there is one. */
@@ -5546,30 +5467,30 @@ NULL
/* Convert an amount of bytes into a human readable string in the form
* of 100B, 2G, 100M, 4K, and so forth. */
void bytesToHuman(char *s, unsigned long long n, size_t bufsize) {
void bytesToHuman(char *s, unsigned long long n) {
double d;
if (n < 1024) {
/* Bytes */
snprintf(s,bufsize,"%lluB",n);
sprintf(s,"%lluB",n);
} else if (n < (1024*1024)) {
d = (double)n/(1024);
snprintf(s,bufsize,"%.2fK",d);
sprintf(s,"%.2fK",d);
} else if (n < (1024LL*1024*1024)) {
d = (double)n/(1024*1024);
snprintf(s,bufsize,"%.2fM",d);
sprintf(s,"%.2fM",d);
} else if (n < (1024LL*1024*1024*1024)) {
d = (double)n/(1024LL*1024*1024);
snprintf(s,bufsize,"%.2fG",d);
sprintf(s,"%.2fG",d);
} else if (n < (1024LL*1024*1024*1024*1024)) {
d = (double)n/(1024LL*1024*1024*1024);
snprintf(s,bufsize,"%.2fT",d);
sprintf(s,"%.2fT",d);
} else if (n < (1024LL*1024*1024*1024*1024*1024)) {
d = (double)n/(1024LL*1024*1024*1024*1024);
snprintf(s,bufsize,"%.2fP",d);
sprintf(s,"%.2fP",d);
} else {
/* Let's hope we never need this */
snprintf(s,bufsize,"%lluB",n);
sprintf(s,"%lluB",n);
}
}
@@ -5662,9 +5583,7 @@ sds genRedisInfoString(const char *section) {
"configured_hz:%i\r\n"
"lru_clock:%u\r\n"
"executable:%s\r\n"
"config_file:%s\r\n"
"availability_zone:%s\r\n"
"features:%s\r\n",
"config_file:%s\r\n",
KEYDB_SET_VERSION,
redisGitSHA1(),
strtol(redisGitDirty(),NULL,10) > 0,
@@ -5690,9 +5609,7 @@ sds genRedisInfoString(const char *section) {
g_pserver->config_hz,
lruclock,
cserver.executable ? cserver.executable : "",
cserver.configfile ? cserver.configfile : "",
g_pserver->sdsAvailabilityZone,
"cluster_mget");
cserver.configfile ? cserver.configfile : "");
}
/* Clients */
@@ -5741,7 +5658,6 @@ sds genRedisInfoString(const char *section) {
const char *evict_policy = evictPolicyToString();
long long memory_lua = g_pserver->lua ? (long long)lua_gc(g_pserver->lua,LUA_GCCOUNT,0)*1024 : 0;
struct redisMemOverhead *mh = getMemoryOverheadData();
char available_system_mem[64] = "unavailable";
/* Peak memory is updated from time to time by serverCron() so it
* may happen that the instantaneous value is slightly bigger than
@@ -5750,17 +5666,13 @@ sds genRedisInfoString(const char *section) {
if (zmalloc_used > g_pserver->stat_peak_memory)
g_pserver->stat_peak_memory = zmalloc_used;
if (g_pserver->cron_malloc_stats.sys_available) {
snprintf(available_system_mem, 64, "%lu", g_pserver->cron_malloc_stats.sys_available);
}
bytesToHuman(hmem,zmalloc_used,sizeof(hmem));
bytesToHuman(peak_hmem,g_pserver->stat_peak_memory,sizeof(peak_hmem));
bytesToHuman(total_system_hmem,total_system_mem,sizeof(total_system_hmem));
bytesToHuman(used_memory_lua_hmem,memory_lua,sizeof(used_memory_lua_hmem));
bytesToHuman(used_memory_scripts_hmem,mh->lua_caches,sizeof(used_memory_scripts_hmem));
bytesToHuman(used_memory_rss_hmem,g_pserver->cron_malloc_stats.process_rss,sizeof(used_memory_rss_hmem));
bytesToHuman(maxmemory_hmem,g_pserver->maxmemory,sizeof(maxmemory_hmem));
bytesToHuman(hmem,zmalloc_used);
bytesToHuman(peak_hmem,g_pserver->stat_peak_memory);
bytesToHuman(total_system_hmem,total_system_mem);
bytesToHuman(used_memory_lua_hmem,memory_lua);
bytesToHuman(used_memory_scripts_hmem,mh->lua_caches);
bytesToHuman(used_memory_rss_hmem,g_pserver->cron_malloc_stats.process_rss);
bytesToHuman(maxmemory_hmem,g_pserver->maxmemory);
if (sections++) info = sdscat(info,"\r\n");
info = sdscatprintf(info,
@@ -5806,8 +5718,7 @@ sds genRedisInfoString(const char *section) {
"active_defrag_running:%d\r\n"
"lazyfree_pending_objects:%zu\r\n"
"lazyfreed_objects:%zu\r\n"
"storage_provider:%s\r\n"
"available_system_memory:%s\r\n",
"storage_provider:%s\r\n",
zmalloc_used,
hmem,
g_pserver->cron_malloc_stats.process_rss,
@@ -5852,10 +5763,18 @@ sds genRedisInfoString(const char *section) {
g_pserver->active_defrag_running,
lazyfreeGetPendingObjectsCount(),
lazyfreeGetFreedObjectsCount(),
g_pserver->m_pstorageFactory ? g_pserver->m_pstorageFactory->name() : "none",
available_system_mem
g_pserver->m_pstorageFactory ? g_pserver->m_pstorageFactory->name() : "none"
);
freeMemoryOverheadData(mh);
if (g_pserver->m_pstorageFactory)
{
info = sdscatprintf(info,
"%s_memory:%zu\r\n",
g_pserver->m_pstorageFactory->name(),
g_pserver->m_pstorageFactory->totalDiskspaceUsed()
);
}
}
/* Persistence */
@@ -5979,10 +5898,6 @@ sds genRedisInfoString(const char *section) {
(intmax_t)eta
);
}
if (g_pserver->m_pstorageFactory)
{
info = sdscat(info, g_pserver->m_pstorageFactory->getInfo().get());
}
}
/* Stats */
@@ -6644,8 +6559,7 @@ void usage(void) {
void redisAsciiArt(void) {
#include "asciilogo.h"
size_t bufsize = 1024*16;
char *buf = (char*)zmalloc(bufsize, MALLOC_LOCAL);
char *buf = (char*)zmalloc(1024*16, MALLOC_LOCAL);
const char *mode;
if (g_pserver->cluster_enabled) mode = "cluster";
@@ -6667,7 +6581,7 @@ void redisAsciiArt(void) {
);
} else {
sds motd = fetchMOTD(true, cserver.enable_motd);
snprintf(buf,bufsize,ascii_logo,
snprintf(buf,1024*16,ascii_logo,
KEYDB_REAL_VERSION,
redisGitSHA1(),
strtol(redisGitDirty(),NULL,10) > 0,
@@ -6970,7 +6884,6 @@ int redisFork(int purpose) {
latencyAddSampleIfNeeded("fork-lock",(ustime()-startWriteLock)/1000);
if ((childpid = fork()) == 0) {
/* Child */
aeForkLockInChild();
aeReleaseForkLock();
g_pserver->in_fork_child = purpose;
setOOMScoreAdj(CONFIG_OOM_BGCHILD);
@@ -7413,7 +7326,7 @@ static void validateConfiguration()
exit(EXIT_FAILURE);
}
g_pserver->repl_backlog_size = g_pserver->repl_backlog_config_size; // this is normally set in the update logic, but not on initial config
g_pserver->repl_backlog_config_size = g_pserver->repl_backlog_size; // this is normally set in the update logic, but not on initial config
}
int iAmMaster(void) {
@@ -7653,29 +7566,6 @@ int main(int argc, char **argv) {
validateConfiguration();
if (!g_pserver->sentinel_mode) {
#ifdef __linux__
linuxMemoryWarnings();
#if defined (__arm64__)
int ret;
if ((ret = linuxMadvFreeForkBugCheck())) {
if (ret == 1)
serverLog(LL_WARNING,"WARNING Your kernel has a bug that could lead to data corruption during background save. "
"Please upgrade to the latest stable kernel.");
else
serverLog(LL_WARNING, "Failed to test the kernel for a bug that could lead to data corruption during background save. "
"Your system could be affected, please report this error.");
if (!checkIgnoreWarning("ARM64-COW-BUG")) {
serverLog(LL_WARNING,"KeyDB will now exit to prevent data corruption. "
"Note that it is possible to suppress this warning by setting the following config: ignore-warnings ARM64-COW-BUG");
exit(1);
}
}
#endif /* __arm64__ */
#endif /* __linux__ */
}
const char *err;
if (!initializeStorageProvider(&err))
{
@@ -7701,6 +7591,25 @@ int main(int argc, char **argv) {
if (!g_pserver->sentinel_mode) {
/* Things not needed when running in Sentinel mode. */
serverLog(LL_WARNING,"Server initialized");
#ifdef __linux__
linuxMemoryWarnings();
#if defined (__arm64__)
int ret;
if ((ret = linuxMadvFreeForkBugCheck())) {
if (ret == 1)
serverLog(LL_WARNING,"WARNING Your kernel has a bug that could lead to data corruption during background save. "
"Please upgrade to the latest stable kernel.");
else
serverLog(LL_WARNING, "Failed to test the kernel for a bug that could lead to data corruption during background save. "
"Your system could be affected, please report this error.");
if (!checkIgnoreWarning("ARM64-COW-BUG")) {
serverLog(LL_WARNING,"KeyDB will now exit to prevent data corruption. "
"Note that it is possible to suppress this warning by setting the following config: ignore-warnings ARM64-COW-BUG");
exit(1);
}
}
#endif /* __arm64__ */
#endif /* __linux__ */
moduleInitModulesSystemLast();
moduleLoadFromQueue();
ACLLoadUsersAtStartup();
+36 -75
View File
@@ -122,9 +122,6 @@ typedef long long ustime_t; /* microsecond time type. */
#define LOADING_BOOT 1
#define LOADING_REPLICATION 2
#define OVERLOAD_PROTECT_PERIOD_MS 10'000 // 10 seconds
#define MAX_CLIENTS_SHED_PER_PERIOD (OVERLOAD_PROTECT_PERIOD_MS / 10) // Restrict to one client per 10ms
extern int g_fTestMode;
extern struct redisServer *g_pserver;
@@ -545,7 +542,6 @@ extern int configOOMScoreAdjValuesDefaults[CONFIG_OOM_COUNT];
#define CLIENT_REPL_RDBONLY (1ULL<<42) /* This client is a replica that only wants
RDB without replication buffer. */
#define CLIENT_FORCE_REPLY (1ULL<<44) /* Should addReply be forced to write the text? */
#define CLIENT_AUDIT_LOGGING (1ULL<<45) /* Client commands required audit logging */
/* Client block type (btype field in client structure)
* if CLIENT_BLOCKED flag is set. */
@@ -966,7 +962,6 @@ struct redisObjectExtended {
typedef struct redisObject {
friend redisObject *createEmbeddedStringObject(const char *ptr, size_t len);
friend redisObject *createObject(int type, void *ptr);
protected:
redisObject() {}
@@ -979,7 +974,6 @@ public:
private:
mutable std::atomic<unsigned> refcount {0};
public:
expireEntry expire;
void *m_ptr;
inline bool FExpires() const { return refcount.load(std::memory_order_relaxed) >> 31; }
@@ -990,7 +984,7 @@ public:
void addref() const { refcount.fetch_add(1, std::memory_order_relaxed); }
unsigned release() const { return refcount.fetch_sub(1, std::memory_order_seq_cst) & ~(1U << 31); }
} robj;
static_assert(sizeof(redisObject) <= 24, "object size is critical, don't increase");
static_assert(sizeof(redisObject) <= 16, "object size is critical, don't increase");
class redisObjectStack : public redisObjectExtended, public redisObject
{
@@ -1146,20 +1140,16 @@ public:
dict_iter random();
const expireEntry *random_expire(sds *key)
const expireEntry &random_expire()
{
auto itr = random();
if (itr->FExpires()) {
*key = itr.key();
return &itr->expire;
}
return nullptr;
return m_setexpire->random_value();
}
dict_iter end() { return dict_iter(nullptr, nullptr); }
dict_const_iter end() const { return dict_const_iter(nullptr); }
void getStats(char *buf, size_t bufsize) { dictGetStats(buf, bufsize, m_pdict); }
void getExpireStats(char *buf, size_t bufsize) { m_setexpire->getstats(buf, bufsize); }
bool insert(char *k, robj *o, bool fAssumeNew = false, dict_iter *existing = nullptr);
void tryResize();
@@ -1167,15 +1157,16 @@ public:
void updateValue(dict_iter itr, robj *val);
bool syncDelete(robj *key);
bool asyncDelete(robj *key);
size_t expireSize() const { return m_numexpires; }
size_t expireSize() const { return m_setexpire->size(); }
int removeExpire(robj *key, dict_iter itr);
int removeSubkeyExpire(robj *key, robj *subkey);
void resortExpire(expireEntry &e);
void clear(void(callback)(void*));
void emptyDbAsync();
// Note: If you do not need the obj then use the objless iterator version. It's faster
bool iterate(std::function<bool(const char*, robj*)> fn);
void setExpire(robj *key, robj *subkey, long long when);
void setExpire(const char *key, expireEntry &&e);
void setExpire(expireEntry &&e);
void initialize();
void prepOverwriteForSnapshot(char *key);
@@ -1199,6 +1190,9 @@ public:
// objects stored elsewhere
dict *dictUnsafeKeyOnly() { return m_pdict; }
expireset *setexpireUnsafe() { return m_setexpire; }
const expireset *setexpire() const { return m_setexpire; }
const redisDbPersistentDataSnapshot *createSnapshot(uint64_t mvccCheckpoint, bool fOptional);
void endSnapshot(const redisDbPersistentDataSnapshot *psnapshot);
void endSnapshotAsync(const redisDbPersistentDataSnapshot *psnapshot);
@@ -1210,18 +1204,15 @@ public:
void disableKeyCache();
bool keycacheIsEnabled();
void prefetchKeysAsync(client *c, struct parsed_command &command);
bool prefetchKeysAsync(client *c, struct parsed_command &command, bool fExecOK);
bool FSnapshot() const { return m_spdbSnapshotHOLDER != nullptr; }
std::unique_ptr<const StorageCache> CloneStorageCache() { return std::unique_ptr<const StorageCache>(m_spstorage->clone()); }
std::shared_ptr<StorageCache> getStorageCache() { return m_spstorage; }
void bulkDirectStorageInsert(char **rgKeys, size_t *rgcbKeys, char **rgVals, size_t *rgcbVals, size_t celem);
void bulkStorageInsert(char **rgKeys, size_t *rgcbKeys, char **rgVals, size_t *rgcbVals, size_t celem);
dict_iter find_cached_threadsafe(const char *key) const;
static void activeExpireCycleCore(int type);
protected:
uint64_t m_mvccCheckpoint = 0;
@@ -1244,7 +1235,7 @@ private:
std::shared_ptr<StorageCache> m_spstorage = nullptr;
// Expire
size_t m_numexpires = 0;
expireset *m_setexpire = nullptr;
// These two pointers are the same, UNLESS the database has been cleared.
// in which case m_pdbSnapshot is NULL and we continue as though we weren'
@@ -1314,7 +1305,7 @@ struct redisDb : public redisDbPersistentDataSnapshot
friend int removeExpire(redisDb *db, robj *key);
friend void setExpire(struct client *c, redisDb *db, robj *key, robj *subkey, long long when);
friend void setExpire(client *c, redisDb *db, robj *key, expireEntry &&e);
friend int evictionPoolPopulate(int dbid, redisDb *db, bool fVolatile, struct evictionPoolEntry *pool);
friend int evictionPoolPopulate(int dbid, redisDb *db, expireset *setexpire, struct evictionPoolEntry *pool);
friend void activeDefragCycle(void);
friend void activeExpireCycle(int);
friend void expireSlaveKeys(void);
@@ -1323,7 +1314,9 @@ struct redisDb : public redisDbPersistentDataSnapshot
typedef ::dict_const_iter const_iter;
typedef ::dict_iter iter;
redisDb() = default;
redisDb()
: expireitr(nullptr)
{}
void initialize(int id);
void storageProviderInitialize();
@@ -1345,6 +1338,7 @@ struct redisDb : public redisDbPersistentDataSnapshot
using redisDbPersistentData::random_expire;
using redisDbPersistentData::end;
using redisDbPersistentData::getStats;
using redisDbPersistentData::getExpireStats;
using redisDbPersistentData::insert;
using redisDbPersistentData::tryResize;
using redisDbPersistentData::incrementallyRehash;
@@ -1362,19 +1356,21 @@ struct redisDb : public redisDbPersistentDataSnapshot
using redisDbPersistentData::processChanges;
using redisDbPersistentData::processChangesAsync;
using redisDbPersistentData::commitChanges;
using redisDbPersistentData::setexpireUnsafe;
using redisDbPersistentData::setexpire;
using redisDbPersistentData::endSnapshot;
using redisDbPersistentData::restoreSnapshot;
using redisDbPersistentData::removeAllCachedValues;
using redisDbPersistentData::disableKeyCache;
using redisDbPersistentData::keycacheIsEnabled;
using redisDbPersistentData::dictUnsafeKeyOnly;
using redisDbPersistentData::resortExpire;
using redisDbPersistentData::prefetchKeysAsync;
using redisDbPersistentData::prepOverwriteForSnapshot;
using redisDbPersistentData::FRehashing;
using redisDbPersistentData::FTrackingChanges;
using redisDbPersistentData::CloneStorageCache;
using redisDbPersistentData::getStorageCache;
using redisDbPersistentData::bulkDirectStorageInsert;
using redisDbPersistentData::bulkStorageInsert;
public:
const redisDbPersistentDataSnapshot *createSnapshot(uint64_t mvccCheckpoint, bool fOptional) {
@@ -1384,7 +1380,7 @@ public:
return psnapshot;
}
unsigned long expires_cursor = 0;
expireset::setiter expireitr;
dict *blocking_keys; /* Keys with clients waiting for data (BLPOP)*/
dict *ready_keys; /* Blocked keys that received a PUSH */
dict *watched_keys; /* WATCHED keys for MULTI/EXEC CAS */
@@ -1712,7 +1708,6 @@ struct client {
size_t argv_len_sum() const;
bool asyncCommand(std::function<void(const redisDbPersistentDataSnapshot *, const std::vector<robj_sharedptr> &)> &&mainFn,
std::function<void(const redisDbPersistentDataSnapshot *)> &&postFn = nullptr);
char* fprint;
};
struct saveparam {
@@ -1914,12 +1909,6 @@ struct MasterSaveInfo {
masterhost = sdsstring(sdsdup(mi.masterhost));
masterport = mi.masterport;
}
MasterSaveInfo(const MasterSaveInfo &other) {
masterhost = other.masterhost;
masterport = other.masterport;
memcpy(master_replid, other.master_replid, sizeof(master_replid));
master_initial_offset = other.master_initial_offset;
}
MasterSaveInfo &operator=(const MasterSaveInfo &other) {
masterhost = other.masterhost;
@@ -2012,8 +2001,6 @@ struct malloc_stats {
size_t allocator_allocated;
size_t allocator_active;
size_t allocator_resident;
size_t sys_total;
size_t sys_available;
};
typedef struct socketFds {
@@ -2204,9 +2191,6 @@ struct redisServerThreadVars {
bool modulesEnabledThisAeLoop = false; /* In this loop of aeMain, were modules enabled before
the thread went to sleep? */
bool disable_async_commands = false; /* this is only valid for one cycle of the AE loop and is reset in afterSleep */
int propagate_in_transaction = 0; /* Make sure we don't propagate nested MULTI/EXEC */
int client_pause_in_transaction = 0; /* Was a client pause executed during this Exec? */
std::vector<client*> vecclientsProcess;
dictAsyncRehashCtl *rehashCtl = nullptr;
@@ -2245,6 +2229,7 @@ struct redisServerConst {
int maxidletime; /* Client timeout in seconds */
int tcpkeepalive; /* Set SO_KEEPALIVE if non-zero. */
int active_expire_enabled; /* Can be disabled for testing purposes. */
int active_expire_effort; /* From 1 (default) to 10, active effort. */
int active_defrag_enabled;
int jemalloc_bg_thread; /* Enable jemalloc background thread */
size_t active_defrag_ignore_bytes; /* minimum amount of fragmentation waste to start active defrag */
@@ -2306,13 +2291,14 @@ struct redisServer {
rax *errors; /* Errors table */
int activerehashing; /* Incremental rehash in serverCron() */
int active_defrag_running; /* Active defragmentation running (holds current scan aggressiveness) */
int enable_async_rehash = 1; /* Should we use the async rehash feature? */
int cronloops; /* Number of times the cron function run */
char runid[CONFIG_RUN_ID_SIZE+1]; /* ID always different at every exec. */
int sentinel_mode; /* True if this instance is a Sentinel. */
size_t initial_memory_usage; /* Bytes used after initialization. */
int always_show_logo; /* Show logo even for non-stdout logging. */
int propagate_in_transaction; /* Make sure we don't propagate nested MULTI/EXEC */
char *ignore_warnings; /* Config: warnings that should be ignored. */
int client_pause_in_transaction; /* Was a client pause executed during this Exec? */
pause_type client_pause_type; /* True if clients are currently paused */
/* Modules */
::dict *moduleapi; /* Exported core APIs dictionary for modules. */
@@ -2355,7 +2341,6 @@ struct redisServer {
unsigned int loading_process_events_interval_keys;
int active_expire_enabled; /* Can be disabled for testing purposes. */
int active_expire_effort; /* From 1 (default) to 10, active effort. */
int replicaIsolationFactor = 1;
@@ -2479,8 +2464,7 @@ struct redisServer {
time_t lastbgsave_try; /* Unix time of last attempted bgsave */
time_t rdb_save_time_last; /* Time used by last RDB save run. */
time_t rdb_save_time_start; /* Current RDB save start time. */
mstime_t rdb_save_latency; /* Used to track end to end latency of rdb save*/
pid_t rdb_child_pid = -1; /* Used only during fork bgsave */
pid_t rdb_child_pid = -1; /* Used only during fork bgsave */
int rdb_bgsave_scheduled; /* BGSAVE when possible if true. */
int rdb_child_type; /* Type of save by active child. */
int lastbgsave_status; /* C_OK or C_ERR */
@@ -2571,13 +2555,11 @@ struct redisServer {
int get_ack_from_slaves; /* If true we send REPLCONF GETACK. */
/* Limits */
unsigned int maxclients; /* Max number of simultaneous clients */
unsigned int maxclientsReserved; /* Reserved amount for health checks (localhost conns) */
unsigned long long maxmemory; /* Max number of memory bytes to use */
unsigned long long maxstorage; /* Max number of bytes to use in a storage provider */
int maxmemory_policy; /* Policy for key eviction */
int maxmemory_samples; /* Precision of random sampling */
int maxmemory_eviction_tenacity;/* Aggressiveness of eviction processing */
int force_eviction_percent; /* Force eviction when this percent of system memory is remaining */
int lfu_log_factor; /* LFU logarithmic counter factor. */
int lfu_decay_time; /* LFU counter decay factor. */
long long proto_max_bulk_len; /* Protocol bulk length maximum size. */
@@ -2712,7 +2694,6 @@ struct redisServer {
int tls_auth_clients;
int tls_rotation;
std::set<sdsstring> tls_auditlog_blocklist; /* Certificates that can be excluded from audit logging */
std::set<sdsstring> tls_allowlist;
redisTLSContextConfig tls_ctx_config;
@@ -2741,24 +2722,14 @@ struct redisServer {
long long repl_batch_offStart = -1;
long long repl_batch_idxStart = -1;
long long rand_total_threshold;
int config_soft_shutdown = false;
bool soft_shutdown = false;
int flash_disable_key_cache = false;
/* Lock Contention Ring Buffer */
static const size_t s_lockContentionSamples = 64;
uint16_t rglockSamples[s_lockContentionSamples];
unsigned ilockRingHead = 0;
sds sdsAvailabilityZone;
int overload_protect_threshold = 0;
int is_overloaded = 0;
int overload_closed_clients = 0;
int module_blocked_pipe[2]; /* Pipe used to awake the event loop if a
client blocked on a module command needs
to be processed. */
@@ -2873,12 +2844,6 @@ typedef struct {
#define OBJ_HASH_KEY 1
#define OBJ_HASH_VALUE 2
/* Used in evict.cpp */
enum class EvictReason {
User, /* User memory exceeded limit */
System /* System memory exceeded limit */
};
/*-----------------------------------------------------------------------------
* Extern declarations
*----------------------------------------------------------------------------*/
@@ -2919,7 +2884,7 @@ int moduleGetCommandKeysViaAPI(struct redisCommand *cmd, robj **argv, int argc,
moduleType *moduleTypeLookupModuleByID(uint64_t id);
void moduleTypeNameByID(char *name, uint64_t moduleid);
const char *moduleTypeModuleName(moduleType *mt);
void moduleFreeContext(struct RedisModuleCtx *ctx, bool propogate = true);
void moduleFreeContext(struct RedisModuleCtx *ctx);
void unblockClientFromModule(client *c);
void moduleHandleBlockedClients(int iel);
void moduleBlockedClientTimedOut(client *c);
@@ -3179,8 +3144,8 @@ int equalStringObjects(robj *a, robj *b);
unsigned long long estimateObjectIdleTime(robj_roptr o);
void trimStringObjectIfNeeded(robj *o);
robj *deserializeStoredObject(const void *data, size_t cb);
std::unique_ptr<expireEntry> deserializeExpire(const char *str, size_t cch, size_t *poffset);
robj *deserializeStoredObject(const redisDbPersistentData *db, const char *key, const void *data, size_t cb);
std::unique_ptr<expireEntry> deserializeExpire(sds key, const char *str, size_t cch, size_t *poffset);
sds serializeStoredObject(robj_roptr o, sds sdsPrefix = nullptr);
#define sdsEncodedObject(objptr) (objptr->encoding == OBJ_ENCODING_RAW || objptr->encoding == OBJ_ENCODING_EMBSTR)
@@ -3283,7 +3248,6 @@ void receiveChildInfo(void);
void executeWithoutGlobalLock(std::function<void()> func);
int redisFork(int type);
int hasActiveChildProcess();
int hasActiveChildProcessOrBGSave();
void resetChildState();
int isMutuallyExclusiveChildType(int type);
@@ -3383,7 +3347,7 @@ int zslLexValueGteMin(sds value, zlexrangespec *spec);
int zslLexValueLteMax(sds value, zlexrangespec *spec);
/* Core functions */
int getMaxmemoryState(size_t *total, size_t *logical, size_t *tofree, float *level, EvictReason *reason=nullptr, bool fQuickCycle=false, bool fPreSnapshot=false);
int getMaxmemoryState(size_t *total, size_t *logical, size_t *tofree, float *level, bool fQuickCycle = false, bool fPreSnapshot=false);
size_t freeMemoryGetNotCountedMemory();
int overMaxmemoryAfterAlloc(size_t moremem);
int processCommand(client *c, int callFlags);
@@ -3668,9 +3632,6 @@ unsigned long LFUDecrAndReturn(robj_roptr o);
#define EVICT_FAIL 2
int performEvictions(bool fPreSnapshot);
/* meminfo.cpp -- get memory info from /proc/memoryinfo for linux distros */
size_t getMemAvailable();
size_t getMemTotal();
/* Keys hashing / comparison functions for dict.c hash tables. */
uint64_t dictSdsHash(const void *key);
@@ -3923,15 +3884,15 @@ void updateActiveReplicaMastersFromRsi(rdbSaveInfo *rsi);
uint64_t getMvccTstamp();
void incrementMvccTstamp();
#if __GNUC__ >= 7 && !defined(NO_DEPRECATE_FREE) && !defined(ALPINE)
#if __GNUC__ >= 7 && !defined(NO_DEPRECATE_FREE)
[[deprecated]]
void *calloc(size_t count, size_t size) noexcept;
void *calloc(size_t count, size_t size);
[[deprecated]]
void free(void *ptr) noexcept;
void free(void *ptr);
[[deprecated]]
void *malloc(size_t size) noexcept;
void *malloc(size_t size);
[[deprecated]]
void *realloc(void *ptr, size_t size) noexcept;
void *realloc(void *ptr, size_t size);
#endif
/* Debugging stuff */
+13 -7
View File
@@ -74,7 +74,6 @@ const redisDbPersistentDataSnapshot *redisDbPersistentData::createSnapshot(uint6
spdb->m_fTrackingChanges = 0;
spdb->m_pdict = m_pdict;
spdb->m_pdictTombstone = m_pdictTombstone;
spdb->m_numexpires = m_numexpires;
// Add a fake iterator so the dicts don't rehash (they need to be read only)
dictPauseRehashing(spdb->m_pdict);
dictForceRehash(spdb->m_pdictTombstone); // prevent rehashing by finishing the rehash now
@@ -84,6 +83,12 @@ const redisDbPersistentDataSnapshot *redisDbPersistentData::createSnapshot(uint6
spdb->m_pdbSnapshot = m_pdbSnapshot;
spdb->m_refCount = 1;
spdb->m_mvccCheckpoint = getMvccTstamp();
if (m_setexpire != nullptr)
{
std::unique_lock<fastlock> ul(g_expireLock);
spdb->m_setexpire = new (MALLOC_LOCAL) expireset(*m_setexpire);
spdb->m_setexpire->pause_rehash(); // needs to be const
}
if (dictIsRehashing(spdb->m_pdict) || dictIsRehashing(spdb->m_pdictTombstone)) {
serverLog(LL_VERBOSE, "NOTICE: Suboptimal snapshot");
@@ -166,6 +171,11 @@ void redisDbPersistentData::restoreSnapshot(const redisDbPersistentDataSnapshot
size_t expectedSize = psnapshot->size();
dictEmpty(m_pdict, nullptr);
dictEmpty(m_pdictTombstone, nullptr);
{
std::unique_lock<fastlock> ul(g_expireLock);
delete m_setexpire;
m_setexpire = new (MALLOC_LOCAL) expireset(*psnapshot->m_setexpire);
}
endSnapshot(psnapshot);
serverAssert(size() == expectedSize);
}
@@ -587,12 +597,8 @@ bool redisDbPersistentDataSnapshot::iterate_threadsafe_core(std::function<bool(c
if (!fKeyOnly)
{
size_t offset = 0;
std::unique_ptr<expireEntry> spexpire = deserializeExpire((const char*)data, cbData, &offset);
o = deserializeStoredObject(reinterpret_cast<const char*>(data)+offset, cbData-offset);
o->SetFExpires(spexpire != nullptr);
if (spexpire != nullptr) {
o->expire = std::move(*spexpire);
}
deserializeExpire(sdsKey, (const char*)data, cbData, &offset);
o = deserializeStoredObject(this, sdsKey, reinterpret_cast<const char*>(data)+offset, cbData-offset);
}
fContinue = fn(sdsKey, o);
if (o != nullptr)
+4 -6
View File
@@ -194,8 +194,8 @@ void sortCommand(client *c) {
list *operations;
unsigned int outputlen = 0;
int desc = 0, alpha = 0;
long limit_start = 0, limit_count = -1, start, end, vectorlen;
int j, dontsort = 0;
long limit_start = 0, limit_count = -1, start, end;
int j, dontsort = 0, vectorlen;
int getop = 0; /* GET operation counter */
int int_conversion_error = 0;
int syntax_error = 0;
@@ -321,10 +321,8 @@ void sortCommand(client *c) {
default: vectorlen = 0; serverPanic("Bad SORT type"); /* Avoid GCC warning */
}
/* Perform LIMIT start,count sanity checking.
* And avoid integer overflow by limiting inputs to object sizes. */
start = std::min(std::max(limit_start, (long)0), vectorlen);
limit_count = std::min(std::max(limit_count, (long)-1), vectorlen);
/* Perform LIMIT start,count sanity checking. */
start = (limit_start < 0) ? 0 : limit_start;
end = (limit_count < 0) ? vectorlen-1 : start+limit_count-1;
if (start >= vectorlen) {
start = vectorlen-1;
+18 -157
View File
@@ -3,12 +3,8 @@
#include <sstream>
#include <mutex>
#include <unistd.h>
#include "../server.h"
#include "../cluster.h"
#include "rocksdbfactor_internal.h"
template class std::basic_string<char>;
static const char keyprefix[] = INTERNAL_KEY_PREFIX;
rocksdb::Options DefaultRocksDBOptions();
@@ -24,20 +20,8 @@ bool FInternalKey(const char *key, size_t cch)
return false;
}
std::string getPrefix(unsigned int hashslot)
{
HASHSLOT_PREFIX_TYPE slot = HASHSLOT_PREFIX_ENDIAN((HASHSLOT_PREFIX_TYPE)hashslot);
char *hash_char = (char *)&slot;
return std::string(hash_char, HASHSLOT_PREFIX_BYTES);
}
std::string prefixKey(const char *key, size_t cchKey)
{
return FInternalKey(key, cchKey) ? std::string(key, cchKey) : getPrefix(keyHashSlot(key, cchKey)) + std::string(key, cchKey);
}
RocksDBStorageProvider::RocksDBStorageProvider(RocksDBStorageFactory *pfactory, std::shared_ptr<rocksdb::DB> &spdb, std::shared_ptr<rocksdb::ColumnFamilyHandle> &spcolfam, std::shared_ptr<rocksdb::ColumnFamilyHandle> &spexpirecolfam, const rocksdb::Snapshot *psnapshot, size_t count)
: m_pfactory(pfactory), m_spdb(spdb), m_psnapshot(psnapshot), m_spcolfamily(spcolfam), m_spexpirecolfamily(spexpirecolfam), m_count(count)
RocksDBStorageProvider::RocksDBStorageProvider(RocksDBStorageFactory *pfactory, std::shared_ptr<rocksdb::DB> &spdb, std::shared_ptr<rocksdb::ColumnFamilyHandle> &spcolfam, const rocksdb::Snapshot *psnapshot, size_t count)
: m_pfactory(pfactory), m_spdb(spdb), m_psnapshot(psnapshot), m_spcolfamily(spcolfam), m_count(count)
{
m_readOptionsTemplate = rocksdb::ReadOptions();
m_readOptionsTemplate.verify_checksums = false;
@@ -48,11 +32,10 @@ void RocksDBStorageProvider::insert(const char *key, size_t cchKey, void *data,
{
rocksdb::Status status;
std::unique_lock<fastlock> l(m_lock);
std::string prefixed_key = prefixKey(key, cchKey);
if (m_spbatch != nullptr)
status = m_spbatch->Put(m_spcolfamily.get(), rocksdb::Slice(prefixed_key), rocksdb::Slice((const char*)data, cb));
status = m_spbatch->Put(m_spcolfamily.get(), rocksdb::Slice(key, cchKey), rocksdb::Slice((const char*)data, cb));
else
status = m_spdb->Put(WriteOptions(), m_spcolfamily.get(), rocksdb::Slice(prefixed_key), rocksdb::Slice((const char*)data, cb));
status = m_spdb->Put(WriteOptions(), m_spcolfamily.get(), rocksdb::Slice(key, cchKey), rocksdb::Slice((const char*)data, cb));
if (!status.ok())
throw status.ToString();
@@ -76,8 +59,7 @@ void RocksDBStorageProvider::bulkInsert(char **rgkeys, size_t *rgcbkeys, char **
// Insert rows into the SST file, note that inserted keys must be
// strictly increasing (based on options.comparator)
for (size_t ielem = 0; ielem < celem; ++ielem) {
std::string prefixed_key = prefixKey(rgkeys[ielem], rgcbkeys[ielem]);
s = sst_file_writer.Put(rocksdb::Slice(prefixed_key), rocksdb::Slice(rgvals[ielem], rgcbvals[ielem]));
s = sst_file_writer.Put(rocksdb::Slice(rgkeys[ielem], rgcbkeys[ielem]), rocksdb::Slice(rgvals[ielem], rgcbvals[ielem]));
if (!s.ok()) {
unlink(file_path.c_str());
goto LFallback;
@@ -105,8 +87,7 @@ void RocksDBStorageProvider::bulkInsert(char **rgkeys, size_t *rgcbkeys, char **
LFallback:
auto spbatch = std::make_unique<rocksdb::WriteBatch>();
for (size_t ielem = 0; ielem < celem; ++ielem) {
std::string prefixed_key = prefixKey(rgkeys[ielem], rgcbkeys[ielem]);
spbatch->Put(m_spcolfamily.get(), rocksdb::Slice(prefixed_key), rocksdb::Slice(rgvals[ielem], rgcbvals[ielem]));
spbatch->Put(m_spcolfamily.get(), rocksdb::Slice(rgkeys[ielem], rgcbkeys[ielem]), rocksdb::Slice(rgvals[ielem], rgcbvals[ielem]));
}
m_spdb->Write(WriteOptions(), spbatch.get());
}
@@ -119,16 +100,15 @@ bool RocksDBStorageProvider::erase(const char *key, size_t cchKey)
{
rocksdb::Status status;
std::unique_lock<fastlock> l(m_lock);
std::string prefixed_key = prefixKey(key, cchKey);
if (!FKeyExists(prefixed_key))
return false;
if (m_spbatch != nullptr)
{
status = m_spbatch->Delete(m_spcolfamily.get(), rocksdb::Slice(prefixed_key));
status = m_spbatch->Delete(m_spcolfamily.get(), rocksdb::Slice(key, cchKey));
}
else
{
status = m_spdb->Delete(WriteOptions(), m_spcolfamily.get(), rocksdb::Slice(prefixed_key));
if (!FKeyExists(key, cchKey))
return false;
status = m_spdb->Delete(WriteOptions(), m_spcolfamily.get(), rocksdb::Slice(key, cchKey));
}
if (status.ok())
--m_count;
@@ -138,8 +118,7 @@ bool RocksDBStorageProvider::erase(const char *key, size_t cchKey)
void RocksDBStorageProvider::retrieve(const char *key, size_t cchKey, callbackSingle fn) const
{
rocksdb::PinnableSlice slice;
std::string prefixed_key = prefixKey(key, cchKey);
auto status = m_spdb->Get(ReadOptions(), m_spcolfamily.get(), rocksdb::Slice(prefixed_key), &slice);
auto status = m_spdb->Get(ReadOptions(), m_spcolfamily.get(), rocksdb::Slice(key, cchKey), &slice);
if (status.ok())
fn(key, cchKey, slice.data(), slice.size());
}
@@ -147,28 +126,16 @@ void RocksDBStorageProvider::retrieve(const char *key, size_t cchKey, callbackSi
size_t RocksDBStorageProvider::clear()
{
size_t celem = count();
auto options = m_spdb->GetOptions(m_spcolfamily.get());
auto status = m_spdb->DropColumnFamily(m_spcolfamily.get());
auto strName = m_spcolfamily->GetName();
rocksdb::ColumnFamilyHandle *handle = nullptr;
rocksdb::ColumnFamilyOptions cf_options(options);
rocksdb::ColumnFamilyOptions cf_options(m_pfactory->RocksDbOptions());
m_spdb->CreateColumnFamily(cf_options, strName, &handle);
m_spcolfamily = std::shared_ptr<rocksdb::ColumnFamilyHandle>(handle);
if (!status.ok())
throw status.ToString();
status = m_spdb->DropColumnFamily(m_spexpirecolfamily.get());
strName = m_spexpirecolfamily->GetName();
m_spdb->CreateColumnFamily(cf_options, strName, &handle);
m_spexpirecolfamily = std::shared_ptr<rocksdb::ColumnFamilyHandle>(handle);
if (!status.ok())
throw status.ToString();
m_count = 0;
return celem;
}
@@ -187,7 +154,7 @@ bool RocksDBStorageProvider::enumerate(callback fn) const
if (FInternalKey(it->key().data(), it->key().size()))
continue;
++count;
bool fContinue = fn(it->key().data()+HASHSLOT_PREFIX_BYTES, it->key().size()-HASHSLOT_PREFIX_BYTES, it->value().data(), it->value().size());
bool fContinue = fn(it->key().data(), it->key().size(), it->value().data(), it->value().size());
if (!fContinue)
break;
}
@@ -201,106 +168,11 @@ bool RocksDBStorageProvider::enumerate(callback fn) const
return !it->Valid();
}
bool RocksDBStorageProvider::enumerate_hashslot(callback fn, unsigned int hashslot) const
{
std::string prefix = getPrefix(hashslot);
std::unique_ptr<rocksdb::Iterator> it = std::unique_ptr<rocksdb::Iterator>(m_spdb->NewIterator(ReadOptions(), m_spcolfamily.get()));
size_t count = 0;
for (it->Seek(prefix); it->Valid(); it->Next()) {
if (FInternalKey(it->key().data(), it->key().size()))
continue;
if (HASHSLOT_PREFIX_RECOVER(*(HASHSLOT_PREFIX_TYPE *)it->key().data()) != hashslot)
break;
++count;
bool fContinue = fn(it->key().data()+HASHSLOT_PREFIX_BYTES, it->key().size()-HASHSLOT_PREFIX_BYTES, it->value().data(), it->value().size());
if (!fContinue)
break;
}
bool full_iter = !it->Valid() || (HASHSLOT_PREFIX_RECOVER(*(HASHSLOT_PREFIX_TYPE *)it->key().data()) != hashslot);
if (full_iter && count != g_pserver->cluster->slots_keys_count[hashslot])
{
printf("WARNING: rocksdb hashslot count mismatch");
}
assert(!full_iter || count == g_pserver->cluster->slots_keys_count[hashslot]);
assert(it->status().ok()); // Check for any errors found during the scan
return full_iter;
}
void RocksDBStorageProvider::setExpire(const char *key, size_t cchKey, long long expire)
{
rocksdb::Status status;
std::unique_lock<fastlock> l(m_lock);
long long beExpire = htobe64(expire);
std::string prefix((const char *)&beExpire,sizeof(long long));
std::string strKey(key, cchKey);
if (m_spbatch != nullptr)
status = m_spbatch->Put(m_spexpirecolfamily.get(), rocksdb::Slice(prefix + strKey), rocksdb::Slice(strKey));
else
status = m_spdb->Put(WriteOptions(), m_spexpirecolfamily.get(), rocksdb::Slice(prefix + strKey), rocksdb::Slice(strKey));
if (!status.ok())
throw status.ToString();
}
void RocksDBStorageProvider::removeExpire(const char *key, size_t cchKey, long long expire)
{
rocksdb::Status status;
std::unique_lock<fastlock> l(m_lock);
long long beExpire = htobe64(expire);
std::string prefix((const char *)&beExpire,sizeof(long long));
std::string strKey(key, cchKey);
std::string fullKey = prefix + strKey;
if (!FExpireExists(fullKey))
return;
if (m_spbatch)
status = m_spbatch->Delete(m_spexpirecolfamily.get(), rocksdb::Slice(fullKey));
else
status = m_spdb->Delete(WriteOptions(), m_spexpirecolfamily.get(), rocksdb::Slice(fullKey));
if (!status.ok())
throw status.ToString();
}
std::vector<std::string> RocksDBStorageProvider::getExpirationCandidates(unsigned int count)
{
std::vector<std::string> result;
std::unique_ptr<rocksdb::Iterator> it = std::unique_ptr<rocksdb::Iterator>(m_spdb->NewIterator(ReadOptions(), m_spexpirecolfamily.get()));
for (it->SeekToFirst(); it->Valid() && result.size() < count; it->Next()) {
if (FInternalKey(it->key().data(), it->key().size()))
continue;
result.emplace_back(it->value().data(), it->value().size());
}
return result;
}
std::string randomHashSlot() {
return getPrefix(genrand64_int63() % (1 << 16));
}
std::vector<std::string> RocksDBStorageProvider::getEvictionCandidates(unsigned int count)
{
std::vector<std::string> result;
if (g_pserver->maxmemory_policy & MAXMEMORY_FLAG_ALLKEYS) {
std::unique_ptr<rocksdb::Iterator> it = std::unique_ptr<rocksdb::Iterator>(m_spdb->NewIterator(ReadOptions(), m_spcolfamily.get()));
for (it->Seek(randomHashSlot()); it->Valid() && result.size() < count; it->Next()) {
if (FInternalKey(it->key().data(), it->key().size()))
continue;
result.emplace_back(it->key().data() + HASHSLOT_PREFIX_BYTES, it->key().size() - HASHSLOT_PREFIX_BYTES);
}
} else {
std::unique_ptr<rocksdb::Iterator> it = std::unique_ptr<rocksdb::Iterator>(m_spdb->NewIterator(ReadOptions(), m_spexpirecolfamily.get()));
for (it->SeekToFirst(); it->Valid() && result.size() < count; it->Next()) {
if (FInternalKey(it->key().data(), it->key().size()))
continue;
result.emplace_back(it->value().data(), it->value().size());
}
}
return result;
}
const IStorage *RocksDBStorageProvider::clone() const
{
std::unique_lock<fastlock> l(m_lock);
const rocksdb::Snapshot *psnapshot = const_cast<RocksDBStorageProvider*>(this)->m_spdb->GetSnapshot();
return new RocksDBStorageProvider(m_pfactory, const_cast<RocksDBStorageProvider*>(this)->m_spdb, const_cast<RocksDBStorageProvider*>(this)->m_spcolfamily, const_cast<RocksDBStorageProvider*>(this)->m_spexpirecolfamily, psnapshot, m_count);
return new RocksDBStorageProvider(m_pfactory, const_cast<RocksDBStorageProvider*>(this)->m_spdb, const_cast<RocksDBStorageProvider*>(this)->m_spcolfamily, psnapshot, m_count);
}
RocksDBStorageProvider::~RocksDBStorageProvider()
@@ -330,12 +202,12 @@ rocksdb::WriteOptions RocksDBStorageProvider::WriteOptions() const
void RocksDBStorageProvider::beginWriteBatch()
{
m_lock.lock();
m_spbatch = std::make_unique<rocksdb::WriteBatchWithIndex>();
m_spbatch = std::make_unique<rocksdb::WriteBatch>();
}
void RocksDBStorageProvider::endWriteBatch()
{
m_spdb->Write(WriteOptions(), m_spbatch.get()->GetWriteBatch());
m_spdb->Write(WriteOptions(), m_spbatch.get());
m_spbatch = nullptr;
m_lock.unlock();
}
@@ -353,21 +225,10 @@ void RocksDBStorageProvider::batch_unlock()
void RocksDBStorageProvider::flush()
{
m_spdb->SyncWAL();
m_spdb->Flush(rocksdb::FlushOptions());
}
bool RocksDBStorageProvider::FKeyExists(std::string& key) const
bool RocksDBStorageProvider::FKeyExists(const char *key, size_t cch) const
{
rocksdb::PinnableSlice slice;
if (m_spbatch)
return m_spbatch->GetFromBatchAndDB(m_spdb.get(), ReadOptions(), m_spcolfamily.get(), rocksdb::Slice(key), &slice).ok();
return m_spdb->Get(ReadOptions(), m_spcolfamily.get(), rocksdb::Slice(key), &slice).ok();
}
bool RocksDBStorageProvider::FExpireExists(std::string& key) const
{
rocksdb::PinnableSlice slice;
if (m_spbatch)
return m_spbatch->GetFromBatchAndDB(m_spdb.get(), ReadOptions(), m_spexpirecolfamily.get(), rocksdb::Slice(key), &slice).ok();
return m_spdb->Get(ReadOptions(), m_spexpirecolfamily.get(), rocksdb::Slice(key), &slice).ok();
return m_spdb->Get(ReadOptions(), m_spcolfamily.get(), rocksdb::Slice(key, cch), &slice).ok();
}
+3 -25
View File
@@ -3,42 +3,27 @@
#include <memory>
#include "../IStorage.h"
#include <rocksdb/db.h>
#include <rocksdb/utilities/write_batch_with_index.h>
#ifdef __APPLE__
#include <libkern/OSByteOrder.h>
#define htole16 OSSwapHostToLittleInt16
#define le16toh OSSwapLittleToHostInt16
#define htobe64 OSSwapHostToBigInt64
#else
#include <endian.h>
#endif
#include "../fastlock.h"
#define INTERNAL_KEY_PREFIX "\x00\x04\x03\x00\x05\x02\x04"
#define HASHSLOT_PREFIX_TYPE uint16_t
#define HASHSLOT_PREFIX_BYTES sizeof(HASHSLOT_PREFIX_TYPE)
#define HASHSLOT_PREFIX_ENDIAN htole16
#define HASHSLOT_PREFIX_RECOVER le16toh
static const char count_key[] = INTERNAL_KEY_PREFIX "__keydb__count\1";
static const char version_key[] = INTERNAL_KEY_PREFIX "__keydb__version\1";
static const char meta_key[] = INTERNAL_KEY_PREFIX "__keydb__metadata\1";
static const char last_expire_key[] = INTERNAL_KEY_PREFIX "__keydb__last_expire_time";
class RocksDBStorageFactory;
class RocksDBStorageProvider : public IStorage
{
RocksDBStorageFactory *m_pfactory;
std::shared_ptr<rocksdb::DB> m_spdb; // Note: This must be first so it is deleted last
std::unique_ptr<rocksdb::WriteBatchWithIndex> m_spbatch;
std::unique_ptr<rocksdb::WriteBatch> m_spbatch;
const rocksdb::Snapshot *m_psnapshot = nullptr;
std::shared_ptr<rocksdb::ColumnFamilyHandle> m_spcolfamily;
std::shared_ptr<rocksdb::ColumnFamilyHandle> m_spexpirecolfamily;
rocksdb::ReadOptions m_readOptionsTemplate;
size_t m_count = 0;
mutable fastlock m_lock {"RocksDBStorageProvider"};
public:
RocksDBStorageProvider(RocksDBStorageFactory *pfactory, std::shared_ptr<rocksdb::DB> &spdb, std::shared_ptr<rocksdb::ColumnFamilyHandle> &spcolfam, std::shared_ptr<rocksdb::ColumnFamilyHandle> &spexpirecolfam, const rocksdb::Snapshot *psnapshot, size_t count);
RocksDBStorageProvider(RocksDBStorageFactory *pfactory, std::shared_ptr<rocksdb::DB> &spdb, std::shared_ptr<rocksdb::ColumnFamilyHandle> &spcolfam, const rocksdb::Snapshot *psnapshot, size_t count);
~RocksDBStorageProvider();
virtual void insert(const char *key, size_t cchKey, void *data, size_t cb, bool fOverwrite) override;
@@ -46,12 +31,6 @@ public:
virtual void retrieve(const char *key, size_t cchKey, callbackSingle fn) const override;
virtual size_t clear() override;
virtual bool enumerate(callback fn) const override;
virtual bool enumerate_hashslot(callback fn, unsigned int hashslot) const override;
virtual std::vector<std::string> getExpirationCandidates(unsigned int count) override;
virtual std::vector<std::string> getEvictionCandidates(unsigned int count) override;
virtual void setExpire(const char *key, size_t cchKey, long long expire) override;
virtual void removeExpire(const char *key, size_t cchKey, long long expire) override;
virtual const IStorage *clone() const override;
@@ -68,8 +47,7 @@ public:
size_t count() const override;
protected:
bool FKeyExists(std::string&) const;
bool FExpireExists(std::string&) const;
bool FKeyExists(const char *key, size_t cchKey) const;
const rocksdb::ReadOptions &ReadOptions() const { return m_readOptionsTemplate; }
rocksdb::WriteOptions WriteOptions() const;
-2
View File
@@ -5,7 +5,6 @@ class RocksDBStorageFactory : public IStorageFactory
{
std::shared_ptr<rocksdb::DB> m_spdb; // Note: This must be first so it is deleted last
std::vector<std::unique_ptr<rocksdb::ColumnFamilyHandle>> m_vecspcols;
std::vector<std::unique_ptr<rocksdb::ColumnFamilyHandle>> m_vecspexpirecols;
std::shared_ptr<rocksdb::SstFileManager> m_pfilemanager;
std::string m_path;
bool m_fCreatedTempFolder = false;
@@ -19,7 +18,6 @@ public:
virtual const char *name() const override;
virtual size_t totalDiskspaceUsed() const override;
virtual sdsstring getInfo() const override;
virtual bool FSlow() const override { return true; }
+20 -48
View File
@@ -9,7 +9,6 @@
#include "rocksdbfactor_internal.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/statvfs.h>
rocksdb::Options DefaultRocksDBOptions() {
rocksdb::Options options;
@@ -61,8 +60,8 @@ RocksDBStorageFactory::RocksDBStorageFactory(const char *dbfile, int dbnum, cons
auto status = rocksdb::DB::ListColumnFamilies(rocksdb::Options(), dbfile, &vecT);
// RocksDB requires we know the count of col families before opening, if the user only wants to see less
// we still have to make room for all column family handles regardless
if (status.ok() && (int)vecT.size()/2 > dbnum)
dbnum = (int)vecT.size()/2;
if (status.ok() && (int)vecT.size() > dbnum)
dbnum = (int)vecT.size();
std::vector<rocksdb::ColumnFamilyDescriptor> veccoldesc;
veccoldesc.push_back(rocksdb::ColumnFamilyDescriptor(rocksdb::kDefaultColumnFamilyName, rocksdb::ColumnFamilyOptions())); // ignore default col family
@@ -72,14 +71,12 @@ RocksDBStorageFactory::RocksDBStorageFactory(const char *dbfile, int dbnum, cons
rocksdb::DB *db = nullptr;
auto options = RocksDbOptions();
options.prefix_extractor.reset(rocksdb::NewFixedPrefixTransform(HASHSLOT_PREFIX_BYTES));
for (int idb = 0; idb < dbnum; ++idb)
{
rocksdb::ColumnFamilyOptions cf_options(options);
cf_options.level_compaction_dynamic_level_bytes = true;
veccoldesc.push_back(rocksdb::ColumnFamilyDescriptor(std::to_string(idb), cf_options));
veccoldesc.push_back(rocksdb::ColumnFamilyDescriptor(std::to_string(idb) + "_expires", cf_options));
}
if (rgchConfig != nullptr)
@@ -101,29 +98,23 @@ RocksDBStorageFactory::RocksDBStorageFactory(const char *dbfile, int dbnum, cons
m_spdb = std::shared_ptr<rocksdb::DB>(db);
for (auto handle : handles)
{
if (handle->GetName().size() > 7 && !strncmp(handle->GetName().substr(handle->GetName().size() - 7).c_str(), "expires", 7)) {
m_vecspexpirecols.emplace_back(handle);
} else {
std::string strVersion;
auto status = m_spdb->Get(rocksdb::ReadOptions(), handle, rocksdb::Slice(version_key, sizeof(version_key)), &strVersion);
if (!status.ok())
{
setVersion(handle);
}
else
{
SymVer ver = parseVersion(strVersion.c_str());
auto cmp = compareVersion(&ver);
if (cmp == NewerVersion)
throw "Cannot load FLASH database created by newer version of KeyDB";
if (cmp == IncompatibleVersion)
throw "Cannot load FLASH database from before 6.3.4";
if (cmp == OlderVersion)
setVersion(handle);
}
m_vecspcols.emplace_back(handle);
std::string strVersion;
auto status = m_spdb->Get(rocksdb::ReadOptions(), handle, rocksdb::Slice(version_key, sizeof(version_key)), &strVersion);
if (!status.ok())
{
setVersion(handle);
}
}
else
{
SymVer ver = parseVersion(strVersion.c_str());
auto cmp = compareVersion(&ver);
if (cmp == NewerVersion)
throw "Cannot load FLASH database created by newer version of KeyDB";
if (cmp == OlderVersion)
setVersion(handle);
}
m_vecspcols.emplace_back(handle);
}
}
RocksDBStorageFactory::~RocksDBStorageFactory()
@@ -163,7 +154,6 @@ IStorage *RocksDBStorageFactory::create(int db, key_load_iterator iter, void *pr
{
++db; // skip default col family
std::shared_ptr<rocksdb::ColumnFamilyHandle> spcolfamily(m_vecspcols[db].release());
std::shared_ptr<rocksdb::ColumnFamilyHandle> spexpirecolfamily(m_vecspexpirecols[db].release());
size_t count = 0;
bool fUnclean = false;
@@ -196,11 +186,11 @@ IStorage *RocksDBStorageFactory::create(int db, key_load_iterator iter, void *pr
printf("\tDatabase %d was not shutdown cleanly, recomputing metrics\n", db);
fFirstRealKey = false;
if (iter != nullptr)
iter(it->key().data()+HASHSLOT_PREFIX_BYTES, it->key().size()-HASHSLOT_PREFIX_BYTES, privdata);
iter(it->key().data(), it->key().size(), privdata);
++count;
}
}
return new RocksDBStorageProvider(this, m_spdb, spcolfamily, spexpirecolfamily, nullptr, count);
return new RocksDBStorageProvider(this, m_spdb, spcolfamily, nullptr, count);
}
const char *RocksDBStorageFactory::name() const
@@ -212,21 +202,3 @@ size_t RocksDBStorageFactory::totalDiskspaceUsed() const
{
return m_pfilemanager->GetTotalSize();
}
sdsstring RocksDBStorageFactory::getInfo() const
{
struct statvfs fiData;
int status = statvfs(m_path.c_str(), &fiData);
if ( status == 0 ) {
return sdsstring(sdscatprintf(sdsempty(),
"storage_flash_used_bytes:%zu\r\n"
"storage_flash_total_bytes:%zu\r\n"
"storage_flash_rocksdb_bytes:%zu\r\n",
fiData.f_bfree * fiData.f_frsize,
fiData.f_blocks * fiData.f_frsize,
totalDiskspaceUsed()));
} else {
fprintf(stderr, "Failed to gather FLASH statistics with status: %d\r\n", status);
return sdsstring(sdsempty());
}
}
+3 -20
View File
@@ -26,12 +26,10 @@ TestStorageProvider::~TestStorageProvider()
{
}
void TestStorageProvider::insert(const char *key, size_t cchKey, void *data, size_t cb, bool fOverwrite)
void TestStorageProvider::insert(const char *key, size_t cchKey, void *data, size_t cb, bool /*fOverwrite*/)
{
auto strkey = std::string(key, cchKey);
bool fActuallyExists = m_map.find(strkey) != m_map.end();
serverAssert(fActuallyExists == fOverwrite);
m_map.insert(std::make_pair(strkey, std::string((char*)data, cb)));
m_map[strkey] = std::string((char*)data, cb);
}
@@ -73,22 +71,7 @@ bool TestStorageProvider::enumerate(callback fn) const
}
return fAll;
}
bool TestStorageProvider::enumerate_hashslot(callback fn, unsigned int hashslot) const
{
bool fAll = true;
for (auto &pair : m_map)
{
if (keyHashSlot(pair.first.data(), pair.first.size()) == hashslot)
if (!fn(pair.first.data(), pair.first.size(), pair.second.data(), pair.second.size()))
{
fAll = false;
break;
}
}
return fAll;
}
size_t TestStorageProvider::count() const
{
return m_map.size();
-8
View File
@@ -1,7 +1,6 @@
#include "../IStorage.h"
#include <string>
#include <unordered_map>
#include <vector>
class TestStorageFactory : public IStorageFactory
{
@@ -9,7 +8,6 @@ class TestStorageFactory : public IStorageFactory
virtual class IStorage *createMetadataDb() override;
virtual const char *name() const override;
virtual size_t totalDiskspaceUsed() const override { return 0; }
virtual sdsstring getInfo() const override { return sdsstring(sdsempty()); }
virtual bool FSlow() const override { return false; }
};
@@ -26,14 +24,8 @@ public:
virtual void retrieve(const char *key, size_t cchKey, callbackSingle fn) const override;
virtual size_t clear() override;
virtual bool enumerate(callback fn) const override;
virtual bool enumerate_hashslot(callback fn, unsigned int hashslot) const override;
virtual size_t count() const override;
virtual std::vector<std::string> getExpirationCandidates(unsigned int) override { return std::vector<std::string>(); }
virtual std::vector<std::string> getEvictionCandidates(unsigned int) override { return std::vector<std::string>(); }
virtual void setExpire(const char *, size_t, long long) override {}
virtual void removeExpire(const char *, size_t, long long) override {}
virtual void flush() override;
/* This is permitted to be a shallow clone */
+2 -15
View File
@@ -729,10 +729,6 @@ void hincrbyfloatCommand(client *c) {
unsigned int vlen;
if (getLongDoubleFromObjectOrReply(c,c->argv[3],&incr,NULL) != C_OK) return;
if (isnan(incr) || isinf(incr)) {
addReplyError(c,"value is NaN or Infinity");
return;
}
if ((o = hashTypeLookupWriteOrCreate(c,c->argv[1])) == NULL) return;
if (hashTypeGetValue(o,szFromObj(c->argv[2]),&vstr,&vlen,&ll) == C_OK) {
if (vstr) {
@@ -1066,8 +1062,6 @@ void hrandfieldWithCountCommand(client *c, long l, int withvalues) {
addReplyBulkCBuffer(c, key, sdslen(key));
if (withvalues)
addReplyBulkCBuffer(c, value, sdslen(value));
if (c->flags & CLIENT_CLOSE_ASAP)
break;
}
} else if (hash->encoding == OBJ_ENCODING_ZIPLIST) {
ziplistEntry *keys, *vals = NULL;
@@ -1081,8 +1075,6 @@ void hrandfieldWithCountCommand(client *c, long l, int withvalues) {
count -= sample_count;
ziplistRandomPairs((unsigned char*)ptrFromObj(hash), sample_count, keys, vals);
harndfieldReplyWithZiplist(c, sample_count, keys, vals);
if (c->flags & CLIENT_CLOSE_ASAP)
break;
}
zfree(keys);
zfree(vals);
@@ -1229,17 +1221,12 @@ void hrandfieldCommand(client *c) {
ziplistEntry ele;
if (c->argc >= 3) {
if (getRangeLongFromObjectOrReply(c,c->argv[2],-LONG_MAX,LONG_MAX,&l,NULL) != C_OK) return;
if (getLongFromObjectOrReply(c,c->argv[2],&l,NULL) != C_OK) return;
if (c->argc > 4 || (c->argc == 4 && strcasecmp(szFromObj(c->argv[3]),"withvalues"))) {
addReplyErrorObject(c,shared.syntaxerr);
return;
} else if (c->argc == 4) {
} else if (c->argc == 4)
withvalues = 1;
if (l < -g_pserver->rand_total_threshold || l > g_pserver->rand_total_threshold) {
addReplyError(c,"value is out of range");
return;
}
}
hrandfieldWithCountCommand(c, l, withvalues);
return;
}
+1 -1
View File
@@ -263,7 +263,7 @@ sds writeJsonValue(sds output, const char *valIn, size_t cchIn) {
serverAssert(!FSimpleJsonEscapeCh(valIn[ich]));
if (FExtendedJsonEscapeCh(valIn[ich])) {
dst[ichDst++] = '\\'; dst[ichDst++] = 'u';
snprintf(dst + ichDst, cchIn+cchEscapeExtra-ichDst, "%4x", valIn[ich]);
sprintf(dst + ichDst, "%4x", valIn[ich]);
ichDst += 4;
} else {
dst[ichDst++] = valIn[ich];
+1 -7
View File
@@ -672,11 +672,7 @@ void srandmemberWithCountCommand(client *c) {
dict *d;
if (getRangeLongFromObjectOrReply(c,c->argv[2],-LONG_MAX,LONG_MAX,&l,NULL) != C_OK) return;
if (l < -g_pserver->rand_total_threshold || l > g_pserver->rand_total_threshold) {
addReplyError(c,"value is out of range");
return;
}
if (getLongFromObjectOrReply(c,c->argv[2],&l,NULL) != C_OK) return;
if (l >= 0) {
count = (unsigned long) l;
} else {
@@ -710,8 +706,6 @@ void srandmemberWithCountCommand(client *c) {
} else {
addReplyBulkCBuffer(c,ele,sdslen(ele));
}
if (c->flags & CLIENT_CLOSE_ASAP)
break;
}
return;
}
+6 -11
View File
@@ -38,14 +38,8 @@ int getGenericCommand(client *c);
* String Commands
*----------------------------------------------------------------------------*/
static int checkStringLength(client *c, long long size, long long append) {
if (c->flags & CLIENT_MASTER)
return C_OK;
/* 'uint64_t' cast is there just to prevent undefined behavior on overflow */
long long total = (uint64_t)size + append;
/* Test configured max-bulk-len represending a limit of the biggest string object,
* and also test for overflow. */
if (total > g_pserver->proto_max_bulk_len || total < size || total < append) {
static int checkStringLength(client *c, long long size) {
if (!(c->flags & CLIENT_MASTER) && size > g_pserver->proto_max_bulk_len) {
addReplyError(c,"string exceeds maximum allowed size (proto-max-bulk-len)");
return C_ERR;
}
@@ -451,7 +445,7 @@ void setrangeCommand(client *c) {
}
/* Return when the resulting string exceeds allowed size */
if (checkStringLength(c,offset,sdslen(value)) != C_OK)
if (checkStringLength(c,offset+sdslen(value)) != C_OK)
return;
o = createObject(OBJ_STRING,sdsnewlen(NULL, offset+sdslen(value)));
@@ -471,7 +465,7 @@ void setrangeCommand(client *c) {
}
/* Return when the resulting string exceeds allowed size */
if (checkStringLength(c,offset,sdslen(value)) != C_OK)
if (checkStringLength(c,offset+sdslen(value)) != C_OK)
return;
/* Create a copy when the object is shared or encoded. */
@@ -691,7 +685,8 @@ void appendCommand(client *c) {
/* "append" is an argument, so always an sds */
append = c->argv[2];
if (checkStringLength(c,stringObjectLen(o),sdslen((sds)ptrFromObj(append))) != C_OK)
totlen = stringObjectLen(o)+sdslen((sds)ptrFromObj(append));
if (checkStringLength(c,totlen) != C_OK)
return;
/* Append the value */
+6 -15
View File
@@ -2036,7 +2036,7 @@ struct zsetopsrc {
zset *zs;
zskiplistNode *node;
} sl;
} iterzset;
} zset;
} iter;
};
@@ -2085,7 +2085,7 @@ void zuiInitIterator(zsetopsrc *op) {
/* Sorted sets are traversed in reverse order to optimize for
* the insertion of the elements in a new list as in
* ZDIFF/ZINTER/ZUNION */
iterzset *it = (iterzset*)&op->iter.iterzset;
iterzset *it = (iterzset*)&op->iter.zset;
if (op->encoding == OBJ_ENCODING_ZIPLIST) {
it->zl.zl = (unsigned char*)op->subject->m_ptr;
it->zl.eptr = ziplistIndex(it->zl.zl,-2);
@@ -2118,7 +2118,7 @@ void zuiClearIterator(zsetopsrc *op) {
serverPanic("Unknown set encoding");
}
} else if (op->type == OBJ_ZSET) {
iterzset *it = &op->iter.iterzset;
iterzset *it = &op->iter.zset;
if (op->encoding == OBJ_ENCODING_ZIPLIST) {
UNUSED(it); /* skip */
} else if (op->encoding == OBJ_ENCODING_SKIPLIST) {
@@ -2194,7 +2194,7 @@ int zuiNext(zsetopsrc *op, zsetopval *val) {
serverPanic("Unknown set encoding");
}
} else if (op->type == OBJ_ZSET) {
iterzset *it = &op->iter.iterzset;
iterzset *it = &op->iter.zset;
if (op->encoding == OBJ_ENCODING_ZIPLIST) {
/* No need to check both, but better be explicit. */
if (it->zl.eptr == NULL || it->zl.sptr == NULL)
@@ -4054,8 +4054,6 @@ void zrandmemberWithCountCommand(client *c, long l, int withscores) {
addReplyBulkCBuffer(c, key, sdslen(key));
if (withscores)
addReplyDouble(c, *(double*)dictGetVal(de));
if (c->flags & CLIENT_CLOSE_ASAP)
break;
}
} else if (zsetobj->encoding == OBJ_ENCODING_ZIPLIST) {
ziplistEntry *keys, *vals = NULL;
@@ -4069,8 +4067,6 @@ void zrandmemberWithCountCommand(client *c, long l, int withscores) {
count -= sample_count;
ziplistRandomPairs((unsigned char*)ptrFromObj(zsetobj), sample_count, keys, vals);
zarndmemberReplyWithZiplist(c, sample_count, keys, vals);
if (c->flags & CLIENT_CLOSE_ASAP)
break;
}
zfree(keys);
zfree(vals);
@@ -4214,17 +4210,12 @@ void zrandmemberCommand(client *c) {
ziplistEntry ele;
if (c->argc >= 3) {
if (getRangeLongFromObjectOrReply(c,c->argv[2],-LONG_MAX,LONG_MAX,&l,NULL) != C_OK) return;
if (getLongFromObjectOrReply(c,c->argv[2],&l,NULL) != C_OK) return;
if (c->argc > 4 || (c->argc == 4 && strcasecmp(szFromObj(c->argv[3]),"withscores"))) {
addReplyErrorObject(c,shared.syntaxerr);
return;
} else if (c->argc == 4) {
} else if (c->argc == 4)
withscores = 1;
if (l < -g_pserver->rand_total_threshold || l > g_pserver->rand_total_threshold) {
addReplyError(c,"value is out of range");
return;
}
}
zrandmemberWithCountCommand(c, l, withscores);
return;
}
+19 -68
View File
@@ -517,38 +517,19 @@ typedef struct tls_connection {
aeEventLoop *el;
} tls_connection;
/* Check to see if a given client name is contained in the provided set (allowlist/blocklist)
/* Check to see if a given client name matches against our allowlist.
* Return true if it does */
bool tlsCheckAgainstAllowlist(const char * client, std::set<sdsstring> set){
bool tlsCheckAgainstAllowlist(const char * client){
/* Because of wildcard matching, we need to iterate over the entire set.
* If we were doing simply straight matching, we could just directly
* check to see if the client name is in the set in O(1) time */
for (auto &client_pattern: set){
for (auto &client_pattern: g_pserver->tls_allowlist){
if (stringmatchlen(client_pattern.get(), client_pattern.size(), client, strlen(client), 1))
return true;
}
return false;
}
/* Sets the sha256 certificate fingerprint on the connection
* Based on the example here https://fm4dd.com/openssl/certfprint.shtm */
void tlsSetCertificateFingerprint(tls_connection* conn, X509 * cert) {
unsigned int fprint_size;
unsigned char fprint[EVP_MAX_MD_SIZE];
const EVP_MD *fprint_type = EVP_sha256();
X509_digest(cert, fprint_type, fprint, &fprint_size);
if (conn->c.fprint) zfree(conn->c.fprint);
conn->c.fprint = (char*)zcalloc(fprint_size*2+1);
/* Format fingerprint as hex string */
char tmp[3];
for (unsigned int i = 0; i < fprint_size; i++) {
snprintf(tmp, 2, "%02x", (unsigned int)fprint[i]);
strncat(conn->c.fprint, tmp, 2);
}
}
/* ASN1_STRING_get0_data was introduced in OPENSSL 1.1.1
* use ASN1_STRING_data for older versions where it is not available */
#if OPENSSL_VERSION_NUMBER < 0x10100000L
@@ -568,24 +549,19 @@ public:
}
};
bool tlsCheckCertificateAgainstAllowlist(tls_connection* conn, std::set<sdsstring> allowlist, const char** commonName){
if (allowlist.empty()){
// An empty list implies acceptance of all
return true;
}
bool tlsValidateCertificateName(tls_connection* conn){
if (g_pserver->tls_allowlist.empty())
return true; // Empty list implies acceptance of all
X509 * cert = SSL_get_peer_certificate(conn->ssl);
TCleanup certClen([cert]{X509_free(cert);});
/* Check the common name (CN) of the certificate first */
X509_NAME_ENTRY * ne = X509_NAME_get_entry(X509_get_subject_name(cert), X509_NAME_get_index_by_NID(X509_get_subject_name(cert), NID_commonName, -1));
*commonName = reinterpret_cast<const char*>(ASN1_STRING_get0_data(X509_NAME_ENTRY_get_data(ne)));
tlsSetCertificateFingerprint(conn, cert);
if (tlsCheckAgainstAllowlist(*commonName, allowlist)) {
const char * commonName = reinterpret_cast<const char*>(ASN1_STRING_get0_data(X509_NAME_ENTRY_get_data(ne)));
if (tlsCheckAgainstAllowlist(commonName))
return true;
}
/* If that fails, check through the subject alternative names (SANs) as well */
GENERAL_NAMES* subjectAltNames = (GENERAL_NAMES*)X509_get_ext_d2i(cert, NID_subject_alt_name, NULL, NULL);
@@ -598,19 +574,19 @@ bool tlsCheckCertificateAgainstAllowlist(tls_connection* conn, std::set<sdsstrin
switch (generalName->type)
{
case GEN_EMAIL:
if (tlsCheckAgainstAllowlist(reinterpret_cast<const char*>(ASN1_STRING_get0_data(generalName->d.rfc822Name)), allowlist)){
if (tlsCheckAgainstAllowlist(reinterpret_cast<const char*>(ASN1_STRING_get0_data(generalName->d.rfc822Name)))){
sk_GENERAL_NAME_pop_free(subjectAltNames, GENERAL_NAME_free);
return true;
}
break;
case GEN_DNS:
if (tlsCheckAgainstAllowlist(reinterpret_cast<const char*>(ASN1_STRING_get0_data(generalName->d.dNSName)), allowlist)){
if (tlsCheckAgainstAllowlist(reinterpret_cast<const char*>(ASN1_STRING_get0_data(generalName->d.dNSName)))){
sk_GENERAL_NAME_pop_free(subjectAltNames, GENERAL_NAME_free);
return true;
}
break;
case GEN_URI:
if (tlsCheckAgainstAllowlist(reinterpret_cast<const char*>(ASN1_STRING_get0_data(generalName->d.uniformResourceIdentifier)), allowlist)){
if (tlsCheckAgainstAllowlist(reinterpret_cast<const char*>(ASN1_STRING_get0_data(generalName->d.uniformResourceIdentifier)))){
sk_GENERAL_NAME_pop_free(subjectAltNames, GENERAL_NAME_free);
return true;
}
@@ -621,7 +597,7 @@ bool tlsCheckCertificateAgainstAllowlist(tls_connection* conn, std::set<sdsstrin
if (ipLen == 4){ //IPv4 case
char addr[INET_ADDRSTRLEN];
inet_ntop(AF_INET, ASN1_STRING_get0_data(generalName->d.iPAddress), addr, INET_ADDRSTRLEN);
if (tlsCheckAgainstAllowlist(addr, allowlist)){
if (tlsCheckAgainstAllowlist(addr)){
sk_GENERAL_NAME_pop_free(subjectAltNames, GENERAL_NAME_free);
return true;
}
@@ -637,36 +613,14 @@ bool tlsCheckCertificateAgainstAllowlist(tls_connection* conn, std::set<sdsstrin
sk_GENERAL_NAME_pop_free(subjectAltNames, GENERAL_NAME_free);
}
/* If neither the CN nor the SANs match, update the SSL error and return false */
conn->c.last_errno = 0;
if (conn->ssl_error) zfree(conn->ssl_error);
conn->ssl_error = (char*)zmalloc(512);
snprintf(conn->ssl_error, 512, "Client CN (%s) and SANs not found in allowlist.", commonName);
return false;
}
bool tlsCertificateRequiresAuditLogging(tls_connection* conn){
const char* cn = "";
if (tlsCheckCertificateAgainstAllowlist(conn, g_pserver->tls_auditlog_blocklist, &cn)) {
// Certificate is in exclusion list, no need to audit log
serverLog(LL_NOTICE, "Audit Log: disabled for %s", conn->c.fprint);
return false;
} else {
serverLog(LL_NOTICE, "Audit Log: enabled for %s", conn->c.fprint);
return true;
}
}
bool tlsValidateCertificateName(tls_connection* conn){
const char* cn = "";
if (tlsCheckCertificateAgainstAllowlist(conn, g_pserver->tls_allowlist, &cn)) {
return true;
} else {
/* If neither the CN nor the SANs match, update the SSL error and return false */
conn->c.last_errno = 0;
if (conn->ssl_error) zfree(conn->ssl_error);
size_t bufsize = 512;
conn->ssl_error = (char*)zmalloc(bufsize);
snprintf(conn->ssl_error, bufsize, "Client CN (%s) and SANs not found in allowlist.", cn);
return false;
}
}
static connection *createTLSConnection(int client_side) {
SSL_CTX *ctx = redis_tls_ctx;
if (client_side && redis_tls_client_ctx)
@@ -889,9 +843,6 @@ void tlsHandleEvent(tls_connection *conn, int mask) {
conn->c.state = CONN_STATE_ERROR;
} else {
conn->c.state = CONN_STATE_CONNECTED;
if (tlsCertificateRequiresAuditLogging(conn)){
conn->c.flags |= CONN_FLAG_AUDIT_LOGGING_REQUIRED;
}
}
}
-1
View File
@@ -7,7 +7,6 @@ enum VersionCompareResult
EqualVersion,
OlderVersion,
NewerVersion,
IncompatibleVersion,
};
struct SymVer
Loaded 100 of 126 files, more files were not shown because too many files have changed in this diff. Show more