138 Commits

Author SHA1 Message Date
Malavan Sotheeswaran
a8c0f9b1c4 limit number of random elements returned based on config, exit loop early if client is being closed 2023-04-18 17:08:27 -07:00
Malavan Sotheeswaran
f54e3ea367
restore fork impl of save to replica sockets (#622)
* restore fork impl of save to slave sockets

* default to fork bgsave
2023-04-06 22:13:12 -04:00
Malavan Sotheeswaran
c8dd6744da
Add config for AWS s3 rdb save/load. (#591)
* add s3 config

* missing include

* ignore s3 config in config test

* Update introspection.tcl

* Update config.cpp
2023-03-08 16:00:44 -05:00
Malavan Sotheeswaran
7fcbfac103 snprintf fix 2023-02-14 17:51:19 -08:00
John Sully
687850a612 Make semi-ordered-set rehashing configurable to aid in latency tuning 2023-01-31 11:30:39 -08:00
Malavan Sotheeswaran
2498e0fc1f
fix macos build warnings/ remove 32 bit CI run (#522)
* fix macos build warnings

* remove 32 bit ci run as we no longer support it
2022-12-15 15:49:44 -05:00
Malavan Sotheeswaran
f5f1bd7605
Merge main with oss release sep29 2022 (#521)
* need to include stdint for uintptr_t

* need to include stdint for uintptr_t

* use atomic_load for g_pserver->mstime

* use atomic_load for g_pserver->mstime

* Integrate readwritelock with Pro Code

* Integrate readwritelock with Pro Code

* Defensive asserts for RWLock

* Defensive asserts for RWLock

* 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

* 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

* placement new instead of memcpy

* placement new instead of memcpy

* Remove asserts, RW lock can go below zero in cases of aeAcquireLock

* Remove asserts, RW lock can go below zero in cases of aeAcquireLock

* Inclusive language

* Inclusive language

* update packaging for OS merge

* update packaging for OS merge

* modify dockerfile to build within image

* modify dockerfile to build within image

* Make active client balancing a configurable option

* Make active client balancing a configurable option

* With TLS throttle accepts if server is under heavy load - do not change non TLS behavior

* With TLS throttle accepts if server is under heavy load - do not change non TLS behavior

* Only run the tls-name-validation test if --tls is passed into runtest

* Only run the tls-name-validation test if --tls is passed into runtest

* Fix KeyDB not building with TLS < 1.1.1

* Fix KeyDB not building with TLS < 1.1.1

* update changelog to use replica as terminology

* update changelog to use replica as terminology

* update copyright

* update copyright

* update deb copyright

* update deb copyright

* call aeThreadOnline() earlier

* call aeThreadOnline() earlier

* Removed mergeReplicationId

* Removed mergeReplicationId

* acceptTLS is threadsafe like the non TLS version

* acceptTLS is threadsafe like the non TLS version

* setup Machamp ci

* setup Machamp ci

* make build_test.sh executable

* make build_test.sh executable

* PSYNC production fixes

* PSYNC production fixes

* fix the Machamp build

* fix the Machamp build

* break into tests into steps

* break into tests into steps

* Added multimaster test

* Added multimaster test

* Update ci.yml

Change min tested version to 18.04

* Update ci.yml

Change min tested version to 18.04

* fork lock for all threads, use fastlock for readwritelock

* fork lock for all threads, use fastlock for readwritelock

* hide forklock object in ae

* hide forklock object in ae

* only need to include readwritelock in ae

* only need to include readwritelock in ae

* time thread lock uses fastlock instead of std::mutex

* time thread lock uses fastlock instead of std::mutex

* set thread as offline when waiting for time thread lock

* set thread as offline when waiting for time thread lock

* update README resource links

* update README resource links

* Fix MALLOC=memkind build issues

* Fix MALLOC=memkind build issues

* Fix module test break

* Fix module test break

* 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

* 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

* remove unused var in networking.cpp

* remove unused var in networking.cpp

* check ziplist len to avoid crash on empty ziplist convert

* check ziplist len to avoid crash on empty ziplist convert

* remove nullptr subtraction

* remove nullptr subtraction

* cannot mod a pointer

* cannot mod a pointer

* need to include stdint for uintptr_t

* need to include stdint for uintptr_t

* use atomic_load for g_pserver->mstime

* use atomic_load for g_pserver->mstime

* Integrate readwritelock with Pro Code

* Integrate readwritelock with Pro Code

* Defensive asserts for RWLock

* Defensive asserts for RWLock

* 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

* 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

* placement new instead of memcpy

* placement new instead of memcpy

* Remove asserts, RW lock can go below zero in cases of aeAcquireLock

* Remove asserts, RW lock can go below zero in cases of aeAcquireLock

* Inclusive language

* Inclusive language

* call aeThreadOnline() earlier

* call aeThreadOnline() earlier

* Removed mergeReplicationId

* Removed mergeReplicationId

* Make active client balancing a configurable option

* Make active client balancing a configurable option

* With TLS throttle accepts if server is under heavy load - do not change non TLS behavior

* With TLS throttle accepts if server is under heavy load - do not change non TLS behavior

* acceptTLS is threadsafe like the non TLS version

* acceptTLS is threadsafe like the non TLS version

* PSYNC production fixes

* PSYNC production fixes

* Ensure we are responsive during storagecache clears

* Ensure we are responsive during storagecache clears

* Ensure recreated tables use the same settings as ones made at boot

* Ensure recreated tables use the same settings as ones made at boot

* Converted some existing PSYNC tests for multimaster

* Converted some existing PSYNC tests for multimaster

* Inclusive language fix

* Inclusive language fix

* Cleanup test suite

* Cleanup test suite

* Updated test replica configs so tests make sense

* Updated test replica configs so tests make sense

* active-rep test reliability

* active-rep test reliability

* Quick fix to make psync tests work

* Quick fix to make psync tests work

* Fix PSYNC test crashes

* Fix PSYNC test crashes

* Ensure we force moves not copies when ingesting bulk insert files

* Ensure we force moves not copies when ingesting bulk insert files

* Disable async for hget commands as it is not ready

* Disable FLASH

* Fix crash in save of masterinfo

* Fix musl/Alpine build failures

* Remove unnecessary libs

* update readme

* update readme

* remove Enterprise references

* Limit max overage to 20% during RDB save

* Delete COPYING to replace with BSD license

* update deb master changelog

* Update license

* Fix Readme typo from github org transition

Replace mention of scratch-file-path with db-s3-object

* Fix reference counting failure in the dict.  This is caused by std::swap also swapping refcounts

* Fix assertion in async rehash

* Prevent crash on shutdown by avoiding dtors (they are unnecessary anyways)

* Initialize noshrink, it was dangling

* Prevent us from starting a rehash when one wasn't already in progress.  This can cause severe issues for snapshots

* Avoid unnecessary rehashing when a rehash is abandoned

* Dictionary use correct acquire/release semantics

* Add fence barriers for the repl backlog (important for AARCH64 and other weak memory models)

* Silence TSAN errors on ustime and mstime.  Every CPU we support is atomic on aligned ints, but correctness matters

* Disable async commands by default

* Fix TSAN warnings on the repl backlog

* Merge OSS back into pro

* Fix unmerged files

* Fix O(n^2) algorithm in the GC cleanup logic

* 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

* On Alpine we must have a reasonable stack size

* Revert ci.yml to unstable branch version

* Implements the soft shutdown feature to allow clients to cooperatively disconnect preventing disruption during shutdown

* Ensure clean shutdown with multiple threads

* update dockerfiles

* update deb pkg references and changelog

* update gem reference

* 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)

* Fix issue #454 (BSD build break)

* Do not allow commands to run in background when in eval, Issue #452

* Fix certificate leak during connection when tls-allowlists are used

* Fix issue #480

* Fix crash running INFO command while a disk based backlog is set

* check tracking per db

* fix warnings

* Fix a race when undoConnectWithMaster changes mi->repl_transfer_s but the connection is not yet closed and the event handler runs

* Fix a race in processChanges/trackChanges with rdbLoadRio by acquiring the lock when trackChanges is set

* Fix ASAN use after free

* Additional fixes

* Fix integer overflow of the track changes counter

* 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

* Fix race removing key cache

* Prevent crash on load in long running KeyDB instances

* Fixes a crash where the server assertion failed when the key exists in DB during RDB load

* Remove old assertion which is commented out.

* avoid from instatiating EpochHolder multiple times to improve performance and cpu utilization

* avoid from instatiating EpochHolder multiple times to improve performance and cpu utilization

* 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]

* Fix Issue #486

* Workaround bug in snapshot sync - abort don't crash

* Improve reliability of async parts of the soft shutdown tests

* Improve reliability of fragmentation tests

* Verify that partial syncs do indeed occur

* Fix O(n) algorithm in INFO command

* Remove incorrect assert that fires when the repl backlog is used fully

* Make building flash optional

* Remove unneeded gitlab CI file

* [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>

* trigger repl_curr_off!= master_repl_offset assert failure when having pending write case

* use debug for logging the message instead

* rocksdb log using up the diskspace on flash (#519)

* 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.

* remove unnecessary forward declaration

* remove internal ci stuff

* remove more internal ci/publishing

* submodule update step

* use with syntax instead

* bump ci ubuntu old ver as latest is now 22.04

* include submodules on all ci jobs

* install all deps for all ci jobs

Co-authored-by: Vivek Saini <vsaini@snapchat.com>
Co-authored-by: Christian Legge <christian@eqalpha.com>
Co-authored-by: benschermel <bschermel@snapchat.com>
Co-authored-by: John Sully <john@csquare.ca>
Co-authored-by: zliang <zliang@snapchat.com>
Co-authored-by: malavan <malavan@eqalpha.com>
Co-authored-by: John Sully <jsully@snapchat.com>
Co-authored-by: jfinity <38383673+jfinity@users.noreply.github.com>
Co-authored-by: benschermel <43507366+benschermel@users.noreply.github.com>
Co-authored-by: guybe7 <guy.benoish@redislabs.com>
Co-authored-by: Karthick Ariyaratnam (A) <k00809413@china.huawei.com>
Co-authored-by: root <paul.chen1@huawei.com>
Co-authored-by: Ilya Shipitsin <chipitsine@gmail.com>
Co-authored-by: Paul Chen <32553156+paulmchen@users.noreply.github.com>
Co-authored-by: Paul Chen <mingchen@Mings-MacBook-Pro.local>
Co-authored-by: Yossi Gottlieb <yossigo@gmail.com>
2022-12-14 12:17:36 -05:00
John Sully
84b37edfcf 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
a265f815e2 Merge OSS back into pro 2022-05-18 01:29:15 +00:00
John Sully
63e78ab7f3 Make active client balancing a configurable option 2022-04-18 23:07:15 +00:00
John Sully
3fc16f4144 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
8a3a4b6e61 Support dynamic runtime modification of tls-allowlist, and add config rewrite support 2022-03-31 17:48:37 -04:00
Vivek Saini
ab9c21f315 Changed term whitelist to allowlist (#54) 2022-03-31 14:15:03 -04:00
John Sully
003c9289e0 Optimize async command snapshot creation, and make slip configurable 2022-03-07 16:00:48 -05:00
John Sully
d77bbee238 Fix mac build breaks and remove license checks (won't work on mac) 2022-03-07 14:50:31 -05:00
Vivek Saini
8644595efc TLS Name Validation (#48)
Added TLS Name Validation
2022-03-03 13:59:07 -05:00
Vivek Saini
e17865322f Added TLS rotation support 2022-02-02 14:20:19 -05:00
VivekSainiEQ
bfcea943ea Merge remote-tracking branch 'mainpro/PRO_RELEASE_6' into keydbpro
Former-commit-id: 5a32d66ee382b6d227a67073afc81ca058d605ed
2021-12-06 20:43:23 +00:00
John Sully
5a3080dd8c Implent the force-backlog-disk-reserve flag
Former-commit-id: d39f7f4407f8935b1540dd302be3e24ac02c5700
2021-12-04 02:07:03 +00:00
Malavan Sotheeswaran
250e5b39a7 Merge branch 'keydbpro' into async_commands
Former-commit-id: 9eaddb8ca1424ff3225dac9c144d23848228c7d2
2021-11-30 11:47:51 -05:00
John Sully
2ed6d3f03a Implement the disk backed backlog functionality
Former-commit-id: 759cc01c6ba05f9a865c11580cc4975b5f1bd1d6
2021-11-26 03:05:23 +00:00
VivekSainiEQ
f9a355900a Merge remote-tracking branch 'opensource/unstable' into PRO_RELEASE_6
Former-commit-id: 60da86471f68b13e2456e113ecd4aa117d95b134
2021-11-12 21:12:53 +00:00
John Sully
9e5b7aaaa9 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
bdff0121eb Make the replica weighting configurable
Former-commit-id: be6a8a7e68acb5cfbe950f13b903e6f7b98c5a39
2021-10-29 17:59:46 +00:00
VivekSainiEQ
1d882b5ddd Merge tag '6.2.6' into Redis_626_Merge
Former-commit-id: e6d7e01be6965110d487e12f40511fe0b3497695
2021-10-21 22:33:55 +00:00
John Sully
af1c51dc53 Make async commands runtime configurable
Former-commit-id: 23bafb5f7c3c9805581f4bf09d9d5136898c2883
2021-09-21 20:49:44 +00:00
Maxime de Roucy
b834e66e2d 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: a1680fa612bdf5f521ea2c06b83994bf0797015a
2021-09-16 17:29:07 -04:00
John Sully
a560bcc4a2 Merge branch 'keydbpro_collab' into multithread_load
Former-commit-id: 8016c20f1f9a648e658c816e2f6777c5718d5e19
2021-08-09 20:20:34 +00:00
John Sully
26750791b3 Merge branch 'keydbpro' into keydbpro_collab
Former-commit-id: e4e5c6696c6d831924f314a198b266b10d831e14
2021-07-19 20:51:27 +00:00
John Sully
29ef9708fa 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
6fdd8449ff Merge branch 'keydbpro_collab' into multithread_load
Former-commit-id: b580a5561220bc6dc7bc073135f3045ba0cdda51
2021-06-02 04:24:49 +00:00
John Sully
075ce8db9e Merge branch 'merge_6.2.2' into keydbpro_collab
Former-commit-id: 54fe037e4e215b1e5bdb42b567c6df04a69ba150
2021-06-02 02:05:44 +00:00
John Sully
721e572275 Merge remote-tracking branch 'collab/keydbpro' into multithread_load
Former-commit-id: a09454b3a4b295b2d04bdb7d742db7f9a3e17be7
2021-05-31 01:16:01 +00:00
John Sully
6b4f686f5f Merge branch 'unstable' into keydbpro
Former-commit-id: 205d8f18d2bb8df5253bab40578b006b7aa73fd5
2021-05-28 23:32:46 +00:00
John Sully
e75e080e7e Fix TLS test failure due to tls-port not marked as runtime configurable
Former-commit-id: b0c8efd8407168d1d5435f417932323656efe109
2021-05-25 20:50:23 +00:00
John Sully
209f6ed49c Fix uninitialized variable
Former-commit-id: 9395a9c1d90859f88f3d82d66e50083c8409a3f8
2021-05-25 18:30:07 +00:00
John Sully
caba5639f4 Fix TLS Build Errors
Former-commit-id: aea86c5977c01debb4f4a4340c866aa5c5f20f04
2021-05-25 16:55:59 +00:00
John Sully
5267928381 Merge tag '6.2.2' into unstable
Former-commit-id: 93ebb31b17adec5d406d2e30a5b9ea71c07fce5c
2021-05-21 05:54:39 +00:00
John Sully
fe8efa916b Merge tag '6.2.1' into unstable
Former-commit-id: bfed57e3e0edaa724b9d060a6bb8edc5a6de65fa
2021-05-19 02:59:48 +00:00
VivekSainiEQ
7b982ae4c5 Changed branding in various locations
Former-commit-id: 96bca72bb4528a0789354ee4fd6bf3ab66d82bf7
2021-05-06 20:13:45 -04:00
John Sully
10383a8234 Add endurance testing to better detect threading bugs
Former-commit-id: 945e428aa110968479fdcdfc2d5c5308a99eadc3
2021-05-06 00:09:07 +00:00
John Sully
f41b79cea6 Merge branch 'keydbpro' into keydbpro_collab
Former-commit-id: 446daf8f4c33005096372ad9e29ae9b3d465c64e
2021-05-03 22:58:56 +00:00
John Sully
df66c598e9 Make prefetch configurable
Former-commit-id: 3b660347d70cc25d57119080bd43fb4671e36488
2021-04-12 03:38:57 +00:00
John Sully
9d0001ae7c Make prefetch configurable
Former-commit-id: 16996c048042bd3799c8051645bbe7c54137d54c
2021-04-08 19:52:38 +00:00
Cloud User
6684f150d6 Make high pri time thread configurable
Former-commit-id: 7e94207765d2166f46792aea0919786f3f30d7b3
2021-04-06 22:39:20 +00:00
benschermel
cd48001c21 addressing comments from merge review
Former-commit-id: 955aa69ca16ca7230d5099ad16f6f825402b5dd5
2021-03-23 18:41:59 +00:00
benschermel
88e6c73906 update enterprise wording for keydb.config lk
Former-commit-id: feb2d31e6544763c94f4abaea69bc98bd1cb8b17
2021-03-21 05:19:28 +00:00
John Sully
7fb41ba1bd Implement maxstorage config
Former-commit-id: 79e07859dfec14edf2a39646013e1a82db033d4f
2021-02-19 05:17:41 +00:00
christianEQ
cca8d186aa Merge remote-tracking branch 'opensource/unstable' into keydbpro
Former-commit-id: 5bad058733de2c217340bb9ee48f02b07d754808
2021-02-03 18:10:27 +00:00
christianEQ
da274b9c14 fixed replicaof no one config, added test case
Former-commit-id: e2615ccf88ddb2a93536b62318983780890c4819
2021-01-28 19:49:22 +00:00