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

2009 commits

Author SHA1 Message Date
adi_holden
1cb0ad5852 add kubectl config get-contexts
Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-04-01 13:29:04 +03:00
adi_holden
bd0c24136b try to run on github runner
Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-03-27 13:02:57 +02:00
adi_holden
34e4957224 use helm/kind-action
Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-03-27 12:35:02 +02:00
adi_holden
5c0fc9be20 print clusterinfo
Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-03-27 12:11:15 +02:00
adi_holden
1c106dfc76 sudo add
Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-03-27 09:58:59 +02:00
adi_holden
e23a0baba8 script checks after benchmark
Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-03-26 15:56:43 +02:00
adi_holden
a72bf67faa feat(github runner): add benchmark workflow
Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-03-26 15:54:43 +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
Kostas Kyrimis
094df3ef3f
fix(BgSave): async from sync (#2702)
* make BgSave command async
2024-03-14 13:31:58 +02:00
Kostas Kyrimis
95538dbad6
fix(transaction): nullptr access on non transactional commands (#2724)
* fix nullptr access on non transactional commands in client tracking
2024-03-14 10:07:24 +02:00
Vladislav
12d76dd5c2
chore: Record cmd stat from invoke (#2720)
1. Pipeline squashing was not recorded
2. Apparently Redis counts commands of MULTI/EXEC transations separately, so I assume we also should
-> Place RecordCmd() in Invoke()
2024-03-13 10:56:17 +03:00
romange
e9734e7c11 chore(helm-chart): update to v1.15.1 2024-03-12 15:49:57 +00:00
Roman Gershman
954780edd1
Remove check-fail in ExpireIfNeeded and introduce DFLY LOAD (#2699)
* chore: prevent crashing upon inconsistent expiry table

Also, introduce "DFLY LOAD <filename>" command in addition to "DEBUG LOAD"
as an official command to load snapshots into the running server.


---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-03-12 16:54:13 +02:00
Shahar Mike
8a5ed442d1
chore: Use c-ares for resolving hosts in ProtocolClient (#2719)
We already have a Fiber-aware DNS resolver in Helio, so it's trivial to
change and use.

I tested this end-to-end and it really resolves DNS addresses, not just
localhost.

Fixes #947
2024-03-12 14:39:22 +02:00
Kostas Kyrimis
d6107e55c5
chore: update sanitizers workflow (#2686)
* change timeout duration
* remove failing false positive tests
2024-03-12 14:19:12 +02:00
Kostas Kyrimis
a96d4e4dc8
chore: disable flaky fuzzy migration test (#2716) 2024-03-12 14:18:43 +02:00
Roman Gershman
d709f2a911
chore: improve compatibility of EXPIRE functions with Redis (#2696)
* chore: improve compatibility of EXPIRE functions with Redis

Also, provide a module name if stumbled upon module data that can not be loaded
by dragonfly.

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-03-12 13:50:08 +02:00
Vladislav
4a9f816106
chore(transaction): Don't call GetLocalMask from blocking controller (#2715)
chore: remove reliance on GetLocalMask in BlockingController
2024-03-12 11:53:41 +03:00
Vladislav
9ccf2b9871
chore(transaction): Simplify PollExecution (#2712) 2024-03-12 09:09:29 +03:00
Vladislav
a3dc9382bb
chore: Pull helio with new BlockingCounter (#2711)
Pull helio with new BlockingCounter and fix all usages to use -> operator

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2024-03-11 08:03:18 +00:00
Shahar Mike
9ba532a826
feat(server): Use mimalloc in SSL calls (#2710)
* feat(server): Use mimalloc in SSL calls

Until now, OpenSSL used `malloc()` directly. This PR overrides it to use
mimalloc.

Fixes #2709

* Add generate-tls-files.sh
2024-03-11 08:25:59 +02:00
Shahar Mike
8b31195798
feat(cluster): Add --cluster_id flag (#2695)
* feat(cluster): Add `--cluster_id` flag

This flag sets the unique ID of a node in a cluster.

It is UB (and bad) to set the same IDs to multiple nodes in the same
cluster.

If unset (default), the `master_replid` (previously known as `master_id`) is used.

Fixes #2643
Related to #2636

* gh comments

* oops - revert line removal

* fix

* replica

* disallow cluster_node_id in emulated mode

* fix replica test
2024-03-10 20:16:31 +02:00
Roman Gershman
7f02d40b57
chore: add ubuntu22 devcontainer (#2700) 2024-03-09 17:38:01 +02:00
Vladislav
6df0fa4948
fix(channel store): add acquire/release pair in fast update path (#2704)
This pointer is shared between threads and updated immediately, but the memory behind it is not synced.
2024-03-09 11:49:18 +03:00
Vladislav
292c5bcd71
chore: little transaction cleanup (#2608)
Make renabled_autojournal a regular bool, simplify CancelShardCb logic

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

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2024-03-08 09:50:09 +03:00
Vladislav
22e413a00b
Basic FT.AGGREGATE (#2413)
Introduces basic FT.AGGREGATE command, supporting GROUPBY, SORTBY, LIMIT

Signed-off-by: Vladislav <vladislav.oleshko@gmail.com>

---------
2024-03-08 08:51:51 +03:00
Borys
98616755c0
feat(cluster): automatic slot migration finalization #2697 (#2698)
* feat(cluster): automatic slot migration finalization #2697
2024-03-07 20:29:21 +02:00
Roman Gershman
b38024ba4f
chore: add malloc-based stats and decommit (#2692)
* chore: add malloc-based stats and decommit

Provides more stats and control with glibc-malloc based allocator.
For example,
with v1.15.0 (--proactor_threads=2), empty database, `info memory`returns

```
used_memory:614576
used_memory_human:600.2KiB
used_memory_peak:614576
used_memory_peak_human:600.2KiB
used_memory_rss:19922944
used_memory_rss_human:19.00MiB
```

then during `memtier_benchmark  -n 300000  --key-maximum 100000 --ratio 0:1 --threads=30 -c 100` (i.e GET-only with 3k connections):

```
used_memory:614576
used_memory_human:600.2KiB
used_memory_peak:614576
used_memory_peak_human:600.2KiB
used_memory_rss:59985920
used_memory_rss_human:57.21MiB
used_memory_peak_rss:59985920
```

connections overhead grows by ~39MB.
when the traffic stops, `used_memory_rss_human` becomes `30.35MiB`
and we do not know where 11MB gets lost and `MEMORY DECOMMIT` does not reduce the RSS.

With this change, `memory malloc-stats` return during the memtier traffic
```
malloc arena: 394862592
malloc fordblks: 94192
```
i.e. 395MB virtual memory was allocated by malloc and only 94KB is chunks available for reuse.
395MB is arena virtual memory, and not RSS obviously, but at least we have some visibility into malloc reservations.
The RSS usage is the same ~57MB and the difference between virtual and RSS is due to the fact we reserve fiber stacks of size 131KB but we touch less.
After the traffic stops, `arena` is reduced to 134520832 bytes, and fordblks are 133016592, i.e. majority of reserved ranges are also free (available to reuse) in the malloc pools.
RSS goes down similarly to before to ~31MB.

So far, this PR only demonstrated the increased visibility to mmapped ranges reserved by glibc malloc.
The additional functional change is in `MEMORY DECOMMIT` that now trims malloc RSS usage from reserved but unused (fordblks) pages
by calling `malloc_trim`.
After the call, RSS is: `used_memory_rss_human:20.29MiB` which is almost the same as when we started the empty process.

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

* chore: fix build for older glibc environments

Disable these extensions for alpine and use legacy version
for older glibc libraries.
---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-03-06 13:11:44 +00:00
Borys
dfedaf7e6e
refactor: remove FULL-SYNC-CUT cmd #2687 (#2688)
* refactor: remove FULL-SYNC-CUT cmd #2687
2024-03-06 14:26:35 +02:00
Shahar Mike
66b87e16c2
feat(server): Account for serializer's temporary buffer size (#2689)
* feat(server): Account for serializer's temporary buffer size

* gh comments
2024-03-06 13:39:32 +02:00