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
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
Shahar Mike
35b0ab101e
fix(flushall): Decommit memory after releasing tables. (#2691)
In the fiber we used to call `mi_heap_collect()` when we're done
deleting items. But since that fiber captures a `vector` of intrusive
pointers to `DbTable`s, it can't free all memory used by the tables
themselves.

A local test shows that this fix helps almost entirely: when occupying a
5gb DB, `FLUSHALL` will reduce RSS by 4.7gb, leaving 300mb still used. A
follow up `MEMORY DECOMMIT` *will* indeed remove these 300mb, but I'm
still not sure why they are not released immediately. Still looking...

Addresses (1) of #2690
2024-03-05 15:45:13 +02:00
Roman Gershman
30ce250ab2
chore: Increase disk space in the coverage runs (#2684)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-03-04 15:29:00 +02:00
manojks1999
0081f4de71
Chore: Fixed Docker Health Check (#2659)
* docker_healthcheck_fix

* grep_fix_for_alpine

* added environment variable for healthcheck and changed the port extraction accorfingly
2024-03-04 12:47:18 +02:00
Yue Li
842249bc60
bug(tiering): fix overflow in page offset calculation and wrong hash offset calculation (#2683)
fix overflow in page offset calculation and wrong hash offset calculation
2024-03-04 10:08:22 +00:00
Kostas Kyrimis
1b3594ba35
fix: missing manual trigger for daily sanitizers (#2682)
* add manual trigger for usan/asan workflow
2024-03-04 11:40:01 +02:00
Kostas Kyrimis
f3ba448106
chore: make usan asan optional and enable them on CI (#2631)
* add daily job to run unit tests with asan/usan
2024-03-04 11:00:46 +02:00
romange
cf889486bc chore(helm-chart): update to v1.15.0 2024-03-04 05:54:31 +00:00
romange
d551c2a3d3 chore(helm-chart): update to v1.14.7 2024-03-04 04:24:20 +00:00
Roman Gershman
0c1150956b
chore: add oom stats to /metrics (#2680)
* chore: add oom stats to /metrics

Expose oom/cmd errors when we reject executing a command if we reached OOM state (controlled by oom_deny_ratio flag).
Expose oom/insert errors when we do not insert a new key or do not grow a dashtable (controlled by table_growth_margin).

Move OOM command check to a place that covers all types of transactions - including multi and squashing transactions. 
 
---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-03-03 18:01:21 +00:00
adiholden
7c443f3a15
feat(server): introduce table_growth_margin flag (#2678)
* feat(server): introduce table_growth_margin flag

Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-03-03 13:02:18 +00:00
Roman Gershman
93debc754c
chore: more fixes for macos (#2677)
1.Add back the search files to MacOs build (linker errors are fixed now).
2. Add default maxmemory argument (if not present already) when launching dragonfly process in regression tests.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-03-02 23:14:33 +02:00
Vladislav
9698f974ea
fix(snapshot): Fix flag access (#2676) 2024-03-01 16:21:57 +03:00
Roman Gershman
7ca45f9feb
chore: update helio dependency (#2674) 2024-03-01 10:30:36 +02:00
romange
7148479965 chore(helm-chart): update to v1.14.6 2024-03-01 02:51:15 +00:00
Borys
e57067d2fb
refactor(cluster): #2652 initiate migration process from CONFIG cmd (#2667)
* refactor(cluster): #2652 initiate migration process from CONFIG cmd
2024-02-29 16:08:53 +02:00
Roman Gershman
f8f213e22f
fix: optionally return float as integer from lua script (#2672)
Redis, due to its old lua enginer and bunch of historic reasons returns floats as integers from lua scripts.
This means `eval "return 42.9" 0` would return 42 as long integer.

Dragonfly supports both integers and floats in its lua engine, returning a precise "42.9" in the same scenario.
RESP2 does not support float types so "42.9" is returned as a bulk string for RESP2 connections. For RESP3, dragonfly
returns 42.9 as a native RESP3 double primitive.

This PR introduces an optional legacy behavior for Dragonfly only for the RESP2 protocol. When the `--lua_resp2_legacy_float` flag is passed,
Dragonfly will round down the double value to the nearest integer and return it as RESP2 native long integer.

Fixes #2664

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-02-29 15:34:51 +02:00
Shahar Mike
54cb7d5cd0
feat(cluster_mgr): Add support for remote Dragonfly servers (#2671)
* WIP: `cluster_mgr.py` to work with remote targets

* Documentation

* No admin port

* Support different hostname move/migrate

* Fix migrate bug

* Fix typo in --help

* fix test

* self.update_id()
2024-02-29 11:59:54 +02:00
adiholden
7e4527098b
fix(server): client pause work while blocking commands run (#2584)
fix #2576
fix #2661

Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-02-28 11:07:03 +00:00
Leonardo Mello
8ef92629c5
feat(generic_family): implement RANDOMKEY command (#2639)
Signed-off-by: Leonardo Mello <lsvmello@gmail.com>
2024-02-27 16:03:21 +02:00
Roman Gershman
cf9f10e94e
chore: fuly cover json_family API with json::Path parsing (#2663)
---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-02-27 14:58:59 +02:00
Vladislav
5ac5e3bdac
fix: replace localhost with 127.0.0.1 in cluster tests (#2665) 2024-02-27 12:53:54 +03:00
Roman Gershman
df39d3a286
chore: move jsoncons path code into dedicated files (#2666)
It's only a code move, without functional changes.
This is in preparation to implementing the same path functionality
for flexbuffers objects.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-02-27 11:50:24 +02:00
Roman Gershman
91c299b33e
chore: Del and NUMINCRBY use json::Path (#2655)
* chore: Del and NUMINCRBY use json::Path

Also, fix various protocol bugs when we sent simple string
instead of sending bulk strings.

Fixed a typo in path.cc that lead to a data race bug.

Finally, flip the flag in regression tests to start covering json::Path code
and added test coverage for the data race bug

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-02-26 14:06:21 +00:00
Kostas Kyrimis
d54f2201ae
feat: add current_fork_perc in info all command (#2640)
* add field current_snapshot_perc (instead of current_fork_perc)
* add field current_save_keys_processed
* add field current_save_keys_total
2024-02-26 11:17:31 +02:00
Roman Gershman
d54b600f31
chore: switch to self-built flatbuffers (#2657)
* chore: switch to self-built flatbuffers

This should solve the linker errors on MacOs build.

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-02-26 10:03:17 +02:00
Vladislav
58f284c4f4
chore: Move CallFromScript log to level 2 (#2656) 2024-02-25 12:25:28 +03:00
Roman Gershman
050649d762
chore: fully switch to dual parsing with json::Path (#2654)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-02-24 13:26:31 +02:00
Roman Gershman
2b30f69fe3
chore: JSON.GET now works with our own jsonpath (#2653) 2024-02-24 13:23:41 +02:00