Commit Graph

12247 Commits

Author SHA1 Message Date
Viktor Söderqvist
10d980890c
Update CONTRIBUTING.md and issue templates (#311)
Update CONTRIBUTING.md:
    
* A more friendly approach, hopefully.
* The note about receiving patches is moved to the DCO section.
* Some "Get started" links in a bullet list (inspired by OpenTofu's
contributing file).
* For questions, refer to GitHub Discussions and Discord instead of only
Discord.
* Minor edits and formatting.

Update issue templates:
    
* The issue template for questions is replaced by a link to Discussions
and to Matrix and Discord chats.
* Add a link to the valkey-doc repo.
* The crash report template is extended into a form, with separate
fields for the crash report and the additional info.

---------

Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
2024-04-15 16:00:59 +02:00
jonghoonpark
c090874ed4
List test files dynamically (#313)
Motivation: Currently we have to manually update the all_tests variable
when introducing new test files.

Fix: I've modified it to list test files dynamically, but rather than
modify it to add all test files, I've first modified it to only add test
files from the following 4 paths so that it doesn't deviate too much
from what we already do

- unit
- unit/type
- unit/cluster
- integration

Related issue: https://github.com/valkey-io/valkey/issues/302

---------

Signed-off-by: jonghoonpark <dev@jonghoonpark.com>
2024-04-15 14:25:33 +02:00
Vitah Lin
1221b3951a
Fix typo in comment (#318)
Signed-off-by: Vitah Lin <vitahlin@gmail.com>
2024-04-15 13:45:00 +02:00
Andy Pan
fc5bf6a0ef
Clamp TCP_KEEPINTVL and simplify TCP_KEEPALIVE_ABORT_THRESHOLD on Solaris (#292)
The time between each consequent probes is set by TCP_KEEPINTVL in
seconds. The minimum value is ten seconds. The maximum is ten days,
while the default is two hours. The TCP connection will be aborted after
certain amount of probes, which is set by TCP_KEEPCNT, without receiving
response.

## References
[Solaris
11.4](https://docs.oracle.com/cd/E88353_01/html/E37851/tcp-4p.html)

Signed-off-by: Andy Pan <i@andypan.me>
2024-04-14 21:53:07 -07:00
Shivshankar
a4da212f11
upadate release tool script to valkey (#239)
Updated release-tool scripts to valkey, This PR covered only the file
names for the tarball but still location needs to be updated
accordingly.

Signed-off-by: Shivshankar-Reddy <shiva.sheri.github@gmail.com>
2024-04-14 13:22:48 -07:00
Sher_Sun
e71be72745
Fix typo and rename Redis to Valkey in the utils/lru/README (#314)
This utils/lru/README incorrectly refers to REDIS_LRU_CLOCK_RESOLUTION
in server.h to modify the LRU clock resolution. However, the actual
constant in server.h has been updated to LRU_CLOCK_RESOLUTION, but the
README was not updated to reflect this change.

1. Replaced REDIS_LRU_CLOCK_RESOLUTION with LRU_CLOCK_RESOLUTION in the
text of utils/lru/README.
2. Updated references from "Redis" to "Valkey" within the same README
file as part of the ongoing rebranding efforts:)

---------

Signed-off-by: Sher Sun <sher.sun@huawei.com>
Co-authored-by: Sher Sun <sher.sun@huawei.com>
2024-04-14 11:40:01 -07:00
Kyle J. Davis
eb7f5c4e0a
Removes empty history arrays in json (#317)
Fixes #241 

Removes the empty `history` arrays in 6 command JSON files. This
normalizes these 6 with the rest of the command JSON which omit the
`history` array entirely when there is no history.

This makes parsing these files slightly less annoying in languages where
empty arrays are falsey.

Signed-off-by: Kyle J. Davis <kyledvs@amazon.com>
2024-04-13 21:38:05 +02:00
Björn Svensson
1c282a9306
Set permissions for Github Actions in CI (#312)
This sets the default permission for current CI workflows to only be
able to read from the repository (scope: "contents").
When a used Github Action require additional permissions (like CodeQL)
we grant that permission on job-level instead.

This means that a compromised action will not be able to modify the repo
or even steal secrets since all other permission-scopes are implicit set
to "none", i.e. not permitted. This is recommended by
[OpenSSF](https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions).

This PR includes a small fix for the possibility of missing server logs
artifacts, found while verifying the permission.
The `upload-artifact@v3` action will replace artifacts which already
exists. Since both CI-jobs `test-external-standalone` and
`test-external-nodebug` uses the same artifact name, when both jobs
fail, we only get logs from the last finished job. This can be avoided
by using unique artifact names.

This PR is part of #211

More about permissions and scope can be found here:

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

---------

Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
2024-04-12 17:24:22 +02:00
Tom Morris
7b58f080a8
Fix typo in SECURITY.md (#309)
Fix typo: "disclore" to "disclosure" in SECURITY.md

Signed-off-by: Tom Morris <tom@tommorris.org>
2024-04-12 11:05:39 -04:00
Parth
644692db79
Fixing a lua debugger bug that prevented use of 'server' for server.call invocations. (#303)
* Tested it on local instance. This was originally part of
https://github.com/valkey-io/valkey/pull/288 but I am pushing this
separately, so that we can easily merge it into the upcoming release.

```
lua debugger> server ping
<redis> ping
<reply> "+PONG"
lua debugger> redis ping
<redis> ping
<reply> "+PONG"
```

* I also searched for lua debugger related unit tests to add coverage
for this but did not find any relevant test to modify. Leaving it at
that for now.

---------

Signed-off-by: Parth Patel <661497+parthpatel@users.noreply.github.com>
2024-04-11 15:54:39 -07:00
Madelyn Olson
3d887df265
Add links for security issues (#299)
Add an initial security release page. In the fullness of time I would
like to also include our version support here, but until that has been
decided I would like to keep this simple and just include links.

---------

Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
2024-04-11 15:12:28 -07:00
Wen Hui
c36f67a3ec
Fix a minor issue for Redis brand name in Sentinel.conf (#300)
Signed-off-by: hwware <wen.hui.ware@gmail.com>
2024-04-11 13:59:52 -07:00
Shivshankar
4be97ebcbe
update valkey in serverLog messeges in server.c file (#231)
Updated keyword "Redis" to "Valkey" in log messeges in server.c file

Signed-off-by: Shivshankar-Reddy <shiva.sheri.github@gmail.com>
2024-04-11 16:34:32 -04:00
bentotten
6975242529
Update comment in cluster_legacy.h (#277)
Update comment suggesting clusterMsgPingExtTypes to clusterMsgPingtypes
as clusterMsgPingExtTypes does not exist

Signed-off-by: Ben Totten <btotten@amazon.com>
2024-04-11 13:18:20 -07:00
Daniel House
f0113a4105
Clarify the usage of Valkey in a comment (#233)
Signed-off-by: Daniel House <daniel.house@huawei.com>
2024-04-11 13:06:04 -07:00
Roshan Khatri
f4f1bd6fde
Revert update of RedisModuleEvent_MasterLinkChange (#289)
ValkeyModuleEvent_MasterLinkChange was updated to use more inclusive
language, but it was done in the compatibility layer as well
(RedisModuleEvent_).

---------

Signed-off-by: Roshan Khatri <rvkhatri@amazon.com>
2024-04-10 17:35:08 -07:00
Daniel House
b669af0eab
Rename 'redis_tls_ctx' and 'redis_tls_client_ctx' global variables (#268)
Signed-off-by: Daniel House <daniel.house@huawei.com>
Signed-off-by: daniel-house <danny@cs.toronto.edu>
Co-authored-by: Daniel House <daniel.house@huawei.com>
2024-04-10 23:00:27 +02:00
Shivshankar
2e46046625
Rename macros in valkey-cli.c and redis_strlcpy to valkey (#284)
Signed-off-by: Shivshankar-Reddy <shiva.sheri.github@gmail.com>
2024-04-10 22:50:52 +02:00
Viktor Söderqvist
f8cec23a9b
Delete old deprecated cli program redis-trib (#281)
Actually, this script doesn't do anything except printing that it is
replaced by redis-cli.

Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
2024-04-10 18:14:58 +02:00
Shivshankar
a054862b72
Rename redis_client* procedure to valkey_client* in test environment (#276)
Renamed redis-client* procedure to valkey_client*

Signed-off-by: Shivshankar-Reddy <shiva.sheri.github@gmail.com>
2024-04-10 10:18:47 -04:00
Shivshankar
05d16579e6
Rename redis in valkey-cli file comments and prints (#222)
Updated to Valkey in valkey-cli.c file's comments and prints.

* The output of valkey-cli --help
* The output of the cli built-in HELP command
* The prompt in interactive valkey-cli -s unixsocket
* The history file and the default rc file (changed filename)

---------

Signed-off-by: Shivshankar-Reddy <shiva.sheri.github@gmail.com>
2024-04-10 11:03:08 +02:00
Vitah Lin
4a8b4f4229
Rename redis.info to valkey.info in LCOV (#259)
Signed-off-by: Vitah Lin <vitahlin@gmail.com>
2024-04-10 08:59:45 +02:00
Madelyn Olson
03650e91b7
Revert the default PID file back to the real default (#275)
The default pid file is created at /var/run/redis.pid based on the code
at
da831c0d22/src/server.h (L132).
Until we update it, we should reflect that in the conf file.

Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
2024-04-09 08:21:06 -07:00
Shivshankar
da831c0d22
rename procedure redis_deferring_client to valkey_deferring_client (#270)
Updated procedure redis_deferring_client in test environent to
valkey_deferring_client.

Signed-off-by: Shivshankar-Reddy <shiva.sheri.github@gmail.com>
2024-04-09 10:38:09 -04:00
Madelyn Olson
c0cef48e98
Fix reference to redis-tls module (#273)
Update test usage of valkey-tls.so module to use valkey-tls.so instead.

Fixes tests failures like
https://github.com/valkey-io/valkey/actions/runs/8592855995/job/23543475478.

Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
2024-04-09 07:15:59 -07:00
Jacob Murphy
df5db0627f
Remove trademarked language in code comments (#223)
This includes comments used for module API documentation.

* Strategy for replacement: Regex search: `(//|/\*| \*|#).* ("|\()?(r|R)edis( |\.
  |'|\n|,|-|\)|")(?!nor the names of its contributors)(?!Ltd.)(?!Labs)(?!Contributors.)`
* Don't edit copyright comments
* Replace "Redis version X.X" -> "Redis OSS version X.X" to distinguish
from newly licensed repository
* Replace "Redis Object" -> "Object"
* Exclude markdown for now
* Don't edit Lua scripting comments referring to redis.X API
* Replace "Redis Protocol" -> "RESP"
* Replace redis-benchmark, -cli, -server, -check-aof/rdb with "valkey-"
prefix
* Most other places, I use best judgement to either remove "Redis", or
replace with "the server" or "server"

Fixes #148

---------

Signed-off-by: Jacob Murphy <jkmurphy@google.com>
Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
2024-04-09 10:24:03 +02:00
Harkrishn Patro
1aa13decf6
Remove single node cluster validation check from benchmark (#266)
Allow redis-benchmark to run against single shard clusters. 

Signed-off-by: Harkrishn Patro <harkrisp@amazon.com>
2024-04-08 21:20:10 -07:00
VoletiRam
d89ef06ce5
Wait for cluster fully online in cluster_config_consistent (#272)
Wait for cluster to be in a fully consistent and online state in
`cluster_config_consistent`. We expect the `start_server` to create the
desired primaries and replicas before the start of the tests. With the
current setup, the replicas may not complete the sync with primaries and
can be in loading state. In some cases, the role of replicas can still
be master with the delay of propagation of replicate command. The tests
can show flaky behavior in such cases. Add a check that verifies the
nodes health status 'online' for the cluster consistency. Leverage the
deterministic order of `CLUSTER SLOTS` to consider the cluster as
consistent along with the nodes health status.

---------

Signed-off-by: Harkrishn Patro <harkrisp@amazon.com>
Signed-off-by: Ram Prasad Voleti <ramvolet@amazon.com>
Co-authored-by: Harkrishn Patro <harkrisp@amazon.com>
Co-authored-by: Ram Prasad Voleti <ramvolet@amazon.com>
2024-04-08 20:03:56 -07:00
Harkrishn Patro
e59dd41e42
Maintain determinstic ordering of replica(s) in CLUSTER SLOTS response (#265)
Sort `clusterNode.slaves` while adding a new replica to the cluster on
basis of `name`. This will enable deterministic ordering of replica(s)
information in `CLUSTER SLOTS` response.

Before this change:

```
127.0.0.1:6380> CLUSTER SLOTS
1) 1) (integer) 0
   2) (integer) 16383
   3) 1) "127.0.0.1"
      2) (integer) 6379
      3) "fc72609a620c62d073a31eed9ddde5104c1fa302"
      4) (empty array)
   4) 1) "127.0.0.1"
      2) (integer) 6381
      3) "fac84bbf2ffc5cfcdebc92c06b8ead9c3cba4051"
      4) (empty array)
   5) 1) "127.0.0.1"
      2) (integer) 6380
      3) "b1249d394326f1485df0b895f2fd38e141aa5056"
      4) (empty array)
```

After this change:

```
127.0.0.1:6380> CLUSTER SLOTS
1) 1) (integer) 0
   2) (integer) 16383
   3) 1) "127.0.0.1"
      2) (integer) 6379
      3) "fc72609a620c62d073a31eed9ddde5104c1fa302"
      4) (empty array)
   4) 1) "127.0.0.1"
      2) (integer) 6380
      3) "b1249d394326f1485df0b895f2fd38e141aa5056"
      4) (empty array)
   5) 1) "127.0.0.1"
      2) (integer) 6381
      3) "fac84bbf2ffc5cfcdebc92c06b8ead9c3cba4051"
      4) (empty array)
```

Signed-off-by: Harkrishn Patro <harkrisp@amazon.com>
2024-04-08 19:58:23 -07:00
Harkrishn Patro
c2ebe9ebbd
Add sharded-pubsub tcl test to test_helper all test set (#267)
Add sharded-pubsub to the supported TCL tests.

Signed-off-by: Harkrishn Patro <harkrisp@amazon.com>
2024-04-08 17:18:45 -07:00
Shivshankar
5bccd7b800
Rename systemd files and content to valkey from redis (#234)
Changed systemd file names and content of them to valkey.

Signed-off-by: Shivshankar-Reddy <shiva.sheri.github@gmail.com>
2024-04-08 14:37:56 -04:00
Madelyn Olson
750e94cad3
Update crash wording to include our repo (#263)
Update the wording in the crash log to point to Valkey repo instead of Redis repo.

Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
2024-04-08 10:09:27 -07:00
Harkrishn Patro
ebfb440629
Pass extensions to node if extension processing is handled by it (#52)
Ref: https://github.com/redis/redis/pull/12760

### Description

#### Fixes compatibilty of PlaceholderKV cluster (7.2 - extensions
enabled by default) with older Redis cluster (< 7.0 - extensions not
handled) .

With some of the extensions enabled by default in 7.2 version, new nodes
running 7.2 and above start sending out larger clusterbus message
payload including the ping extensions. This caused an incompatibility
with node running engine versions < 7.0. Old nodes (< 7.0) would receive
the payload from new nodes (> 7.2) would observe a payload length
(totlen) > (estlen) and would perform an early exit and won't process
the message.

This fix introduces a flag `extensions_supported` on the clusterMsg
indicating the sender node can handle extensions parsing. Once, a
receiver nodes receives a message with this flag set to 1, it would
update clusterNode new field extensions_supported and start sending out
extensions if it has any.


This PR also introduces a DEBUG sub command to enable/disable cluster
message extensions `process-clustermsg-extensions` feature.

Note: A successful `PING`/`PONG` is required as a sender for a given
node to be marked as `extensions_supported` and then extensions message
will be sent to it. This could cause a slight delay in receiving the
extensions message(s).

### Testing

TCL test verifying the cluster state is healthy irrespective of
enabling/disabling cluster message extensions feature.

---------

Signed-off-by: Harkrishn Patro <harkrisp@amazon.com>
2024-04-08 09:01:30 -07:00
Bany
d92dc78cb8
Update ValkeyModuleEvent_MasterLinkChange to ValkeyModuleEvent_PrimaryLinkChange (#262)
Update ValkeyModuleEvent_MasterLinkChange to ValkeyModuleEvent_PrimaryLinkChange

Signed-off-by: 0del <bany.y0599@gmail.com>
2024-04-08 08:56:39 -07:00
Madelyn Olson
6411629c61
Madelyn's attempt as a logo (#251)
Apply new logo at startup.

It is one character wider and 2 characters taller than the original
Redis logo.

---------

Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
2024-04-07 17:30:38 -07:00
Viktor Söderqvist
d26d596b3e
Log branding (#252)
Small changes to the log messages printed during startup and shutdown,
for Valkey branding.

SERVER_NAME is replaced by verbatim "Valkey" in one place, because
SERVER_NAME expands to "valkey" in lowercase. (Should we introduce
another macro that expands to "Valkey"?)

Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
2024-04-07 17:28:02 -07:00
Arpit Pandey
1b47daff09
Fix: Typo clock_getting -> clock_gettime (#244)
typo in comment monotonic.c file:- 

Changed: faster than calling 'clock_getting' (POSIX) 
To: faster than calling 'clock_gettime' (POSIX)

Signed-off-by: Arpit Pandey <arpit.pandey05@gmail.com>
2024-04-07 14:49:14 -07:00
Madelyn Olson
9f03dfc1f6
Fix two typos that were flagged in the 7.2 build (#248)
These were flagged on the 7.2 build system, which is using the old spell
check. I think we should consider re-adding it as it missed some typos.

Relevant: https://github.com/valkey-io/valkey/pull/72

Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
2024-04-07 00:07:51 -07:00
0del
717ec1e144
Rename ValkeyModule_DefragModuleString to ValkeyModule_DefragValkeyModuleString (#243)
fixes: #242

---------

Signed-off-by: 0del <bany.y0599@gmail.com>
Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
2024-04-06 22:50:56 +02:00
Vitah Lin
ba0c93cbdf
Add redis symlinks at the same place as the installed binaries (#193)
Adds a new make variable called `USE_REDIS_SYMLINKS`, with default value
`yes`. If yes, then `make install` creates additional symlinks to the
installed binaries:

* `valkey-server`
* `valkey-cli`
* `valkey-benchmark`
* `valkey-check-rdb`
* `valkey-check-aof`
* `valkey-sentinel`

The names of the symlinks are the legacy redis binary names
(`redis-server`, etc.). The purpose is to provide backward compatibility
for scripts expecting the these filenames. The symlinks are installed in
the same directory as the binaries (typically `/usr/local/bin/` or
similar).

Similarly, `make uninstall` removes these symlinks if
`USE_REDIS_SYMLINKS` is `yes`.

This is described in a note in README.md.

Fixes #147

---------

Signed-off-by: Vitah Lin <vitahlin@gmail.com>
Co-authored-by: Madelyn Olson <34459052+madolson@users.noreply.github.com>
2024-04-06 18:41:53 +02:00
Parth
620d325fdc
Adding server.call/pcall option to LUA scripting. (#136) (#213)
This commit does not remove redis.call/pcall just yet. It also does not
rename Redis in error messages such as "Please specify at least one
argument for this redis lib call". This allows users to maintain full
backwards compatibility while introducing an option to use server.call
for new code.

I verified that the unit tests pass. Also manually verified that the
redis-server responds to server.call invocations within lua scripting.
Also verified that function registration works as expected.

```
[ok]: EVAL - is Lua able to call Redis API? (0 ms)
[ok]: EVAL - is Lua able to call Server API? (1 ms)
[ok]: EVAL - No arguments to redis.call/pcall is considered an error (0 ms)
[ok]: EVAL - No arguments to server.call/pcall is considered an error (1 ms)
```

---------

Signed-off-by: Parth Patel <661497+parthpatel@users.noreply.github.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
2024-04-05 21:17:11 -07:00
Madelyn Olson
bc28fb4ac0
Update Server version to valkey version (#232)
This commit updates the following fields:
1. server_version -> valkey_version in server info. Since we would like
to advertise specific compatibility, we are making the version specific
to valkey. servername will remain as an optional indicator, and other
valkey compatible stores might choose to advertise something else.
1. We dropped redis-ver from the API. This isn't related to API
compatibility, but we didn't want to "fake" that valkey was creating an
rdb from a Redis version.
1. Renamed server-ver -> valkey_version in rdb info. Same as point one,
we want to explicitly indicate this was created by a valkey server.

---------

Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
2024-04-05 21:15:57 -07:00
Ping Xie
aaec321213
Remove REDISMODULE_ prefixes and introduce compatibility header (#194)
Fix #146 

Removed REDISMODULE_ prefixes from the core source code to align with
the new SERVERMODULE_ naming convention. Added a new 'redismodule.h'
header file to ensure full backward compatibility with existing modules.
This compatibility layer maps all legacy REDISMODULE_ prefixed
identifiers to their new SERVERMODULE_ equivalents, allowing existing
Redis modules to function without modification.

---------

Signed-off-by: Ping Xie <pingxie@google.com>
2024-04-05 16:59:55 -07:00
Shivshankar
906c8e8f90
delete cluster fail time script (#237) 2024-04-05 14:50:42 -07:00
Wen Hui
7f5bcc96f0
Update some valkey-cli related in tcl (#236)
Signed-off-by: hwware <wen.hui.ware@gmail.com>
2024-04-05 16:46:33 -04:00
Siddhartha Sankar Mondal
47444c67de
Update Makefile comments to relect name change (#106)
Update the comments in the Makefile to reflect the new names.

Signed-off-by: Siddhartha Mondal <siddharthmondal@gmail.com>
2024-04-05 13:54:28 -04:00
Wen Hui
490f4ebb65
Update runtest test name and test filename (#214)
Update runtest test name and test filename

Signed-off-by: hwware <wen.hui.ware@gmail.com>
2024-04-04 18:41:45 -07:00
Wen Hui
bb1a3fffe7
Fix CI break issue due to serverTests merged issue (#218)
Here is the latest CI run result for this PR

https://github.com/hwware/placeholderkv/actions/runs/8561152261

Signed-off-by: hwware <wen.hui.ware@gmail.com>
2024-04-04 17:37:15 -04:00
Viktor Söderqvist
4646d0825e
Redis in HELP commands (#216)
Removes the word Redis in the output of COMMAND HELP and DEBUG HELP.

---------

Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
2024-04-04 23:18:37 +02:00
Wen Hui
29621bc356
Update Valkey keyword in sentinel.conf (#171)
Mostly comments, but one pre-filled config in this template config file
is changed:

    pidfile /var/run/valkey-sentinel.pid

---------

Signed-off-by: hwware <wen.hui.ware@gmail.com>
2024-04-04 20:54:49 +02:00