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

1102 commits

Author SHA1 Message Date
Andy Dunstall
302623c645
fix: aggregate xread and xrange replys (#1383) 2023-06-10 15:34:12 +03:00
Vladislav
e837b3d229
Fix reply builder access issue (#1378)
* fix: Fix invalid reply builder use

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-06-10 00:50:05 +03:00
Vladislav
e6b72f16a2
feat: search limit (#1367)
Implement LIMIT option for search

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-06-09 23:03:46 +03:00
Abhradeep Chakraborty
c72aa6f5f2
fix(xinfo): send integer info in correct type (#1379)
Signed-off-by: Abhradeep Chakraborty <abhradeep@dragonflydb.io>
2023-06-09 20:11:23 +03:00
Roy Jacobson
1011720a25
fix(server): Do more aggressive batching. (#1375)
This removes the "25" limit for batched messages.

Turns out the aggregation in #1287 was not aggressive enough, because
it's quite possible to reach the specified max capacity of  io vectors.
For example, each "QUEUED" is actually "+", "QUEUED", "\r\n" so we can
reach the limit with about 8 batched commands and then finish\
aggregating prematurely.

Closes #1285
2023-06-08 23:12:17 +03:00
Chaka
ff338bebe2
feat(cluster): Use thread-local cluster config (#1361)
To support this, I refactored some of the code:

* We no longer have `IsConfigured()` and `SetConfig()`, now
  configuration validation is done via instantiation
* As a result, we check if `tl_cluster_config` is `nullptr` or not to
  determine whether the cluster has been configured
* Reduce the size of the config by only storing 1 bit per slot (whether it's owned locally or not)
* Pushing new configuration is done via copy-c'tor

While at it, add a small test function to remove `sleep()`s and wait in a less fragile way.

Fixes #1357
2023-06-08 15:18:06 +03:00
adiholden
891155c927
bug(server): fix debug populate keys (#1370)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2023-06-08 15:16:28 +03:00
talbii
e646476359
CGroup v1 detection (#1329)
Add support for cgroup v1 limit checking

For future reference: testing. In order to test this feature (both for
v1 and v2). To do this, create a cgroup and move Dragonfly into it
before running.

One way to do this is using a script, like: cat; ./dragonfly
--logtostderr

Enabling v1 (by default, you should have v2): Edit `/etc/default/grub`,
and look for `GRUB_CMDLINE_LINUX_DEFAULT`. Append to it
`systemd.unified_cgroup_hierarchy=0`, update GRUB using `sudo
updat-grub`, and reboot.

In v1, create a group `mycgroup` and add PID 1234 to it:

```
sudo mkdir -p /sys/fs/cgroup/memory/mycgroup
sudo bash -c "echo 8589934592 >
/sys/fs/cgroup/memory/mycgroup/memory.limit_in_bytes" # set mem limit to
8G
sudo bash -c "echo 1234 > /sys/fs/cgroup/memory/mycgroup/tasks" # assign
PID 1234 to this cgroup
```

In v2:

```
sudo mkdir -p /sys/fs/cgroup/mycgroup
sudo bash -c "echo 8589934592 > /sys/fs/cgroup/mycgroup/memory.max" #
set mem limit to 8G
sudo bash -c "echo 1234 > /sys/fs/cgroup/mycgroup/cgroup.procs" # assign
PID 1234 to this cgroup
```

then test by (using script example from before):

```
$ ./run.sh # contains: cat; ./dragonfly --logtostderr
[1] 1234
[1]  + 1234 suspended (tty input)  ./run.sh
fg
^D
<look for Dragonfly memory limit>
```

Signed-off-by: talbii <ido@dragonflydb.io>
2023-06-07 16:38:04 +03:00
Tarun Pothulapati
a600ba8f0b
feat(ci): Test the built docker image (#1240)
This commit adds a new testing phase that runs the container
and waits for a PONG response. This step fails if the expected
response is not received.
2023-06-07 15:27:12 +03:00
Chaka
d63f3dd711
fix(replication): Destroy rdb saver on the same thread it was created (#1366) 2023-06-07 14:26:57 +03:00
Tarun Pothulapati
e62b5a6c13
fix(alpine): Add libxml2 into the build pipeline (#1363)
Fix lack of libxml2
2023-06-07 09:39:57 +03:00
Andy Dunstall
4bc3692f56
fix: fix linsert pivot (#1365)
Signed-off-by: Andy Dunstall <andydunstall@hotmail.co.uk>
2023-06-07 09:18:06 +03:00
Vladislav
5f667a7a58
chore: Add blpop crash diagnostics (#1358)
This commit adds tracing logs for list commands to debug BLPOP crashes. This commit should be reverted once the issue is resolved

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-06-06 21:45:57 +03:00
Chaka
7513e75fd0
chore(server): Move tests to their respective subdir (#1360) 2023-06-06 21:26:04 +03:00
Chaka
de21afc6e6
test(cluster): Test that cluster works with a standard cluster client. (#1336)
In this case, `redis.RedisCluster`.

To be double sure I also looked at the actual packets and saw that the
client asks for `CLUSTER SLOTS`, and then after the redistribution of
slots, following a few `MOVED` replied, it asks for the new slots again.
2023-06-06 16:03:09 +03:00
Chaka
5234f77727
fix(replication): Restart replication upon receiving FLUSHALL during full sync (#1347)
Fixes #1231
2023-06-06 12:26:47 +03:00
Chaka
5471e296d8
fix(cluster): Fix failing test due to automatic merge (#1359) 2023-06-06 11:08:15 +03:00
Chaka
82c8906eb7
feat(cluster): Add total_reads and total_writes to GETSLOTSINFO. (#1355)
While at it, modify response such that it returns numbers instead of strings for numerical values.
2023-06-05 21:46:02 +03:00
Kostas Kyrimis
42116fa012
feat(zset family): Implement ZDiff command issue #1311 (#1333)
Signed-off-by: Kostas <kostaskyrim@gmail.com>
2023-06-05 18:26:01 +03:00
Vladislav
bf44b56667
fix: fix search_test after incorrect rebase (#1356) 2023-06-05 15:38:40 +03:00
adiholden
7a21d3257a
feat(server): debug poplulate add slots option (#1348)
* feat(server): debug poplulate add slots option

Signed-off-by: adi_holden <adi@dragonflydb.io>
2023-06-05 13:59:04 +03:00
Chaka
fc5ce6da9e
fix(server): Return null when HRANDKEY doesn't find a key. (#1354)
Fixes #1352
2023-06-05 13:49:39 +03:00
Chaka
7dcdeee1bb
fix(cluster): Fix crash when getting DFLYCLUSTER GETSLOTINFO with no other args. (#1351) 2023-06-05 06:42:00 +03:00
Vladislav
9ab70e4f15
feat: Support tags in search (#1341)
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-06-05 00:26:21 +03:00
Chaka
ab3a67ced3
chore: Double regression tests timeout (10m->20m) (#1350) 2023-06-04 22:19:07 +03:00
Chaka
124437bb77
feat(cluster): Allow actions on non-owned keys on replication port. (#1334)
This allows masters to send data of non-owned keys to their replicas,
which is useful when:

1. Config is temporarily different between master and replica
2. Preparing for taking ownership over currently not-owned slots (in the upcoming migration feature)

Fixed #1319
2023-06-04 16:41:21 +03:00
Roy Jacobson
cd5c25b0ba
Chore: Clean up interface of Replica::ReadRespReply (#1330)
* Chore: Clean up interface of Replica::ReadRespReply

* Combine SendCommand and ReadResp into SendCommandAndReadResponse

* Store sent command for better log message

* rename the macro
2023-06-04 13:42:15 +02:00
Vladislav
981e2b2d44
fix: Skip optional WEIGHT param in ft.create (#1340)
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-06-03 20:07:26 +02:00
Vladislav
ff1ffa01b8
Use search indices (#1294)
Use search indices in search algorithm and external interface

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-06-03 11:51:14 +03:00
Andy Dunstall
cde6adb34d
feat(streams): Add support for XTRIM (#1337)
Signed-off-by: Andy Dunstall <andydunstall@hotmail.co.uk>
2023-06-02 23:24:35 +03:00
Andy Dunstall
753f7fcdbc
fix: remove redundant list assertions (#1338) 2023-06-02 22:00:21 +03:00
Roy Jacobson
75f9cdaaa0
fix: Clarify logging for snapshots loading. (#1312)
* fix: Clarify logging for snapshots loading.

Close #1309.

* Use io::Result
2023-06-01 22:14:03 +02:00
adiholden
dcfd9262a7 fix(regression test): skip test_disconnect_replica (#1286)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2023-06-01 15:13:18 +03:00
Chaka
67ca8c8615 test(cluster): Add basic cluster mode pytests. (#1328) 2023-06-01 15:13:18 +03:00
Vladislav
213da4918a feat: simple search indices (unused) (#1315)
Implement simple indices to offload pr

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-06-01 15:13:18 +03:00
Vladislav
6378f9239a chore: split search tests + pr preparation (#1316)
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-06-01 15:13:18 +03:00
Roy Jacobson
e82ab91425 feat: Report replication lag in INFO REPLICATION (#1246)
* feat: Report replication lag in INFO REPLICATION

* nits

* fix after rebase
2023-06-01 15:13:18 +03:00
Chaka
fdacd2eba9 test(cluster): Test we don't allow invalid slot ids. (#1323)
Fixes #1322
2023-06-01 15:13:18 +03:00
adiholden
0d748b3cca fix(regression test): fix test_cancel_replication_immediately (#1326)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2023-06-01 15:13:18 +03:00
Chaka
59842ae895 fix(cluster): Eliminate race in CLUSTER commands. (#1321) 2023-06-01 15:13:18 +03:00
Roman Gershman
e2cc44162c fix: fix crash when inserting to listpack an empty value. (#1324)
fix: fix crash when inserting to listpack empty value.

We can not pass null pointers to listpack.
Fixes #1305 and probably fixes #1290

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-06-01 15:13:18 +03:00
Vladislav
737ca2e918 fix: script flags naming + add stick option (#1295)
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-06-01 15:13:14 +03:00
Chaka
e3086f56a1
refactor(cluster): Use GetEmulatedShardInfo() for CLUSTER INFO. (#1317)
This makes the code more consistent with the other `CLUSTER` commands,
but more importantly it also unifies the place for reading the replica
info, which is important for refactoring it (next PR) to make it atomic
remove existing race.
2023-05-30 12:33:09 +03:00
Roy Jacobson
29c258df9b
feat: Support ACKs from replica to master (#1243)
* feat: Support ACKs from replica to master

* Rework after CR

* Split the acks into a different fiber and remove the PING loop

* const convention

* move around the order.

* revert sleep removal

* Exit ack fiber on cancellation

* Don't send ACKs if server doesn't support it
2023-05-29 16:41:57 +03:00
Roy Jacobson
76801fa8c3
fix: werror in ci and warning that slipped by (#1297)
* fix: werror in ci and warning that slipped by

* Ignore bison warnings

* Fix C++17 compat warning
2023-05-29 16:36:57 +03:00
Roy Jacobson
73b1dd34e6
feat(server): Add versioning to dragonfly replication (#1307)
* feat(server): Add versioning to dragonfly replication

* Split logic into helper functions

* fix comments
2023-05-29 16:17:27 +03:00
Chaka
5208067507
Add latest dependencies. (#1310)
#1304
2023-05-29 13:55:48 +03:00
Roman Gershman
34c8939a3a
fix: Batch array length before sending its contents (#1287)
fix: Coalesce array contents to optimize response traffic.

Also pull the latest helio.

Fixes #1285

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-05-29 13:31:12 +03:00
Chaka
6e21686406
Add bison to build process, and libxml2 to runtime (#1308) 2023-05-29 13:19:23 +03:00
adiholden
3df467583f
feat(cluster): first config set drop all entries not owned by node (#1301)
* feat(cluster): first config set drop all entries not owned by node

Signed-off-by: adi_holden <adi@dragonflydb.io>
2023-05-29 11:25:21 +03:00