12363 Commits

Author SHA1 Message Date
Ping Xie
f927565d28
Consolidate various BLOCKED_WAIT* states (#562)
There are currently three block types: BLOCKED_WAIT, BLOCKED_WAITAOF,
and BLOCKED_WAIT_PREREPL, used to block clients executing `WAIT`,
`WAITAOF`, and `CLUSTER SETSLOT`, respectively. They share the same
workflow: the client is blocked until replication to the expected number
of replicas completes. However, they provide different responses
depending on the commands involved. Using distinct block types leads to
code duplication and reduced readability. This PR consolidates the three
types into a single WAIT type, differentiating them using the pending
command to ensure the appropriate response is returned.


Fix #427

---------

Signed-off-by: Ping Xie <pingxie@google.com>
2024-05-30 23:45:47 -07:00
nitaicaro
6fb90adf4b
Fix crash where command duration is not reset when client is blocked … (#526)
In #11012, we changed the way command durations were computed to handle
the same command being executed multiple times. In #11970, we added an
assert if the duration is not properly reset, potentially indicating
that a call to report statistics was missed.

I found an edge case where this happens - easily reproduced by blocking
a client on `XGROUPREAD` and migrating the stream's slot. This causes
the engine to process the `XGROUPREAD` command twice:

1. First time, we are blocked on the stream, so we wait for unblock to
come back to it a second time. In most cases, when we come back to
process the command second time after unblock, we process the command
normally, which includes recording the duration and then resetting it.
2. After unblocking we come back to process the command, and this is
where we hit the edge case - at this point, we had already migrated the
slot to another node, so we return a `MOVED` response. But when we do
that, we don’t reset the duration field.

Fix: also reset the duration when returning a `MOVED` response. I think
this is right, because the client should redirect the command to the
right node, which in turn will calculate the execution duration.

Also wrote a test which reproduces this, it fails without the fix and
passes with it.

---------

Signed-off-by: Nitai Caro <caronita@amazon.com>
Co-authored-by: Nitai Caro <caronita@amazon.com>
2024-05-30 12:55:00 -07:00
Wen Hui
0d2ba9b94d
Update redis legacy word when run TLS cert file (#572)
Reference:
https://github.com/valkey-io/valkey-doc/blob/main/topics/encryption.md

Before we runtest --tls, we need first run utils/gen-test-certs.sh

I found there are some redis legacy word there, update them.

Signed-off-by: hwware <wen.hui.ware@gmail.com>
2024-05-30 13:09:29 -04:00
Binbin
6bab2d7968
Make sure clear the CLUSTER SLOTS cache on time when updating hostname (#564)
In #53, we will cache the CLUSTER SLOTS response to improve the
throughput and reduct the latency.

In the code snippet below, the second cluster slots will use the
old hostname:
```
config set cluster-preferred-endpoint-type hostname
config set cluster-announce-hostname old-hostname.com
multi
cluster slots
config set cluster-announce-hostname new-hostname.com
cluster slots
exec
```

When updating the hostname, in updateAnnouncedHostname, we will set
CLUSTER_TODO_SAVE_CONFIG and we will do a clearCachedClusterSlotsResponse
in clusterSaveConfigOrDie, so harmless in most cases.

Move the clearCachedClusterSlotsResponse call to clusterDoBeforeSleep
instead of scheduling it to be called in clusterSaveConfigOrDie.

Signed-off-by: Binbin <binloveplay1314@qq.com>
2024-05-30 10:44:12 +08:00
LiiNen
168da8b52e
Fix bitops.c clang-format properly (#570)
ref:
- https://github.com/valkey-io/valkey/pull/118 (my pervious change)
- https://github.com/valkey-io/valkey/pull/461 (issuing that clang
format checker fails due to my change)

There was an issue that clang-format cheker failed.
I don't know why I missed it and why it didn't catch.

just running `clang-format -i bitops.c` was all.

Signed-off-by: LiiNen <kjeonghoon065@gmail.com>
2024-05-28 21:49:50 -07:00
LiiNen
96dcd1183a
Change BITCOUNT 'end' as optional like BITPOS (#118)
_This change is the thing I suggested to redis when it was BSD, and is
not just migration - this is of course more advanced_

### Issue
There is weird difference in syntax between BITPOS and BITCOUNT:
```
BITPOS key bit [start [end [BYTE | BIT]]]
BITCOUNT key [start end [BYTE | BIT]]
```

I think this might cause confusion in terms of usability.
It was not just a syntax typo error, and really works differently.
The results below are with unstable build:
```
> get TEST:ABCD
"ABCD"
> BITPOS TEST:ABCD 1 0 -1
(integer) 1
> BITCOUNT TEST:ABCD 0 -1
(integer) 9
> BITPOS TEST:ABCD 1 0
(integer) 1
> BITCOUNT TEST:ABCD 0
(error) ERR syntax error
```

### What did I fix

simply changes logic, to accept BITCOUNT also without 'end' - 'end'
become optional, like BITPOS
```
> GET TEST:ABCD
"ABCD"
> BITPOS TEST:ABCD 1 0 -1
(integer) 1
> BITCOUNT TEST:ABCD 0 -1
(integer) 9
> BITPOS TEST:ABCD 1 0
(integer) 1
> BITCOUNT TEST:ABCD 0
(integer) 9
```

Of course, I also fixed syntax hint:
```
# ASIS 
> BITCOUNT key [start end [BYTE|BIT]]
# TOBE
> BITCOUNT key [start [end [BYTE|BIT]]]
```

![image](https://github.com/valkey-io/valkey/assets/38001238/8485f58e-6785-4106-9f3f-45e62f90d24b)


### Moreover ...
I hadn't noticed that there was very small dead code in these command
logic, when I wrote PR to redis.
I found it now, when write code again, so I wrote it in valkey.
``` c
/* asis unstable */

/* bitcountCommand() */
if (!strcasecmp(c->argv[4]->ptr,"bit")) isbit = 1;
// ...
if (c->argc < 4) {
    if (isbit) end = (totlen<<3) + 7;
    else end = totlen-1;
}

/* bitposCommand() */
if (!strcasecmp(c->argv[5]->ptr,"bit")) isbit = 1;
// ...
if (c->argc < 5) {
    if (isbit) end = (totlen<<3) + 7;
    else end = totlen-1;
}
```
Bit variable (actually int) "isbit" is only being set as 1, when 'BIT'
is declared.
But we were checking whether 'isbit' is true or false in this 'if'
phrase, even if isbit could never be 1, because argc is always less than
4 (or 5 in bitpos).



I think this minor fixes will make valkey command operation more
consistent.
Of course, this PR contains just changing args from "required" to
"optional", so it will never hurt previous users.

Thanks,

---------

Signed-off-by: LiiNen <kjeonghoon065@gmail.com>
Co-authored-by: Madelyn Olson <34459052+madolson@users.noreply.github.com>
2024-05-28 15:01:28 -04:00
uriyage
fd58b73f0a
Introduce shared query buffer for client reads (#258)
This PR optimizes client query buffer handling in Valkey by introducing
a shared query buffer that is used by default for client reads. This
reduces memory usage by ~20KB per client by avoiding allocations for
most clients using short (<16KB) complete commands. For larger or
partial commands, the client still gets its own private buffer.

The primary changes are:

* Adding a shared query buffer `shared_qb` that clients use by default
* Modifying client querybuf initialization and reset logic
* Copying any partial query from shared to private buffer before command
execution
* Freeing idle client query buffers when empty to allow reuse of shared
buffer
* Master client query buffers are kept private as their contents need to
be preserved for replication stream

In addition to the memory savings, this change shows a 3% improvement in
latency and throughput when running with 1000 active clients.

The memory reduction may also help reduce the need to evict clients when
reaching max memory limit, as the query buffer is the main memory
consumer per client.

---------

Signed-off-by: Uri Yagelnik <uriy@amazon.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
2024-05-28 11:09:37 -07:00
Shivshankar
7ba7e4d053
Update zfree on data in test_crc64combine before return. (#548)
Signed-off-by: Shivshankar-Reddy <shiva.sheri.github@gmail.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
2024-05-28 10:36:54 -07:00
Ping Xie
84157890fd
Set up clang-format github action (#538)
Setup clang-format GitHub action to ensure coding style consistency
---------

Signed-off-by: Ping Xie <pingxie@google.com>
2024-05-28 09:27:51 -07:00
Viktor Söderqvist
4e44f5aae9
Fix races in test for tot-net-in, tot-net-out, tot-cmds (#559)
The races are between the '$rd' client and the 'r' client in the test
case.

Test case "client input output and command process statistics" in
unit/introspection.

---------

Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
2024-05-28 17:13:16 +02:00
Viktor Söderqvist
045d475a94
Implement REPLCONF VERSION (#554)
The replica sends its version when initiating replication, in
pipeline with other REPLCONF commands.

The primary stores it in the client struct. Other fields are made
smaller to avoid making the client struct consume more memory.

Fixes #414.

---------

Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
2024-05-27 23:03:34 +02:00
Ping Xie
e4ead9442b
Make CLUSTER SETSLOT with TIMEOUT 0 block indefinitely (#556)
This aligns the behaviour with established Valkey commands with a
TIMEOUT argument, such as BLPOP.

Fix #422

Signed-off-by: Ping Xie <pingxie@google.com>
2024-05-27 07:11:24 -07:00
Samuel Adetunji
5d0f4bc9f0
Require C11 atomics (#490)
- Replaces custom atomics logic with C11 default atomics logic.
- Drops  "atomicvar_api" field from server info

Closes #485

---------

Signed-off-by: adetunjii <adetunjithomas1@outlook.com>
Signed-off-by: Samuel Adetunji <adetunjithomas1@outlook.com>
Co-authored-by: teej4y <samuel.adetunji@prunny.com>
2024-05-26 18:41:11 +02:00
Jonathan Wright
1c55f3ca5a
Replace centos 7 with alternative versions (#543)
replace centos 7 with almalinux 8, add almalinux 9, centos stream 9, fedora stable, rawhide

Fixes #527

---------

Signed-off-by: Jonathan Wright <jonathan@almalinux.org>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
2024-05-24 16:08:51 -07:00
Madelyn Olson
fbbabe3543
Revert format updates on config.c file for config block (#552)
Although I think this improves the readability of individual configs,
the fact there are now 1k more lines of configs makes this overall much
harder to parse. So reverting it back to the way it was before.

`,\n               [ ]+` replace with `, `.

---------

Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
2024-05-24 15:53:44 -07:00
Viktor Söderqvist
d72ba06dd0
Make cluster replicas return ASK and TRYAGAIN (#495)
After READONLY, make a cluster replica behave as its primary regarding
returning ASK redirects and TRYAGAIN.

Without this patch, a client reading from a replica cannot tell if a key
doesn't exist or if it has already been migrated to another shard as
part of an ongoing slot migration. Therefore, without an ASK redirect in
this situation, offloading reads to cluster replicas wasn't reliable.

Note: The target of a redirect is always a primary. If a client wants to
continue reading from a replica after following a redirect, it needs to
figure out the replicas of that new primary using CLUSTER SHARDS or
similar.

This is related to #21 and has been made possible by the introduction of
Replication of Slot Migration States in #445.

----

Release notes:

During cluster slot migration, replicas are able to return -ASK
redirects and -TRYAGAIN.

---------

Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
2024-05-24 17:58:03 +02:00
Harkrishn Patro
3dd2f5a586
Undeprecate cluster slots command (#536)
Undeprecate cluster slots command. This command is widely used by
clients to form the cluster topology and with the recent change to
improve performance of `CLUSTER SLOTS` command via #53 as well as us
looking to further improve the usability via #517, it makes sense to
undeprecate this command.

---------

Signed-off-by: Harkrishn Patro <harkrisp@amazon.com>
2024-05-24 07:14:23 +02:00
Ping Xie
a0aebb6b67
Reinitialize pointer 'p' after ziplistDeleteRange to fix head deletion bug (#537)
Fix
https://github.com/valkey-io/valkey/actions/runs/9200055659/job/25305949916

Signed-off-by: Ping Xie <pingxie@google.com>
2024-05-22 23:37:18 -07:00
Ping Xie
c41dd77a3e
Add clang-format configs (#323)
I have validated that these settings closely match the existing coding
style with one major exception on `BreakBeforeBraces`, which will be
`Attach` going forward. The mixed `BreakBeforeBraces` styles in the
current codebase are hard to imitate and also very odd IMHO - see below

```
if (a == 1) { /*Attach */
}
```

```
if (a == 1 ||
    b == 2)
{ /* Why? */
}
```

Please do NOT merge just yet. Will add the github action next once the
style is reviewed/approved.

---------

Signed-off-by: Ping Xie <pingxie@google.com>
2024-05-22 23:24:12 -07:00
Roshan Khatri
c4782066e7
Cache CLUSTER SLOTS response for improving throughput and reduced latency. (#53)
This commit adds a logic to cache `CLUSTER SLOTS` response for reduced
latency and also updates the cache when a change in the cluster is
detected.

Historically, `CLUSTER SLOTS` command was deprecated, however all the
server clients have been using `CLUSTER SLOTS` and have not migrated to
`CLUSTER SHARDS`. In future this logic can be added to any other
commands to improve the performance of the engine.

---------

Signed-off-by: Roshan Khatri <rvkhatri@amazon.com>
2024-05-22 14:21:41 -07:00
Mason Hall
72538622ff
Migrate ziplist.c unit tests to new framework (#486)
Issue #428.

Moved the SERVER_TEST block from ziplist.c into unit tests in
test_ziplist.c. I left the benchmark related tasks alone in their own
test, as I am not sure what to do with them.

Some of the assertions are a little vague/useless, but I will try to
refine them.

---------

Signed-off-by: Mason Hall <hallmason17@gmail.com>
2024-05-21 17:54:09 -07:00
Siddhartha Sankar Mondal
005a018db6
Deprecate MacOS 11 build target (#524)
Deprecate MacOS 11 build target. End of life June 2024.  Fixes #523

---------

Signed-off-by: Siddhartha Mondal <siddharthmondal@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Roshan Khatri <117414976+roshkhatri@users.noreply.github.com>
2024-05-21 12:21:28 -07:00
Madelyn Olson
acb74f8da1
Delete dead code "zfree_usable" (#518)
Implemented in
3945a32177 (diff-a154d1fa454a9868e2c455acdae971e3605151516f9a8efac7f2c9b2845d914d),
this function is never called and never used. I was trying to understand
whether we could use this for another PR, but couldn't really find a
point for it because it didn't do exactly what I expected.

Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
2024-05-20 14:52:23 -07:00
Lipeng Zhu
122cba5103
Quick fix of failure when use libc allocator in daily CI. (#521)
Make `sdsResize` logic align with `_sdsnewlen`, fix of
https://github.com/valkey-io/valkey/pull/476.
Fix: 

https://github.com/valkey-io/valkey/actions/runs/9143545732/job/25140329542#step:6:1505

https://github.com/valkey-io/valkey/actions/runs/9135654696/job/25123330670#step:6:1501

Signed-off-by: Lipeng Zhu <lipeng.zhu@intel.com>
2024-05-20 14:52:12 -07:00
Binbin
e7e5a104ec
Revert mmap_rnd bits back to default value in CI (#520)
In 3f725b8, we introduced a change back in march to reduce the
entropy of ASLR, because ASAN didn't support it. Now the
vm.mmap_rnd_bits
was reverted in actions/runner-images#9491 so can remove this changes.

Closes #519.

Signed-off-by: Binbin <binloveplay1314@qq.com>
2024-05-20 12:23:25 -07:00
Madelyn Olson
d52c8f30e0
Include stddef in zmalloc.h (#516)
zmalloc.h uses size_t, which requires stddef. It seems like all the
previous code paths were properly including it except for ASAN, which
uses libc malloc and skips the special mac only malloc inclusions.

Example failure:
https://github.com/valkey-io/valkey/actions/runs/9143545732/job/25140329029

See
https://github.com/valkey-io/valkey/actions/runs/9149533754/job/25153263875.

Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
2024-05-19 11:33:33 -07:00
artikell
dcc9fd4fe8
Resolve numtests counter error (#514)
When supporting test, a type error was found

Signed-off-by: artikell <739609084@qq.com>
2024-05-19 10:48:28 -07:00
Viktor Söderqvist
efa8ba519b
Finish postponed SCAN changes (#501)
Commit 07ed0eafa98a66 introduced some SCAN improvements, but some
changes were postponed to a later version (8.0), which this PR finishes:

1. Prepare to move the TYPE filtering to the scan callback as well. this
was put on hold since it has side effects that can be considered a
breaking change, which is that we will not attempt to do lazy expire
(delete) a key that was filtered by not matching the TYPE (changing it
would mean TYPE filter starts behaving the same as MATCH filter already
does in that respect).
2. when the specified key TYPE filter is an unknown type, server will
reply a error immediately instead of doing a full scan that comes back
empty handed.

Fixes #235

Release notes:

> SCAN: Expired keys that don't match the TYPE argument for the SCAN are
no longer deleted by SCAN

Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
2024-05-17 13:35:31 +02:00
Madelyn Olson
9b6232b501
Automatically notify the slack channel when tests fail (#509)
Adds a job that will automatically run at the end of the daily, which
will collect all the failed tests and send them to the developer slack.
It will include a link to the job as well.

Example job that ran on my private repo:
https://github.com/madolson/valkey/actions/runs/9123245899/job/25085418567

Example notification: 
<img width="662" alt="image"
src="https://github.com/valkey-io/valkey/assets/34459052/69127db4-e416-4321-bc06-eefcecab1130">
(Note: I removed the sassy text at the bottom from the PR)

Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
2024-05-16 23:51:33 -07:00
Ping Xie
fd53f17a61
Use pause_process to stop a node to make Valgrind happy, hopefully (#508)
Signed-off-by: Ping Xie <pingxie@google.com>
2024-05-16 22:59:00 -07:00
Lipeng Zhu
7a9951fb80
Correct the actual allocated size from allocator when call sdsRedize to align the logic with sdsnewlen function. (#476)
This patch try to correct the actual allocated size from allocator
when call sdsRedize to align the logic with sdsnewlen function.

Maybe the https://github.com/valkey-io/valkey/pull/453 optimization
should depend on this.

Signed-off-by: Lipeng Zhu <lipeng.zhu@intel.com>
2024-05-15 18:22:50 -07:00
Arthur Lee
3de5c71f48
[Feat] Support fast fail option for tcl test cases (#482)
This PR added a new option for tcl test case which will fail fast once any test cases fail.
This can be useful while running redis CI pipeline, and you want to accelerate the CI pipeline.

usage for example

> ./runtest --single unit/type/hash --fast-fail

---------

Signed-off-by: arthur.lee <arthur-lee@qq.com>
2024-05-15 06:55:24 -07:00
Madelyn Olson
6e4a61093e
Make it to so that unit tests build on mac (#499)
The test logic is not smart enough to realize that a test is fully
#ifdef'd out, so it will try to attach it to the test suite anyways.
This is a minor work around for the reclaim file page test so that it
will still attach the test, it will just always succeed. Also remove an
unnecessary print statement that was missed in the same test.

Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
2024-05-15 14:48:30 +08:00
Madelyn Olson
546cef6684
Initial cleanup for cluster refactoring (#460)
Cleaned up the minor cluster refactoring notes that were intended to be
follow ups that never happened. Basically:
1. Minor style nitpicks
2. Generalized clusterNodeIsMyself so that it wasn't implementation
dependent.
3. Removed getMyClusterId, and just make it an explicit call to myself's
name, which seems more straightforward and removes unnecessary
abstraction.
4. Remove clusterNodeGetSlaveof infavor of clusterNodeGetMaster. We
already do a check if it's a replica, and if it wasn't working it would
have been crashing.

Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
2024-05-14 17:09:49 -07:00
Karthick Ariyaratnam
741ee702ca
[New] Migrate zmalloc.c unit tests to new test framework. (#493)
This is the actual PR which is created to migrate all tests related to
zmalloc into new test framework as part of the parent issue
https://github.com/valkey-io/valkey/issues/428.

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
2024-05-14 15:54:33 -07:00
Viktor Söderqvist
72f2a8743c
Minor fix in module API doc script (#494)
The script extracts the comments and prototypes from module.c and does
some pre-processing, e.g. converts URLs to markdown links. The URL
regexp didn't account for '#', '?' (and a few more chars) so an URL like
`https://example.com/#section` was converted to markdown as

    [https://example.com/](https://example.com/)#section

With this change, it's instead correctly converted to

    [https://example.com/#section](https://example.com/#section)

Additional change: Removes an unused metadata field.

Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
2024-05-14 01:12:30 +02:00
Madelyn Olson
4e18e326a1
Remove endian coverage from server.c (#492)
In c7ad9feb52,
we missed removed endian coverage from the legacy unit tests, so it failed to find it when building.

Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
2024-05-13 11:02:41 +08:00
Karthick Ariyaratnam
c7ad9feb52
Migrate endianconv.c unit tests to new test framework (#458)
This PR migrates all tests related to endianconv into new test framework
as part of the parent issue https://github.com/valkey-io/valkey/issues/428.

---------

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
2024-05-12 16:58:50 -07:00
Andy Pan
dca1722340
Use kqueue as the backend of AE on DragonFlyBSD (#450)
Currently, we use select(2) on DragonFlyBSD while
`kqueue` is available on DragonFlyBSD since FreeBSD 4.1
and DragonFlyBSD was originally forked from FreeBSD 4.8

`select(2)` is a pretty old technique that has many defects
compared to `kqueue`, we should switch to `kqueue` on DragonFlyBSD.

Signed-off-by: Andy Pan <i@andypan.me>
2024-05-12 16:29:00 -07:00
Ping Xie
ac47ca2d47
Suppress ASAN errors on tests that intentially crash the server via crash-memcheck-enabled no (#489)
Fix daily CI run errors like
https://github.com/valkey-io/valkey/actions/runs/9039450198/job/24842308071#step:6:4176

Signed-off-by: Ping Xie <pingxie@google.com>
2024-05-12 16:08:47 -07:00
Shivshankar
07367df981
Update rdb and module's child proc name to valkey accordingly (compatible with redis symlink) (#454)
If `valkey-server` was started with the `redis-server` symlink, the old
proc names are used, for backwards compatibility.

---------

Signed-off-by: Shivshankar-Reddy <shiva.sheri.github@gmail.com>
2024-05-10 21:51:01 +02:00
Shivshankar
e242799867
Migrate sha1 unit test to new framework (#470)
This migrates unit tests related to sha1 to new framework, ref: #428.

---------

Signed-off-by: Shivshankar-Reddy <shiva.sheri.github@gmail.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
2024-05-09 19:44:40 -07:00
Ping Xie
138a7d9846
Handle role change error in cluster setslot when migrating the last slot away with allow-replica-migration enabled (#466) 2024-05-09 18:12:55 -07:00
Andy Pan
8048abb2fd
Support pipe2() on *BSD (#462)
Before this PR, `pipe2()` is only enabled on Linux and FreeBSD while
`pipe2()` is available on *BSD.

This PR enables `pipe2()` for the rest of *BSD: DragonFlyBSD, NetBSD and
OpenBSD.

## References

- [pipe2 on
DraonFlyBSD](https://man.dragonflybsd.org/?command=pipe&section=2)
- [__DragonFly_version for
pipe2](7485684fa5/sys/sys/param.h (L121))
- [pipe2 on  NetBSD](https://man.netbsd.org/pipe.2)
- [pipe2 on OpenBSD](https://man.openbsd.org/pipe.2)

Signed-off-by: Andy Pan <i@andypan.me>
2024-05-10 02:30:39 +02:00
Lipeng Zhu
0342a81b7c
Migrate sds.c unit tests to new test framework. (#478)
This patch migrates all tests in sds.c into new test framework as part
of the parent issue https://github.com/valkey-io/valkey/issues/428.

---------

Signed-off-by: Lipeng Zhu <lipeng.zhu@intel.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
2024-05-09 14:54:39 -07:00
Arthur Lee
4e1d8e1721
[Fix] move deps from slowlog.c into slowlog.h (#465)
Move dependency from `slowlog.c` into `slowlog.h`, make sure the
language server can work properly under `slowlog.h`

Signed-off-by: arthur.lee <arthur-lee@qq.com>
2024-05-09 14:29:18 -07:00
Arthur Lee
2559f64f5a
[FIX] Remove redundant statement and return (#481)
* `freeClientArgv` was previously defined in `server.h`
* remove the redundant return

Signed-off-by: arthur.lee <arthur-lee@qq.com>
2024-05-09 14:26:45 -07:00
Karthick Ariyaratnam
b166980c8e
Fix UNUSED repetition issue in test sources (#475)
This is a follow-up PR to address UNUSED repetition issue (see
https://github.com/valkey-io/valkey/pull/446#discussion_r1593204956) in
different test source files.

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
2024-05-09 14:26:15 -07:00
Binbin
fdd023ff82
Migrate cluster mode tests to normal framework (#442)
We currently has two disjoint TCL frameworks:
1. Normal testing framework, which trigger by runtest, which individually
launches nodes for testing.
2. Cluster framework, which trigger by runtest-cluster, which pre-allocates
N nodes and uses them for testing large configurations.

The normal TCL testing framework is much more readily tested and is also
automatically run as part of the CI for new PRs. The runtest-cluster since
it runs very slowly (cannot be parallelized), it currently only runs in daily
CI, this results in some changes to the cluster not being exposed in PR CI
in time.

This PR migrate the Cluster mode tests to normal framework. Some cluster
tests are kept in runtest-cluster because of timing issues or not yet
supported, we can process them later.

Signed-off-by: Binbin <binloveplay1314@qq.com>
2024-05-09 10:14:47 +08:00
Shivshankar
6cff0d6a7b
Remove intsettest declaration from intset.h (#471)
All the intset unit tests are migrated to new test framework as part of
https://github.com/valkey-io/valkey/pull/344, but the old framework
declaration is missed to remove from intset.h. So removed the code.

Signed-off-by: Shivshankar-Reddy <shiva.sheri.github@gmail.com>
2024-05-08 12:38:50 -07:00