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

2497 commits

Author SHA1 Message Date
Daniel M
e3016a6f83
test: tests using fakeredis to check compatibility (#3534)
* fakeredis tests
2024-08-22 22:30:42 +03:00
Kostas Kyrimis
80972c7ace
fix: build errors in sanitizers daily workflow (#3542)
* disable warning for the problematic block in list_family

---------

Signed-off-by: kostas <kostas@dragonflydb.io>
2024-08-22 17:52:35 +00:00
Stepan Bagritsevich
6cfbc08013
fix(jsonpath): Add JsonPath grammar for the child identifier in brackets (#3533)
* fix(jsonpath): Add json path grammar for the child identifier with brackets

fixes dragonflydb##3511

---------

Signed-off-by: Stepan Bagritsevich <bagr.stepan@gmail.com>
2024-08-22 13:49:50 +03:00
romange
822a8fddc9 chore(helm-chart): update to v1.21.3 2024-08-22 10:33:47 +00:00
Roman Gershman
cec3659b51
fix: named volume permissions in docker (#3518)
Fixes #2917

The problem is described in this "working as intended" issue https://github.com/moby/moby/issues/3124
So the advised approach of using "USER dfly" directive does not really work because it requires
that the host will also define 'dfly' user with the same id. It's unrealistic expectation.

Therefore, we revert the fix done in #1775 and follow valkey approach:
https://github.com/valkey-io/valkey-container/blob/mainline/docker-entrypoint.sh#L12

1. we run the entrypoint in the container as root which later spawns the dragonfly process
2. if we run as root:
   a. we chmod files under /data to dfly.
   b. use setpriv to exec ourselves as dfly.
3. if we do not run as root we execute the docker command.

So even though the process starts as root, the server runs as dfly and only the bootstrap
part has elevated permissions is used to fix the volume access.

While we are at it, we also switched to setpriv following the change of https://github.com/valkey-io/valkey-container/pull/24/files

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-08-22 11:33:29 +03:00
Vladislav
1bf6d73aa3
fix(transaction): Don't set continuation for blocking (#3540) 2024-08-21 17:48:23 +00:00
Borys
8266c8d026
fix: MC flags size and serialization #3134 (#3538) 2024-08-21 18:31:03 +03:00
Kostas Kyrimis
51f6bbed09
fix: macos build (#3536)
* define IOV_MAX on macos if it's not defined

---------

Signed-off-by: kostas <kostas@dragonflydb.io>
2024-08-21 16:33:45 +03:00
Stepan Bagritsevich
54cf6f0d06
fix(search_family): Add error on creating indexes from non-zero databases (#3537) 2024-08-21 15:19:21 +03:00
Kostas Kyrimis
4835b5debc
fix: deadlock in Heartbeat() (#3530)
* acquire and immediately release db_slice.GetSerializationMutex() in Heartbeat()

---------

Signed-off-by: kostas <kostas@dragonflydb.io>
2024-08-20 17:32:04 +03:00
Kostas Kyrimis
b979994025
fix: skip empty objects on load and replication (#3514)
* skip empty objects in rdb save
* skip empty objects in rdb load
* delete empty keys in FindReadOnly

---------

Signed-off-by: kostas <kostas@dragonflydb.io>
2024-08-20 09:44:41 +03:00
Vladislav
84a697dd75
chore(traffic loger): use pipelining and print/analyze commands (#3527)
Add run, print, analyze commands to traffic logger; add support for pipelines
2024-08-20 09:32:15 +03:00
Vladislav
f90ae4fcff
chore(config): make pipeline_squash configurable (#3529) 2024-08-20 09:31:44 +03:00
Kostas Kyrimis
86e79e13c5
fix: disable sanitizers false positive (#3522)
* disable false positive test cases

---------

Signed-off-by: kostas <kostas@dragonflydb.io>
2024-08-19 13:46:14 +03:00
Vladislav
d13cd53e17
chore(io): Optimize repeated ReservePiece calls (#3525) 2024-08-19 13:20:34 +03:00
Vladislav
1f36c9952d
chore(io): Introduce (carefully) new io with use_new_io flag (#3513)
Plugs in new IO, must be reverted after successful testing
2024-08-16 16:56:04 +03:00
romange
cd450c2ea8 chore(helm-chart): update to v1.21.2 2024-08-16 01:56:58 +00:00
Kostas Kyrimis
d3a893f2a6
fix: disable ThreadLocalMutex when big value ser is off (#3521)
* fix: disable ThreadLocalMutex when big value ser is off

* refactor: address comments

---------

Co-authored-by: Ubuntu <ubuntu@ip-172-31-28-29.ec2.internal>
Co-authored-by: Borys <borys@dragonflydb.io>
2024-08-15 22:19:01 +03:00
Shahar Mike
ad3ebf61d2
feat(cluster): Allow appending RDB to existing store (#3505)
* feat(cluster): Allow appending RDB to existing store

The goal of this PR is to support the loadoing of multiple RDB files into a single server, like when migrating from a Valkey cluster to Dragonfly with a different number of nodes.

It makes the following changes:

* Removes `DEBUG LOAD`, as we already have `DFLY LOAD`
* Adds `APPEND` option to `DFLY LOAD` (i.e. `DFLY LOAD <filename> APPEND`) that loads an RDB without first flushing the data store, overriding existing keys
* Does not load keys belonging to unowned slots, if in cluster mode

Fixes #2840
2024-08-15 14:56:40 +03:00
Shahar Mike
5b546df94d
chore: Change Lua embedded flags syntax (#3517)
Background

We tried to be compatible with Valkey in their support of Lua flags, but we generally failed:

We are not really compatible with Valkey because our flags are different (we reject unknown flags, and Valkey flags are unknown to us)
The #!lua syntax doesn't work with Lua (# is not a comment), so scripts written for older versions of Redis can't be used with Dragonfly (i.e. they can't add Dragonfly flags and remain compatible with older Redis versions)
Changes

Instead of the previous syntax:

#!lua flags=allow-undeclared-keys,disable-atomicity

We now use this syntax:

--!df flags=allow-undeclared-keys,disable-atomicity
It is not backwards compatible (with older versions of Dragonfly), but it should be very easy to adapt to, and doesn't suffer from the disadvantages above.

Related to #3512
2024-08-15 08:04:20 +03:00
Roman Gershman
81eff01b9d
fix: bugs around the growth of a tiered file (#3516)
1. Before - when 15% margin of total size becomes larger than 256MB, we increased the file by 256MB even though
   we still had unused 256MB. Now it's fixed.
2. We attempted to grow a file even if it reached the limit and then returned the error.
   It is wrong handle "reach the limit" state as an error - it's just a logical constraint,
   so now we do not attempt to grow and handle this quietly.
3. There was a segfault bug in extent tree in case the existing segment and the new one needs to be united.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-08-15 07:24:31 +03:00
Roman Gershman
93f6773297
chore: reduce pipelining latency by reusing existing shard fibers (#3494)
* chore: reduce pipelining latency by reusing existing shard fibers

To prove the benefits, run `./dfly_bench --pipeline=50   -n 20000  --ratio 0:1  --qps=0  --key_maximum=1`
Before: the average pipelining latency was 10ms
After: the average pipelining latency is 5ms.
Avg latency: pipelined_latency_usec / total_pipelined_squashed_commands

Also, improved counting of squashed commands - to count actual squashed ones.
---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-08-14 14:45:54 +03:00
Roman Gershman
a2e63f144c
fix: clang warnings (#3509)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-08-14 09:39:56 +00:00
Roman Gershman
fa0913e662
chore: introduce a secondary TaskQueue for shards (#3508)
Also allow the TaskQueue to support multiple consumer fibers.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-08-14 10:53:29 +03:00
Roman Gershman
5cfe4154cc
chore: split engine_shard file from engine_shard_set (#3507)
No functional changes besides that.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-08-13 22:27:46 +03:00
Kostas Kyrimis
0786fc83c1
fix: missing virtual destructors in ReplyBuilder2 (#3506) 2024-08-13 17:20:15 +03:00
Kostas Kyrimis
d37c2ec85a
fix: pytest warnings (#3497)
* fix truncating the timeout red dots on CI failures
* fix deprecated use of with timeout warnings
* remove @pytest.mark.dbg_only as it doesn't exist
---------

Signed-off-by: kostas <kostas@dragonflydb.io>
2024-08-13 16:05:15 +03:00
Stepan Bagritsevich
c756023332
feat: Expose replica_reconnect_count for Prometheus metrics (#3370) 2024-08-13 12:34:01 +02:00
Kostas Kyrimis
3f5d4f890d
fix: sanitizers false positives (#3495)
* disable flaky tests

---------

Signed-off-by: kostas <kostas@dragonflydb.io>
2024-08-13 09:53:31 +03:00
Stepan Bagritsevich
930a496152
chore(generic_family): Fix bad data format error in the RESTORE command (#3501)
* chore(generic_family): Fix bad data format error in the RESTORE command

Signed-off-by: Stepan Bagritsevich <bagr.stepan@gmail.com>

* chore(generic_family): Remove the error reply for OpStatus::WRONG_TYPE in the RESTORE command, since it is no longer in use

Signed-off-by: Stepan Bagritsevich <bagr.stepan@gmail.com>

---------

Signed-off-by: Stepan Bagritsevich <bagr.stepan@gmail.com>
2024-08-12 12:16:06 +00:00
Kostas Kyrimis
634b08dc53
fix: sanitizers post failure on google chat (#3496)
* fix sanitizers failure post on google chat
* only report failures on main branch

---------

Signed-off-by: kostas <kostas@dragonflydb.io>
2024-08-12 07:04:57 +00:00
Borys
f386b0b294
test: fix test_acl_deluser (#3488)
* test: fix test_acl_deluser
2024-08-12 09:34:51 +03:00
Roman Gershman
29a13893c2
feat: implement FT.TAGVALS (#3493)
* feat: implement FT.TAGVALS

Fixes #3491

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-08-11 22:53:25 +03:00
Roman Gershman
766b0ec86f
chore: add logs to debug tiered memory failures (#3499) 2024-08-11 22:52:58 +03:00
Kostas Kyrimis
e79f3fb206
fix: test_replicate_old_master missing serialization_max_chunk_size (#3498) 2024-08-11 18:41:56 +03:00
Kostas Kyrimis
db7bd0670a
fix: flake in teardown of test_unknown_dfly_env (#3487)
* set dfly instance to none on when it fails to start

---------

Signed-off-by: kostas <kostas@dragonflydb.io>
2024-08-11 14:52:44 +03:00
Kostas Kyrimis
b6d528cb5c
fix: HELLO AUTH with non default user (#3486)
* fix HELLO AUTH with non default user
* add test_auth_resp3_bug
* add decode_responses=True to acl tests and refactor
* fix test_default_user_bug

---------

Signed-off-by: kostas <kostas@dragonflydb.io>
2024-08-11 14:35:26 +03:00
Kostas Kyrimis
1c9e9c5922
fix: big value serialization corner cases (#3430)
There are some problematic flows. First we did not handle deletions, so all sorts of consistency issues could arise while calling DbSlice::Traverse() and DbSlice::Del(). Second, we did not handle FlushAll (same as before, Traverse() preempts and FlushAll() kicks in. Third we did not handle expirations.

---------

Signed-off-by: kostas <kostas@dragonflydb.io>
2024-08-11 14:17:32 +03:00
Vladislav
41ebb075a1
chore(facade): RedisReplyBuilder2 (extensions) (#3481)
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2024-08-09 23:16:33 +03:00
Vladislav
63a4ad6de1
chore(facade): MCReplyBuilder2 (#3480) 2024-08-09 20:16:08 +03:00
Vladislav
19fb7aa158
chore(facade): RedisReplyBuilder2 base (#3475) 2024-08-09 15:26:36 +03:00
romange
6d945c6b81 chore(helm-chart): update to v1.21.1 2024-08-09 11:38:30 +00:00
Borys
7ff56c5ab7
test: fix test_scripts (#3485) 2024-08-09 08:15:47 +00:00
Roman Gershman
b9cafaab4b
fix: division by zero bug (#3482) 2024-08-09 09:49:29 +03:00
Shahar Mike
ca34e05f26
chore: Download Dragonfly versions only when needed (#3479) 2024-08-09 08:18:00 +03:00
Roman Gershman
a8c6e4d314
chore: relax the version check in test_replicate_old_master (#3478)
For commits marked with a git tag, the previous check did not hold.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-08-08 19:14:33 +00:00
Borys
48a28c3ea3
refactor: set info_replication_valkey_compatible=true (#3467)
* refactor: set info_replication_valkey_compatible=true
* test: mark test_cluster_replication_migration as skipped because it's broken
2024-08-08 21:42:58 +03:00
Vladislav
5258bbacd1
chore(facade): Update SinkReplyBuilder2 (#3474) 2024-08-08 21:40:49 +03:00
Roman Gershman
fb7a6a724d
chore: make tiered_test more reliable (#3477) 2024-08-08 20:08:00 +03:00
Shahar Mike
b6b42c9f26
fix: Make replica's REPLCONF IP-ADDRESS optional (#3473)
**Background**

In v1.21.0 we introduced support for `--announce_ip` for replicas to
announce their public IP addresses.

Like Valkey, this uses `REPLCONF IP-ADDRESS` to announce their IP
address.

**The issue**

Older Dragonfly releases (<1.21) did not support this feature. The
master side simply returned an error for such `REPLCONF` attempts,
however the replica code failed the replication, resulting in
incompatible versions.

**The fix**

The fix is simple, just log an error if the master did not respect
`REPLCONF IP-ADDRESS`. We can make this non-optional in the future
again.

However, in addition, I added a regression test to make sure we are
backwards compatible with v1.19.2. We'll bump this up every once in a
while.
2024-08-08 17:22:30 +03:00