1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-15 17:51:06 +00:00
Commit graph

2131 commits

Author SHA1 Message Date
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
Roman Gershman
16b737ce2a
chore: add a boilerplate for bloom filter family (#2782)
Consists of 3 basic functions:
BF.RESERVE, BF.ADD, BF.EXISTS

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-03-28 19:26:34 +02:00
Vladislav
ad13cc6b9c
feat(tiering): DiskStorage (#2770)
* feat(tiering): DiskStorage

Simple DiskStorage for future tiering purposes

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2024-03-27 21:31:35 +03:00
Kostas Kyrimis
cd20c4003d
chore(replication-tests): add cache_mode on test replication all (#2685)
* add cache_mode cases on test_replication_all
* fix CVCOnBumpUp to not skip some of the modified buckets
2024-03-27 14:28:52 +02:00
adiholden
6e32139ada
Benchmark runner (#2780)
* feat(github runner): add benchmark workflow

Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-03-27 07:31:19 +00:00
Binbin
9b1e1e0766
doc(README): fix outdated expiry ranges description (#2779)
In #932, the expiry period was increased to 8 years.
This PR updates outdated parts of several READMEs.
2024-03-27 06:53:16 +00:00
Kostas Kyrimis
7b7291c001
chore(ci): open last_log_file in append mode (#2776)
* open last_log_file in append mode
2024-03-26 19:01:26 +02:00
Kostas Kyrimis
4025b4a6af
fix: fiber preempts on read path and OnCbFinish() clears fetched_items_ (#2763)
* cache fetched_items_ before preemption such that OnCbFinish does not affect it
2024-03-26 16:38:47 +02:00
adiholden
2ad7439128
feat(server): support cluster replication (#2748)
* feat(server): support cluster replication

Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-03-26 15:26:19 +02:00
Kostas Kyrimis
3abee8a361
fix(ci): do not overwrite last_log_file among tests (#2759)
* add clean up semantics for tests such that we don't loose log files
2024-03-26 14:24:02 +02:00
Roman Gershman
78e329e960
chore: fix flat_dfs read tests. (#2772)
This commit fixes the logic around read only traversals over flexbuffer json object.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-03-26 13:03:43 +02:00
Shahar Mike
d8ce011749
feat(server): Add metric for RDB save duration. (#2768)
* feat(server): Add metric for RDB save duration.

This tracks both saving to RDB files, DFS files and full sync
replication.

* Add rdb_save_count
2024-03-26 12:47:18 +02:00
Roman Gershman
966d7f55ba
chore: preparation for basic http api (#2764)
* chore: preparation for basic http api

The goal is to provide very basic support for simple commands,
fancy stuff like pipelining, blocking commands won't work.

1. Added optional registration for /api handler.
2. Implemented parsing of post body.
3. Added basic formatting routine for the response. It does not cover all the commands but should suffice for
   basic usage.

The API is a POST method and the body of the request should contain command arguments formatted as json array.
For example, `'["set", "foo", "bar", "ex", "100"]'`.
The response is a json object with either `result` field holding the response of the command or
`error` field containing the error message sent by the server.
See `test_http` test in tests/dragonfly/connection_test.py for more details.


* chore: cover iouring with enable_direct_fd

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-03-25 12:12:31 +02:00
Fabiano Arruda
30ec81c456
Improve Helm chart to be rendered locally and on machines where is not the application target (#2706)
* fix(helm): add issuer group to create the certificate without wait for the previous created issuer

Signed-off-by: Fabiano Arruda Ferreira das Graças <fafg@fafg-mbm1.fritz.box>

* fix(helm): remove condition that can prevent the helm chart be rendered on machines where monitoring.coreos.com is not installed or is not the end target of the helm template command

Signed-off-by: fafg <fabiano.arruda@hotmail.com>

* fix(helm): lint - remove blank line

Signed-off-by: fafg <fabiano.arruda@hotmail.com>

* add(helm): missing service monitor test files

Signed-off-by: fafg <fabiano.arruda@hotmail.com>

* add(helm): add missing cert-manager test files

Signed-off-by: fafg <fabiano.arruda@hotmail.com>

* fix(helm): lint - add missing blank lines

Signed-off-by: fafg <fabiano.arruda@hotmail.com>

* fix(helm): rebase

Signed-off-by: fafg <fabiano.arruda@hotmail.com>

* Revert "fix(helm): rebase"

This reverts commit c4ce16b76e.

* fix(helm): fix service monitor namespace rendering

Signed-off-by: fafg <fabiano.arruda@hotmail.com>

* fix(helm): add missing up to date golden file

Signed-off-by: fafg <fabiano.arruda@hotmail.com>

* fix(helm): merge upstream

Signed-off-by: fafg <fabiano.arruda@hotmail.com>

* update golden files

* also install prom operator dependencies

* also install cert-manager

* skip cert-manager chart

* skip cert-manager value

* remove CI TLS files

* fix formatting

* fix formatting

* fix actions

---------

Signed-off-by: Fabiano Arruda Ferreira das Graças <fafg@fafg-mbm1.fritz.box>
Signed-off-by: fafg <fabiano.arruda@hotmail.com>
Co-authored-by: Tarun Pothulapati <tarun@dragonflydb.io>
Co-authored-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
2024-03-25 12:29:42 +05:30
Shahar Mike
b830a71e66
feat(replication): Do not auto replicate different master (#2753)
* feat(replication): Do not auto replicate different master

Until now, replicas would re-connect and re-replicate a master after the
master will restart. This is problematic in case the master loses its
data, which will cause the replica to flush all and lose its data as
well.

This is a breaking change though, in that whoever controls the replica
now has to explicitly issue a `REPLICAOF X Y` in order to re-establish
a connection to a new master. This is true even if the master loaded an
up to date RDB file.

It's not necessary if the replica lost connection to the master and the
master was always alive, and the connection is re-established.

Fixes #2636

* fix test

* fixes

* proxy proxy java java

* better comment

* fix comments

* replica_reconnect_on_master_restart

* proxy.close()
2024-03-24 12:04:37 +02:00
Vladislav
3aa4a29834
chore(transaction): Introduce RunCallback (#2760)
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2024-03-22 16:02:02 +03:00
Roman Gershman
9db825013a
chore: preparations for adding flat json support (#2752)
1. More test fixes to support both types
2. Adjust Aggregation functions to work with both types
3. jsonpath_test build from both types and passes for JsonType,
   the tests are skipped for flexbuffers

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-03-21 14:21:37 +02:00
Shahar Mike
9207dec983
feat(server): Add TLS usage to /metrics and INFO MEMORY (#2755) 2024-03-21 13:41:57 +02:00
Borys
d6b7df94bb
refactor: remove start-slot-migration cmd #2727 (#2728)
* refactor: remove start-slot-migration cmd #2727
2024-03-21 13:37:05 +02:00
Roman Gershman
31fabf2182
chore: journal cleanup (#2749)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-03-19 18:32:43 +00:00
Vladislav
1ec603e568
chore: Support json paths without root selector (#2747)
* chore: Support json paths without root selector

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2024-03-19 21:09:52 +03:00
Roman Gershman
2d246adbbb
chore: better error reporting when connecting to tls with plain socket (#2740)
* chore: better error reporting when connecting to tls with plain socket

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-03-19 17:20:23 +02:00
Roman Gershman
30c3f63ca2
chore: add skeleton files for flat_dfs code (#2738)
Also adjust jsonpath_test to be a typed test to allow run the same tests
for both jsoncons and flatbuffers.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-03-19 16:44:52 +02:00
Shahar Mike
f71eb5052d
fix(ssl): Proper cleanup (#2742) 2024-03-19 16:13:40 +02:00
Shahar Mike
5c69f5552c
fix(cluster): Save replica ID per replica (#2735)
Fixes #2734
2024-03-19 13:42:48 +02:00
Roman Gershman
f7292de4e7
chore: Introduce fiber stack allocator (#2730)
1. Use clib malloc for allocating fiber stacks but reduce the fiber stack size.
   clib malloc uses default 4K OS pages when reserving memory from the OS.
   The reason for not using mi_malloc, because we use 2MB large OS pages with mimalloc.
   However, allocating stacks is one of the cases, when using smaller 4KB memory pages is actually more
   RSS efficient because memory pages become hot at better granularity.

2. Add "memory_fiberstack_vms_bytes" metric exposing fiber stack vm usage.
3. Fix macos dependencies & update ci versions.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-03-18 13:51:33 +02:00
Shahar Mike
e9548a2917
fix(cluster): Reply with correct \n / \r\n from CLUSTER sub cmd (#2731)
* fix(cluster): Reply with correct `\n` / `\r\n` from `CLUSTER` sub commands

Fixes #2726

* fix tests
2024-03-17 10:23:46 +02:00
Vladislav
8e38d24fe2
chore: fix DeduceExecMode (#2733) 2024-03-16 17:37:53 +03:00
Borys
da2b4415be
refactor: block list refactoring #2580 (#2732) 2024-03-15 18:55:03 +02:00
Kostas Kyrimis
76d697aaff
feat: add flag masteruser (#2693)
* add flag masteruser
* fix ack reply on acl validation failure
2024-03-15 08:41:24 +02:00
Shahar Mike
e2b5d48837
feat(json): Deserialize ReJSON format (#2725)
* feat(json): Deserialize ReJSON format

This PR adds support for Redis-based JSON RDB format deserialization.
Since Redis uses ReJSON as a module, serialization is slightly different
from other types, but overall it's not a big change once we know where
all bits should be.

While this change knows how to _read_ Redis-based JSON keys, it does not
_save_ them in Redis format. That will be in a different PR.

This PR also ignores unknown (non-keys) module data instead of failing the load.

Fixes #2718

* Cleanup

* Add tests

* Skip unsupported modules

* Small refactor
2024-03-14 17:23:31 +02:00
Vladislav
9c6e6a96b7
fix(transaction): Replace with armed sync point (#2708)
1. Replaces run_barrier as a synchronization point with is_armed + an embedded blocking counter for awaiting running jobs
2. Replaces IsArmedInShard + GetLocalMask + is_armed.exchange chain with a single DisarmInShard() / DisarmInShardWhen

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2024-03-14 14:40:32 +00:00
Roman Gershman
7e0536fd4c
chore: remove core/fibers (#2723)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-03-14 12:02:33 +00:00