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

1138 commits

Author SHA1 Message Date
Kostas Kyrimis
99f3284910
feat(server): Add missing fields to INFO PERSISTENCE command (#1408) (#1438)
* Add loading field
* Add rdb_changes_since_last_save field
2023-06-21 23:35:36 +03:00
adiholden
5e479ed967
feat(server): add unixsocketperm support (#1450)
* fetch helio Add support to set uds permissions

Signed-off-by: adi_holden <adi@dragonflydb.io>
2023-06-21 13:58:39 +03:00
WaySLOG
4a2849b7d1
feat(server): add flag to set FiberQueueThreadPool thread size (#1452)
feat: add epoll_file_threads flag

Co-authored-by: Xuesong Zhao <xuesong.zhao@shopee.com>
2023-06-21 12:56:48 +03:00
Vladislav
6f78ae5073
fix: call NotifyPending only from tx queue invocations (#1439)
* fix: call NotifyPending only from tx queue invocations

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-06-21 10:26:22 +03:00
Vladislav
f25098bb98
fix: add numpy to regtests (neede for knn) (#1454)
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-06-21 09:18:42 +03:00
Vladislav
a9d9b4935c
feat: Implement KNN interface (#1412)
Add external KNN interface

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-06-20 14:10:08 +03:00
adiholden
3073ebd798
feat(server): set allowed key size 256MB (#1435)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2023-06-20 10:18:58 +03:00
Chaka
6ec9513c60
test(cluster): Extend cluster_mgr.py (#1426)
Now this management script can:
* Create a cluster (before this PR)
* Print an existing cluster configuration
* Shutdown an existing cluster
* Move slots between cluster nodes

To support connecting to a cluster (for all new functions), I had to
change the way admin ports are defined. Instead of having the user
(optionally) specify the first port, they are hard-coded to be the
regular port + 10,000. This is done because we can't detect the admin
port based for an existing cluster (like via `CLUSTER SHARDS`).
2023-06-20 10:13:57 +03:00
Roman Gershman
fdc2b460e2
chore: improve connection I/O errors reporting (#1436) 2023-06-20 00:14:03 +03:00
Roman Gershman
3d651aecf5
fix: out of bounds typo (#1434)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-06-19 13:12:48 +03:00
Chaka
14e9ba4849
fix(cluster): Fix race when setting cluster config (#1428)
* fix(cluster): Fix race when setting cluster config

* Return `shared_ptr` from Create factory function.
2023-06-19 11:24:26 +03:00
Chaka
ba641677ac
feat(cluster): Implement CLUSTER KEYSLOT command (#1413) 2023-06-19 06:54:30 +03:00
romange
7f3dc1dd51 chore(helm-chart): update to v1.4.0 2023-06-19 03:53:33 +00:00
Tarun Pothulapati
1884ea3ef6
fix(docker-release): Run Docker test only if image is built (#1430)
Currently, During docker release we don't actually build the
alpine release but the new docker run test ends up trying to
run it and fails. This adds the same toggle that we use for
build to prevent the test step.
2023-06-19 06:46:29 +03:00
Tarun Pothulapati
3aa7c0d7a8
feat(CI): Update weekly build image name to be dragonfly-weekly (#1384)
This commit updates the weekly docker build to use `dragonfly-weekly`
image tag so that we get better separation. We also now push these
images with the github sha commit tags. We also update `latest` as
these get pushed.
2023-06-18 22:59:45 +03:00
iko1
19d7622280
feat: add s390x architecture support (#1214)
* fix(lua): use native architecture when compiling lua for s390x.

Signed-off-by: iko1 <me@remotecpp.dev>

* feat(server): implement CompareFP for s390x architecture.

Signed-off-by: iko1 <me@remotecpp.dev>

* feat: implement validate_ascii_fast function variant for s390x arch.

Signed-off-by: iko1 <me@remotecpp.dev>

* fix: add comments before s390x vector operations

Signed-off-by: iko1 <me@remotecpp.dev>

* fix validate_ascii_fast function logic after CR comment

Signed-off-by: iko1 <me@remotecpp.dev>

* Revert "fix(lua): use native architecture when compiling lua for s390x."

This reverts commit 6cc5d8a8ed.

* fix(lua): use native architecture when compiling lua for s390x.

Signed-off-by: iko1 <me@remotecpp.dev>

* refactor validate_ascii_fast function after CR comment

Signed-off-by: iko1 <me@remotecpp.dev>

* include vecintrin.h from sse_port.h rather the misleading filename

Signed-off-by: iko1 <me@remotecpp.dev>

---------

Signed-off-by: iko1 <me@remotecpp.dev>
2023-06-18 21:33:22 +03:00
Vladislav
6d4d740d6e
fix: Don't remove non-concluding tx from queue on ooo runs (#1427)
* fix: Don't remove non-concluding tx from queue on ooo runs

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-06-18 21:14:28 +03:00
Andy Dunstall
7ec5bd912c
fix: drain the connection socket on a protocol error (#1422)
Signed-off-by: Andy Dunstall <andydunstall@hotmail.co.uk>
2023-06-18 08:43:56 +03:00
Roman Gershman
69e6ad799a
fix: remove bad check-fail in the transaction code (#1420)
fix: remove bad check-fail in the transaction code.

Fixes #1421.

The failure reproduces for dragongly running with a single thread where all the
arguments grouped within the same ShardData

Also, we improve verbosity levels inside reply_builder.cc.
For that we extend SinkReplyBuilder to support protocol errors reporting
and we remove ad-hoc code for this from dragonfly_connection.
Required to track errors easily with `--vmodule=reply_builder=1`

Finally, a pytest is added to cover the issue.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-06-18 07:03:08 +03:00
kbelokon
956b39c553
bug(helm) Fix tolerations and affinity mishandling in Helm template (#1373)
* bug(helm) Fix tolerations and affinity mishandling in Helm template

Signed-off-by: Kirill Belokon <belokon@mindbox.cloud>

* add golden test case

* increase resource requests

* add node label to test

---------

Signed-off-by: Kirill Belokon <belokon@mindbox.cloud>
Co-authored-by: Tarun Pothulapati <tarun@dragonflydb.io>
2023-06-15 20:34:45 +05:30
Chaka
5659ff6a2d
test(cluster): Add a Cluster Management script (#1390)
This script allows easily setting up a local cluster.

Example invocation:

```
killall dragonfly; ./cluster_mgr.py --num_masters=3 --with_replicas
Setting up a Dragonfly cluster:
- Master nodes: 3
- Ports: 7001...7003
- Admin ports: 8001...8003
- Replicas? True

Starting nodes...
- Log file for node 7001: /tmp/dfly.cluster.node.7001.log
- Log file for node 7002: /tmp/dfly.cluster.node.7002.log
- Log file for node 7003: /tmp/dfly.cluster.node.7003.log
- Log file for node 7004: /tmp/dfly.cluster.node.7004.log
- Log file for node 7005: /tmp/dfly.cluster.node.7005.log
- Log file for node 7006: /tmp/dfly.cluster.node.7006.log

Configuring replication...
- Response for 7004: OK
- Response for 7005: OK
- Response for 7006: OK

Getting IDs...
- ID for 7001: acefdc2da5d397cfcb99239b3c29cbe6ff10d75a
- ID for 7002: a8cc67dfa42e91a94bd7c0903df35d60a39508bd
- ID for 7003: 1ad91af7bd96c89a8da877164b2ebb4cf458cab8
- ID for 7004: d209c3603343e25a18c78bd68304b6d883973bd3
- ID for 7005: bd2b25e95aaf7fdd2b955e50a00093a8272954bf
- ID for 7006: beb5cb07b75c33e3ff938d07725f2688d9bc91e0

Pushing config...
- Push into 7001: OK
- Push into 7002: OK
- Push into 7003: OK
- Push into 7004: OK
- Push into 7005: OK
- Push into 7006: OK
```
2023-06-15 13:02:58 +03:00
Roy Jacobson
f8d4b6f7c4
Put more keys, make it non-failure if the test fails because of bad params (#1411) 2023-06-14 22:00:12 +03:00
Roy Jacobson
46bf0bb42c
fix(test): Fix a race condition in test_flushall_in_full_sync (#1409) 2023-06-14 13:00:46 +02:00
Chaka
d86227db5b
feat(cluster): Use shared_ptr for thread-local cluster config (#1395)
Use `shared_ptr` for thread-local cluster config
2023-06-13 15:28:21 +03:00
Vladislav
8ee5a8f5e3
feat: Basic KNN (core only) (#1397)
Basic KNN
---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
Signed-off-by: Vladislav <vladislav.oleshko@gmail.com>
Co-authored-by: Roy Jacobson <roi.jacobson1@gmail.com>
2023-06-13 11:04:49 +03:00
Chaka
0dac3da4f4
fix(lua): Fix build on arm (#1404)
* fix(lua): Fix build on arm

* space instead of comma

lovely makefile syntax
2023-06-13 11:03:11 +03:00
Andy Dunstall
d6e97fcf6d
fix: remove NotifyPending from UnwatchShardCb (#1402)
NotifyPending was being called when a blocked transaction expires, which
meant other blocked transactions could be woken up even though another
transaction could be in progress. NotifyPending has no affect on the
blocked transaction.

Signed-off-by: Andy Dunstall <andydunstall@hotmail.co.uk>
2023-06-13 08:59:34 +03:00
Roy Jacobson
3f27bd3eba
Fix crash on shutdown from #1388 (#1399)
My recent PR accesses Connection->cc_ on shutdown, but sometimes
it's a null pointer.
Make it optional.
2023-06-12 16:28:03 +02:00
Abhradeep Chakraborty
e6a8ec8598
feat(xgroup): add support for xgroup createconsumer (#1382) 2023-06-12 14:37:33 +03:00
Roy Jacobson
23f1a77d4c
Doc: Warn people about benchmarking/deploying without LTO (#1396) 2023-06-12 11:56:07 +02:00
Vladislav
f97dbad6f9
feat: track update and delete for search (#1325)
Automatically update search indices

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-06-12 11:43:30 +03:00
Vladislav
2a5fd79856
fix: Allow readonly commands in replica script (#1392)
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-06-12 06:14:17 +03:00
Roman Gershman
cf1ac87156
chore: fix some of FreeBsd compile issues. (#1374)
1. Use experimental/memory_resource because clang on freebsd does not support yet std::memory_resource
2. Pull latest helio with all the compatibility fixes.
3. Replace linux only SOL_TCP constant with IPPROTO_TCP (same value).
4. Fix build files to work on FreeBsd system.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-06-11 23:22:56 +03:00
Roy Jacobson
9c8b3296b2
fix: A more gracefull shutdown (#1388)
* Add a test for gracefull shutdown

* Add a small wait loop for dispatching connections
2023-06-11 23:22:27 +03:00
Vladislav
16454c1e17
feat: Basic search optimizations (#1385)
Basic search optimizations

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-06-11 13:03:54 +03:00
Andy Dunstall
d2e0c481f2
fix: aggregate eval replys (#1386)
* fix: aggregate eval/evalsha replys

* fix: don't allow nested aggregates

* fix: reduce kMaxBatchSize to 1024
2023-06-10 21:03:16 +03:00
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