1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-14 11:58:02 +00:00
Commit graph

854 commits

Author SHA1 Message Date
Vladislav
139e56b588
feat(server): Pubsub updates with RCU (#980)
Implements RCU (read-copy-update) for updating the centralized channel store.

Contrary to old mechanism of sharding subscriber info across shards, a centralized store allows avoiding a hop for fetching subscribers. In general, it only slightly improves the latency, but in case of heavy traffic on one channel it allows "spreading" the load, as the single shard no longer is a bottleneck, thus increasing throughput by multiple times.

See channel_store header for implementation details
2023-03-26 13:04:23 +03:00
Vladislav
0c83b09aea
fix(server): Fix hset buffer bug (#994)
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-03-26 12:53:09 +03:00
Vladislav
72f67eddd8
refactor(facade): Refactor reply builder (#991)
Refactor RedisReplyBuilder to simplify method overloads
2023-03-26 12:52:40 +03:00
Roman Gershman
ef4062d817
fix: improve connection affinity heuristic (#987)
fix: improve connection affinity heuristic.

1. fix potential crash bug when traversing connections with client list
2. fetch cpu/napi id information when handling a new connection.
3. add thread id (tid) and irqmatch fields to client list command.
4. Implement a heuristic under flag that puts a connection on the
   CPU id that handles the IRQ queue that handles its socket.
   However, if a too wide gap introduced between number of connections on
   IRQ threads and other threads we fallback to other threads.
   In my tests I saw 15-20% CPU reduction when this heuristic is enabled.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-03-25 23:00:27 +03:00
Roman Gershman
32f2f4b72a
fix: list_family_test works with async client (#992) 2023-03-25 21:28:29 +03:00
Roman Gershman
3939da1069
fix: Adapt json_test to async_client (#990) 2023-03-25 16:05:30 +03:00
Chaka
7be98d906d
bug(server): Fix crash in ZPOPMIN (#977)
* Fix crash in ZPOPMIN

Crash was due to an attempt to access nullptr[-1], which is bad :)

* Add test to repro crash.

There's some leftover debugging statements, they're somewhat useful so I
kept them as the bug is not yet fixed.

* Copy patch by romange to solve the crash

Also re-enable (uncomment) the test in utility.py.

Signed-off-by: chakaz <chakaz@chakaz>

---------

Signed-off-by: chakaz <chakaz@chakaz>
Signed-off-by: Chaka <chakaz@users.noreply.github.com>
Co-authored-by: chakaz <chakaz@chakaz>
2023-03-25 10:05:41 +03:00
Ikko Eltociear Ashimine
82121a205b
docs(rdb): fix typo (#989)
peform -> perform

Signed-off-by: Ikko Eltociear Ashimine <eltociear@gmail.com>
2023-03-25 09:08:39 +03:00
Roman Gershman
52ac06e358
chore: Improve client connection checking in pytests (#967)
Also fix the compatibility of "client list" with redis-py client.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-03-24 18:22:14 +03:00
Roman Gershman
12abe0bc12
chore: update helio dependency (#984)
Also remove direct references for boost fibers from the code.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-03-24 18:04:05 +03:00
ashotland
39174f398a
feat(server): Support Resp3 (#975)
Accept hello 3 command and switch to resp3 response format.

---------

Signed-off-by: ashotland <ari@dragonflydb.io>
2023-03-22 12:18:29 +02:00
adiholden
a2fdbc59c2
bug(replication): journal use shard mutex with change callback array (#973)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2023-03-22 10:48:01 +02:00
Vladislav
3a6b98f201
fix(pytest): Disable script test (#972) 2023-03-21 16:53:47 +03:00
ashotland
85a1bf8494
fix(tests):Comment out ZPOPMIN Action Again (#971)
fix(tests):Comment out SPOPMIN Action Again 

Until #949 is fixed

Signed-off-by: ashotland <ari@dragonflydb.io>
2023-03-21 15:26:46 +02:00
Vladislav
6d3a191a5f
tests(replication): Test script replication (#960)
Script replication test
2023-03-20 22:57:52 +03:00
romange
23e055e675 chore(helm-chart): update to v1.0.0 2023-03-20 08:52:56 +00:00
Vladislav
03fb21a280
feat(server): Replace channel slice with store (#938)
* feat(server): Replace channel slice with store

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-03-20 10:46:08 +02:00
Tarun Pothulapati
34aec80e5a
fix(docker): Use the right shebang in healthcheck.sh (#963)
Alpine images don't have bash installed by default, so we need to use
`/bin/sh` instead. This follows the *same existing convention that
we follow in the `entrypoint.sh` script*.

Both ubuntu and alpine images have been tested (i.e healthchecks to
pass) to work with this change.
2023-03-20 08:59:00 +02:00
ashotland
d2d70289ff
fix(tests): Revive commented out actions (#962)
* fix(tests): Revive commented out actions
---------

Signed-off-by: ashotland <ari@dragonflydb.io>
2023-03-19 22:30:50 +02:00
Vladislav
97c1712a02
fix(tests): Fix interpreter test (#961)
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-03-19 22:29:01 +02:00
Vladislav
696b85a259
fix(server): fix Interpreter::AddFunction (#959)
fix(server): fix interpreter::AddFunction

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-03-19 16:42:15 +02:00
Vladislav
623c5a85e3
fix(server): Fix transaction index + shard_data multi re-use (#958) 2023-03-19 12:18:02 +03:00
Vladislav
9f0e269a12
feat(server): Specify script flags with shebang (#944)
* feat(server): Specify script flags with shebang

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>

* fix(server): Ignore erros with no-writes flag

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-03-19 08:10:24 +02:00
chakaz
68cb4d006a Use atomic_bool for detecting if TopKeys is on.
Signed-off-by: chakaz <chakaz@chakaz>
2023-03-18 15:27:39 +02:00
chakaz
5b4af6dbd0 Enable TopKeys by default.
This is a better API as it's less confusing. This feature is still disabled by default via the controlling flag.

Signed-off-by: chakaz <chakaz@chakaz>
2023-03-18 15:27:39 +02:00
chakaz
96b44750fe Fix missing dependency.
Signed-off-by: chakaz <chakaz@chakaz>
2023-03-18 15:27:39 +02:00
chakaz
9dfa687034 Apply clang-format
Signed-off-by: chakaz <chakaz@chakaz>
2023-03-18 15:27:39 +02:00
chakaz
e9f5039665 feat(server): Introduce and use TopKeys class.
TopKeys uses a custom implementation of HeavyKeeper to track top (hot)
keys usage for debugging purposes.
This commit also integrates TopKeys (default off) into DbTable and counts
usage of (present) key lookups.

Signed-off-by: chakaz <chakaz@chakaz>
2023-03-18 15:27:39 +02:00
Roman Gershman
a9d6e0b58d feat: Support sse2 builds.
Reduce reliance on modern vectorized architectures pending proper configuration flags.
Should fix the daily build pipeline.
Fixes #732.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-03-18 15:21:12 +02:00
chakaz
9add31e20f Get DragonDB to compile with clang.
While at it, fix some compile warnings, 2 of them are actual bugs
(missing virtual d'tor).

Signed-off-by: chakaz <chakaz@chakaz>
2023-03-18 11:02:37 +02:00
Roman Gershman
bb78c6eae3
chore: Update license date 2023-03-17 22:24:05 +02:00
Roman Gershman
4870d8150c fix: Fix deadlock in the transaction code.
The deadlock happenned during the brpop flow where we access
shard_data.local_data from both coordinator and shard threads.
Originally, shard_data.local_data was not designed for concurrent access,
and I used ARMED bit to deduplicate callback runs for each shard.
The problem is that within BRPOP flow, the
ExecuteAsync would apply "=| ARMED" and in parallel NotifySuspended would apply
" |= AWAKED" in the shard thread, and both R/M/W operations would corrupt each other.

Therefore, I separated now completely shard-local local_data mask and is_armed boolean.
Moreover, since now we use atomics for is_armed, I increased PerShardData size to 64 bytes
to avoid false cache sharding betweenn PerShardData objects.

Fixes #945

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-03-17 20:36:11 +02:00
Roman Gershman
f4081f3979 fix: improve consistency around brpop flow
1. Added a test that was breaking earlier.
2. Made sure that multiple waked brpop transaction would not
   snatch items from one another.
3. Fixed watched-queues clean-up logic inside blocking_controller that caused deadlocks.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-03-17 11:49:23 +02:00
Roman Gershman
c96f637f73 chore: some pytests and logging improvements
1. pytest extensions and fixes - allows running them
   with the existing local server by providing its port (--existing <port>).
2. Extend "DEBUG WATCHED" command to provide more information about watched state.
3. Improve debug/vlog printings around the code.

This noisy PR is a preparation before BRPOP fix that will follow later.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-03-17 10:52:20 +02:00
Pascal S. de Kloe
f9ec60ee5f integration test docker image with Go client 2023-03-17 10:09:42 +02:00
Tarun Pothulapati
94b8951f5e fix(ci): Use correct x86-64 with builds
This commits fixes the flag to use the right format
for `x86-64`
2023-03-16 08:52:48 +02:00
adi_holden
dd03ce0cf0 -sfix(rdb_load): replica load expired keys 2023-03-15 13:12:39 +02:00
adiholden
bafad66fc3
fix(replication): redis replication flush all before full sync (#946)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2023-03-15 09:45:04 +02:00
Tarun Pothulapati
999caa1e4f feat(ci): Add daily builds BFS verification
This commit adds a scheduled job that runs 8 AM Israel time every day,
with common build configuration flags so that we can be sure
that building from source for known configurations is possible.
2023-03-14 23:17:08 +02:00
ashotland
eb962bb5a1
feat(server): hello and info sidekiq compatibility (#941)
Signed-off-by: ashotland <ari@dragonflydb.io>
2023-03-14 23:11:53 +02:00
Roman Gershman
66b4fbd14e fix: correctly set batching mode during pubsub
Previously we set batch mode when dispatch queue is not empty
but dispatch queue could contain other async messages related to pubsub or monitor.
Now we enable batching only if there are more pipeline commands in the queue.

In addition, fix the issue of unlimited aggregation of batching buffer.

Fixes #935.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-03-14 13:01:48 +02:00
adiholden
97e38aebd2
bug(redis replication): fix multi transaction replication stable state (#934)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2023-03-13 15:14:58 +02:00
adiholden
8e528f1fbb
fix(redis_replicaiton_test): fix compare set types (#929)
* fix(redis_replicaiton_test): fix compare set types

Signed-off-by: ashotland <ari@dragonflydb.io>
Co-authored-by: ashotland <ari@dragonflydb.io>
2023-03-13 13:37:58 +02:00
Roman Gershman
a8c1e5cd4a feat: increase expiry period to 8 years.
Related to #923.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-03-13 10:19:11 +02:00
Roman Gershman
bac9180602 chore: change thread_local to __thread when possible.
This should reduce the access cost to thread_local objects.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-03-12 21:57:56 +02:00
Vladislav
149b1fa913
feat(server): Pragmas from scripts (#927)
Parse script param pragmas from script source
2023-03-12 11:05:15 +03:00
ashotland
9c2363584a Delete api_status.md
Update references to docs site command reference.

Signed-off-by: ashotland <ari@dragonflydb.io>
2023-03-12 08:16:28 +02:00
Vahagn Aharonian
1371ce9270 feat(workflow): Add Vercel Docs Hook to release workflow 2023-03-12 08:15:57 +02:00
Roman Gershman
b88fc329a9 fix: serialize subscribe message together with publish message
Fixes #924

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-03-12 08:15:31 +02:00
Roman Gershman
2ec3d48534 fix: data race during Publish in PubSub
The issue happens when SendMsgVecAsync is called with PubMessage that has
string_view objects referencing objects in stack. We replace string_view
with either string or shared_ptr<string>

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-03-12 08:15:31 +02:00