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

2213 commits

Author SHA1 Message Date
Kostas Kyrimis
41d463ae3d
fix: test_replicaof_reject_on_load crash on stop (#2818)
* Migrate might fail if dispatch_fiber is active. In that case do no crash but return false to indicate that the migration was not successful.
* After we migrate, we might find ourselves with the socket closed (because of the shutdown signal process/flow). We need to check that the socket is open. If it's not, it means that it was shutdown by the signal flow (because after we finish with DispatchTracker, we start iterating over all of the connections in all of the shards and shut them down.
2024-04-09 10:01:32 +03:00
Roman Gershman
57d567639c
chore: serialize SBF (#2846)
* chore: serialize SBF

SAVE/LOAD supports SBF now. Also fixes MallocUsed for SBF.

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-04-09 09:57:24 +03:00
adiholden
b1e688b33f
bug(server): set connection flags block/pause flag on all blocking commands (#2816)
* bug((server)): set connecttion blocking and puash flags on all blocking commands

Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-04-09 09:49:33 +03:00
Vladislav
23106d4be5
feat(tiering): TieredStorageV2 (#2849)
Implements basic high-level tiered storage

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2024-04-09 09:03:51 +03:00
Shahar Mike
b8693b4805
feat(cluster): Send number of keys for incoming and outgoing migrations. (#2858)
The number of keys in an _incoming_ migration indicates how many keys
were received, while for _outgoing_ it shows the total number. Combining
the two can provide the control plane with percentage.

This slightly modified the format of the response.

Fixes #2756
2024-04-08 21:17:03 +03:00
romange
2e00d42fa6 chore(helm-chart): update to v1.16.1 2024-04-08 14:56:04 +00:00
Roman Gershman
604e9c6e97
fix: authorize the http connection to call commands (#2863)
fix: authorize the http connection to call DF commands

The assumption is that basic-auth already covers the authentication part.
And thanks to @sunneydev for finding the bug and providing the tests.
The tests actually uncovered another bug where we may parse partial http requests.
This one is handled by https://github.com/romange/helio/pull/243

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-04-08 13:19:01 +03:00
adiholden
ee8e5a53bf
fix(pytest): dont check process return code on kill (#2862)
fix pytest: dont check process return code on kill

Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-04-08 07:08:05 +00:00
adiholden
700fae6a58
feat(server): add prints on takeover timeout (#2856)
feat server: add prints on takeover timeout

Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-04-08 08:52:36 +03:00
adiholden
a5ea47f2d9
fix(pytest): make pytests fail if server crash on shutdown (#2827)
* fix pytests: make pytests fail if server crash on shutdown

Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-04-07 15:30:04 +03:00
Shahar Mike
10ebe934be
fix(server): Do not block admin-port commands (#2842)
There are a few use cases which cause a temporary block of connections:
* `CLIENT PAUSE` command
* replica takeover
* cluster config / migration

Before this PR, these commands interfered with replication / migration
connections, which could cause delays and even deadlocks.

We do not want such internal connections to ever be blocked, and it's ok
to assume they won't issue regular "data" commands. As such, this PR
disables blocking any commands issued via an admin-port, and once merged
we'll recommend issuing replication and cluster migration via the admin
port.

Fixes #2703
2024-04-07 13:55:52 +03:00
Roman Gershman
2cf7f21a00
fix: possible crash in tls code (#2854)
Fixes #2851

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-04-07 11:29:41 +03:00
Roman Gershman
934a8c64c9
fix: healthcheck for docker containers (#2853)
* fix: healthcheck for docker containers

Fixes #2841

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-04-07 10:49:00 +03:00
Vladislav
76729d6e4c
fix(tests): Fix numsub test (#2852)
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2024-04-07 09:48:57 +03:00
Borys
b994f934d3
refactor: clean cluster slot migration code (#2848)
* refactor: clean cluster slot migration code
2024-04-05 16:44:25 +03:00
Vladislav
5fcd64aea9
feat(tiering): Simplest small bins (#2810)
Simplest small bins to unite values significantly less than 2k into separate bins

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2024-04-05 15:32:12 +03:00
Kostas Kyrimis
0d91e0313d
chore: generalize CompactObject::AllocateMR (#2847)
* allow AllocateMR from args
2024-04-05 13:55:37 +03:00
Roman Gershman
1987d1af70
chore: expose direct API on Bloom objects (#2845)
Needed to be able to (de)serialize SBF objects.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-04-05 11:38:09 +03:00
Borys
482bd58787
feat(cluster): add migration removing by config #2835 (#2844) 2024-04-05 11:03:54 +03:00
Roman Gershman
c8426cfd31
chore: implement path mutation for JsonFlat (#2805)
* chore: implement path mutation for JsonFlat

This is done by converting the flat blob into mutable c++ json
and then building a new flat blob.

Also, add JsonFlat encoding to CompactObject class.
---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-04-04 17:33:56 +00:00
Vladislav
845f01c7fd
feat(tiering): Simple OpManager (#2781)
* feat(tiering): Simple OpManager

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2024-04-04 20:24:12 +03:00
Borys
7b419c6d10
refactor(cluster): replace sync_id with node_id for slot migration #2835 (#2838) 2024-04-04 10:14:03 +03:00
Vladislav
fbc55bb82d
feat(transaction): Idempotent callbacks (immediate runs) (#2453)
This commit generalizes the machanism of running transaction callbacks during scheduling, removing the need for specialized ScheduleUniqueShard/RunQuickie. Instead, transactions can be run now during ScheduleInShard - called "immediate" runs - if the transaction is concluding and either only a single shard is active or the operation can be safely repeated if scheduling failed (idempotent commands, like MGET).

Updates transaction stats to mirror the new changes more closely.

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2024-04-03 23:06:57 +03:00
Borys
84d451fbed
fix: #2745 don't start migration process again after apply the same the same config is applied (#2822)
* fix: #2745 don't start a migration process again after the same config is applied
refactor: remove extra includes
2024-04-03 10:21:27 +03:00
romange
3e71ab7bde chore(helm-chart): update to v1.16.0 2024-04-03 05:34:24 +00:00
Roman Gershman
8bd35754de
fix: io_uring/fibers bug in DnsResolve (#2825)
Pull helio that fixes the bug.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-04-02 20:58:43 +03:00
adiholden
987fbb640e
fix(replication): replication with multi shard sync enabled lagging (#2823)
fix replication: fix replicaiton with multi shard sync enabled

Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-04-02 14:53:35 +00:00
Roman Gershman
8937e28bc2
chore: Fix build by disabling the tests. (#2821)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-04-02 15:21:28 +03:00
adiholden
bb242a7894
bug(server): do not write lsn opcode to journal (#2814)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-04-02 09:51:42 +03:00
Roman Gershman
a93ad4e86f
chore: bloom test - cover corner cases (#2806)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-04-02 09:18:36 +03:00
Roman Gershman
d3b90c8210
fix: correct json response for errors (#2813)
Fixes #2811

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-04-01 22:56:26 +03:00
Kostas Kyrimis
b2e2ad6e04
feat(server): check master journal lsn in replica (#2778)
Send journal lsn to replica and compare the lsn value against number of records received in replica side

Signed-off-by: kostas <kostas@dragonflydb.io>
Co-authored-by: adi_holden <adi@dragonflydb.io>
2024-04-01 17:51:31 +03:00
Borys
3ec43afd30
DFLYMIGRATE ACK refactoring (#2790)
* refactor: #2743 send dflymigrate flow from source
* refactor: DFLYMIGRATE ACK is sent from source node #2744
2024-04-01 12:29:17 +03:00
Roman Gershman
0d1b3c0d88
fix: propagate memcached flags to replica (#2807)
Fixes #1758

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-04-01 10:20:36 +03:00
Roman Gershman
6ca6ddb47d
chore: refactor StringFamily::Set to use CmdArgParser (#2800)
* chore: refactor StringFamily::Set to use CmdArgParser

Signed-off-by: Roman Gershman <roman@dragonflydb.io>

* chore: adress comments
---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-03-31 23:00:22 +03:00
Kostas Kyrimis
44b0283122
fix: SBF memory leaks (#2803)
* fix: sbl memory leaks
2024-03-31 17:51:14 +03:00
Roman Gershman
7f0f624699
feat: add bf.(m)add and bf.(m)exists commands (#2801)
Adresses #1275

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-03-31 15:50:21 +03:00
Shahar Mike
1d04683c48
fix(cluster): Don't miss updates in FLUSHSLOTS (#2783)
* fix(flushslots): Don't miss updates in `FLUSHSLOTS`

This PR registers for PreUpdate() from inside the `FLUSHSLOTS` fiber so
that any attempt to update a to-be-deleted key will work as expected
(first delete, then apply the change).

This fixes several issues:

* Any attempt to touch bucket B (like insert a key), where another key
  in B should be removed, caused us to _not_ remove the latter key
* Commands which use an existing value but not completely override then,
  like `APPEND` and `LPUSH` did not treat the key as removed but instead
  used the original value

Fixes #2771

* fix flushslots syntax in test

* EXPECT_EQ(key:0, xxxx)

* dbsize
2024-03-31 15:47:38 +03:00
Kostas Kyrimis
7d093460f0
fix(ci): malloc trim on sanitizers workflow (#2794)
* remove malloc_trim from sanitizers build
2024-03-30 21:52:43 +02:00
Roman Gershman
9e23f85e6b
chore: expose SBF via compact_object (#2797)
* chore: expose SBF via compact_object
---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-03-30 22:35:22 +03:00
Roman Gershman
6d87acfc43
chore: fix daily build (#2798)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-03-30 22:00:42 +03:00
Vladislav
1e7f22c7f2
chore(tiering): Disable compilation for MacOs (#2799)
fix(tiering): Disable compilation for MacOs
2024-03-30 21:06:21 +03:00
Roman Gershman
5d998d0387
chore: add SBF data structure (#2795)
* chore: add SBF data structure

Based on https://gsd.di.uminho.pt/members/cbm/ps/dbloom.pdf

The data-structure itself is a growing list of bloom filters,
where the next filter has exponentially larger capacity with exponentially tighter error bound.

The Exist() goes over all the filters and it's enough that at least one of them returns a positive result.
For Add(), we make ensure that all the existing filters do not have the element, as well as making sure that the last
filter that is being filled does not cross its maximum designated capacity.

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-03-30 02:22:41 +03:00
Roman Gershman
64abe2642f
chore: add bloom filter class (#2791)
* chore: add bloom filter class

Based on https://github.com/jvirkki/libbloom implementation.

Unlike the original, our implementation uses XXH3 hash function to seed bit index generation.
In addition, it assumes mi_malloc interface for dynamic allocation.

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-03-29 18:44:59 +03:00
Kostas Kyrimis
9d5bd99f5c
fix: sanitizers clang build and clean up some warnings (#2793)
* fix sanitizers build on clang
* clean up some warnings
2024-03-29 17:13:37 +02:00
Kostas Kyrimis
d5c958872d
fix: new[] delete[] missmatch in disk_storage (#2792)
* replace delete with delete[] in disk_storage
2024-03-29 13:53:51 +00:00
Kostas Kyrimis
095ed161d2
chore: disable test_cluster_slot_migration (#2788)
* disable test_cluster_slot_migration because it needs refactoring -- design has changed
2024-03-29 09:51:24 +00:00
Kostas Kyrimis
370f334baf
chore: remove duplicate code from dash and simplify (#2765)
* rename all Policy members for consistency
* remove duplicate code
2024-03-29 11:14:58 +02:00
Vladislav
c8724adddf
chore: Fix memcached flags not updated (#2787)
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2024-03-29 12:10:58 +03:00
Roman Gershman
05084354c7
chore: introduce conversion routines between JsonType and FlatJson (#2785) 2024-03-29 11:47:49 +03:00