Skip to content

Support connection schemes valkey:// and valkeys://#199

Merged
zuiderkwast merged 5 commits into
valkey-io:unstablefrom
zhulipeng:scheme
Apr 23, 2024
Merged

Support connection schemes valkey:// and valkeys://#199
zuiderkwast merged 5 commits into
valkey-io:unstablefrom
zhulipeng:scheme

Conversation

@zhulipeng

@zhulipeng zhulipeng commented Apr 4, 2024

Copy link
Copy Markdown
Member
  1. Support valkey:// and valkeys:// scheme in valkey-cli and valkey-benchmark. Retain the original Redis schemes for compatibility.
  2. Add unit tests for valid URI, all schemes.

Fixes: #198
Fixes: #200

Comment thread src/cli_common.c
Signed-off-by: Lipeng Zhu <lipeng.zhu@intel.com>
@zhulipeng zhulipeng changed the title Rename connection scheme from redis:// to valkey://. Support connection schemes: valkey://, valkeys://. Apr 4, 2024
@zhulipeng zhulipeng changed the title Support connection schemes: valkey://, valkeys://. Support connection schemes: valkey://, valkeys://. Apr 4, 2024

@zuiderkwast zuiderkwast left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

The --help text now only mentions the valkey schemes, although the redis schemes also still work.

@valkey-io/core-team Do we need to document in the help text that the redis schemes are still supported?

@zuiderkwast

Copy link
Copy Markdown
Contributor

AH!! I didn't review the tests. If there is more coming, better mark the PR as draft. :D

I'll review the tests now.

@zuiderkwast zuiderkwast left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, LGTM, just one typo in one of the test case names. :)

Comment thread tests/integration/redis-cli.tcl Outdated
Signed-off-by: Lipeng Zhu <lipeng.zhu@intel.com>
Signed-off-by: Lipeng Zhu <lipeng.zhu@intel.com>
Signed-off-by: Lipeng Zhu <lipeng.zhu@intel.com>
Comment thread tests/integration/redis-cli.tcl Outdated
@enjoy-binbin

Copy link
Copy Markdown
Member

Please also update the top comment to describe the changes (don't just link issue).
For example, mention we supports valkey://, and also retains the original redis schema for compatibility, and then we adds some tests to cover these cases.

also if you have a PR directly, there is actually no need to create a new issue (there is no discussion or tracking in the issue so it is actually worthless)

Comment thread src/cli_common.c
const char *scheme = "redis://";
const char *tlsscheme = "rediss://";
const char *scheme = "valkey://";
const char *tlsscheme = "valkeys://";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a concerns about this. With Redis, using rediss was clearer to me that it was SSL because there is obviously a second s. With Valkey, I'm concerned valkeys will be confusing since it's not clear. I want us to least thing about it a bit more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@madolson think about it for a while then. :)

Adding "s" is the most common style for URI schemes, so I think valkeys is the right choice. Here are some from IANA's list:

aaa 		Diameter Protocol
aaas 		Diameter Protocol with Secure Transport
http 		Hypertext Transfer Protocol
https 		Hypertext Transfer Protocol Secure
msrp 		Message Session Relay Protocol
msrps 		Message Session Relay Protocol Secure
rtsp 		Real-Time Streaming Protocol (RTSP)
rtsps 		Real-Time Streaming Protocol (RTSP) over TLS
sip 		session initiation protocol
sips 		secure session initiation protocol

@madolson madolson Apr 4, 2024

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I thought about it and will retract my concern :) I still don't really like it, but I guess it's fine.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess now would be the time to rethink the URI scheme if we wanted to do that though.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this scheme is widely used. It's a client feature anyway.

We can postpone it indefinitely and only support the redis scheme. Do you prefer that?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can consider resp as the scheme. RESP is the protocol after all. :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like resp more. In fact, I think "redis" was a minomer to begin with. It should've been a protocol name.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the redis scheme contains more than what's specified in RESP.

An example URL redis://user:password@host:port/dbnum contains information for the AUTH command and the SELECT command, to be called after connecting. It doesn't contain the RESP version though (for HELLO). It's a bit ad-hoc all of it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could have included various more things which are useful to do when connecting, like CLIENT SETNAME, CLIENT SETINFO LIBNAME, CLIENT SETINFO LIBVER, CLIENT NO-EVICT.

For example we could support them in a query string, such as

?name=banana&libname=valkey-py&libver=3.14.159&no-evict=1

The RESP version (HELLO N) very much affects what comes out from each command, so it's basically a different protocol. We could embed that in the scheme as resp2: vs resp3:.

.... or we can just keep the redis schemes just for backward compatibility. I'm not sure we need a scheme anyway, do we?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as valkey-cli can accept "redis/rediss", I am fine with other options, "valkey" or "resp2/3".

@zuiderkwast, you have a good point that the scheme implies more than just the wire protocol but also the specific client behavior so this is more of a call on the client side.

Signed-off-by: Lipeng Zhu <lipeng.zhu@intel.com>
@zuiderkwast

Copy link
Copy Markdown
Contributor

I'm going to merge this. It's the least surprising schemes for any forked clients and for users moving from redis-cli to valkey-cli.

We can change back if there are protests.

@zuiderkwast zuiderkwast merged commit 87a5bfc into valkey-io:unstable Apr 23, 2024
@zuiderkwast zuiderkwast changed the title Support connection schemes: valkey://, valkeys://. Support connection schemes valkey:// and valkeys:// Apr 23, 2024
@zuiderkwast zuiderkwast added the release-notes This issue should get a line item in the release notes label Apr 23, 2024
@zhulipeng zhulipeng deleted the scheme branch April 23, 2024 02:59
PatrickJS pushed a commit to PatrickJS/placeholderkv that referenced this pull request Apr 24, 2024
1. Support valkey:// and valkeys:// scheme in valkey-cli and
valkey-benchmark. Retain the original Redis schemes for compatibility.
2. Add unit tests for valid URI, all schemes.

Fixes: valkey-io#198
Fixes: valkey-io#200

---------

Signed-off-by: Lipeng Zhu <lipeng.zhu@intel.com>
zuiderkwast pushed a commit that referenced this pull request Apr 25, 2024
)

When using a TLS scheme for valkey-cli and benchmark-cli compiled
without TLS, make the error message only mention the scheme used.

Before:

"valkeys:// and rediss:// are only supported when valkey-cli is compiled
with OpenSSL"

After, depending on which scheme the user tried to use:

"valkeys:// is only supported when valkey-cli is compiled with OpenSSL"
"rediss:// is only supported when valkey-cli is compiled with OpenSSL"

Follow up of #199.

---------

Signed-off-by: karthyuom <karthyuom@gmail.com>
Co-authored-by: k00809413 <karthick.ariyaratnam1@huawei.com>
bjosv added a commit to bjosv/valkey that referenced this pull request Aug 20, 2025
Squashed 'deps/libvalkey/' changes from abcd27fbf..d95a5ee9a

9e10acbf7 Fix duplicate Acks for RDMA events. (valkey-io#229)
1eadedf48 Remove the unused valDup API from dict
a449f0ea1 Don't expose internal functions in shared libraries (valkey-io#205)
178e350c7 Cluster code cleanup (valkey-io#216)
4020396c8 Fix `unused-parameter` warning when building with `NDEBUG` (valkey-io#212)
279125e22 Spelling (valkey-io#213)
99aa158bc Use existing connections for blocking slotmap updates (valkey-io#199)
f670346b9 Only install headers for `TLS` and `RDMA` when enabled in CMake (valkey-io#206)
41c5911f1 Remove macro UNUSED from public API (valkey-io#200)
969a8c546 Fix dependency issue with RDMA (valkey-io#201)

git-subtree-dir: deps/libvalkey
git-subtree-split: d95a5ee9ad95b9ee7f298f38d0fb93f3f7659ef7

Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
bjosv added a commit to bjosv/valkey that referenced this pull request Aug 20, 2025
Squashed 'deps/libvalkey/' changes from abcd27fbf..b012f8e85

b012f8e85 Release 0.2.1
9e10acbf7 Fix duplicate Acks for RDMA events. (valkey-io#229)
1eadedf48 Remove the unused valDup API from dict
a449f0ea1 Don't expose internal functions in shared libraries (valkey-io#205)
178e350c7 Cluster code cleanup (valkey-io#216)
4020396c8 Fix `unused-parameter` warning when building with `NDEBUG` (valkey-io#212)
99aa158bc Use existing connections for blocking slotmap updates (valkey-io#199)
969a8c546 Fix dependency issue with RDMA (valkey-io#201)

git-subtree-dir: deps/libvalkey
git-subtree-split: b012f8e85a9cc2c68bc2be982a4f6545c15042f0

Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
bjosv added a commit to bjosv/valkey that referenced this pull request Aug 21, 2025
Squashed 'deps/libvalkey/' changes from abcd27fbf..b012f8e85

b012f8e85 Release 0.2.1
9e10acbf7 Fix duplicate Acks for RDMA events. (valkey-io#229)
1eadedf48 Remove the unused valDup API from dict
a449f0ea1 Don't expose internal functions in shared libraries (valkey-io#205)
178e350c7 Cluster code cleanup (valkey-io#216)
4020396c8 Fix `unused-parameter` warning when building with `NDEBUG` (valkey-io#212)
99aa158bc Use existing connections for blocking slotmap updates (valkey-io#199)
969a8c546 Fix dependency issue with RDMA (valkey-io#201)
...

git-subtree-dir: deps/libvalkey
git-subtree-split: b012f8e85a9cc2c68bc2be982a4f6545c15042f0

Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
bjosv added a commit to bjosv/valkey that referenced this pull request Aug 21, 2025
Squashed 'deps/libvalkey/' changes from abcd27fbf..b012f8e85

b012f8e85 Release 0.2.1
9e10acbf7 Fix duplicate Acks for RDMA events. (valkey-io#229)
1eadedf48 Remove the unused valDup API from dict
a449f0ea1 Don't expose internal functions in shared libraries (valkey-io#205)
178e350c7 Cluster code cleanup (valkey-io#216)
4020396c8 Fix `unused-parameter` warning when building with `NDEBUG` (valkey-io#212)
99aa158bc Use existing connections for blocking slotmap updates (valkey-io#199)
969a8c546 Fix dependency issue with RDMA (valkey-io#201)
...

git-subtree-dir: deps/libvalkey
git-subtree-split: b012f8e85a9cc2c68bc2be982a4f6545c15042f0

Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
zuiderkwast pushed a commit that referenced this pull request Aug 21, 2025
Squashed 'deps/libvalkey/' changes from abcd27fbf..b012f8e85

b012f8e85 Release 0.2.1
9e10acbf7 Fix duplicate Acks for RDMA events. (#229)
1eadedf48 Remove the unused valDup API from dict
a449f0ea1 Don't expose internal functions in shared libraries (#205)
178e350c7 Cluster code cleanup (#216)
4020396c8 Fix `unused-parameter` warning when building with `NDEBUG` (#212)
99aa158bc Use existing connections for blocking slotmap updates (#199)
969a8c546 Fix dependency issue with RDMA (#201)
...

git-subtree-dir: deps/libvalkey
git-subtree-split: b012f8e85a9cc2c68bc2be982a4f6545c15042f0

Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
rjd15372 pushed a commit to rjd15372/valkey that referenced this pull request Sep 19, 2025
Squashed 'deps/libvalkey/' changes from abcd27fbf..b012f8e85

b012f8e85 Release 0.2.1
9e10acbf7 Fix duplicate Acks for RDMA events. (valkey-io#229)
1eadedf48 Remove the unused valDup API from dict
a449f0ea1 Don't expose internal functions in shared libraries (valkey-io#205)
178e350c7 Cluster code cleanup (valkey-io#216)
4020396c8 Fix `unused-parameter` warning when building with `NDEBUG` (valkey-io#212)
99aa158bc Use existing connections for blocking slotmap updates (valkey-io#199)
969a8c546 Fix dependency issue with RDMA (valkey-io#201)
...

git-subtree-dir: deps/libvalkey
git-subtree-split: b012f8e85a9cc2c68bc2be982a4f6545c15042f0

Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
rjd15372 pushed a commit that referenced this pull request Sep 23, 2025
Squashed 'deps/libvalkey/' changes from abcd27fbf..b012f8e85

b012f8e85 Release 0.2.1
9e10acbf7 Fix duplicate Acks for RDMA events. (#229)
1eadedf48 Remove the unused valDup API from dict
a449f0ea1 Don't expose internal functions in shared libraries (#205)
178e350c7 Cluster code cleanup (#216)
4020396c8 Fix `unused-parameter` warning when building with `NDEBUG` (#212)
99aa158bc Use existing connections for blocking slotmap updates (#199)
969a8c546 Fix dependency issue with RDMA (#201)
...

git-subtree-dir: deps/libvalkey
git-subtree-split: b012f8e85a9cc2c68bc2be982a4f6545c15042f0

Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
hpatro pushed a commit to hpatro/valkey that referenced this pull request Oct 3, 2025
Squashed 'deps/libvalkey/' changes from abcd27fbf..b012f8e85

b012f8e85 Release 0.2.1
9e10acbf7 Fix duplicate Acks for RDMA events. (valkey-io#229)
1eadedf48 Remove the unused valDup API from dict
a449f0ea1 Don't expose internal functions in shared libraries (valkey-io#205)
178e350c7 Cluster code cleanup (valkey-io#216)
4020396c8 Fix `unused-parameter` warning when building with `NDEBUG` (valkey-io#212)
99aa158bc Use existing connections for blocking slotmap updates (valkey-io#199)
969a8c546 Fix dependency issue with RDMA (valkey-io#201)
...

git-subtree-dir: deps/libvalkey
git-subtree-split: b012f8e85a9cc2c68bc2be982a4f6545c15042f0

Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
Signed-off-by: Harkrishn Patro <harkrisp@amazon.com>
@roshkhatri

Copy link
Copy Markdown
Member

@zuiderkwast Need to back port this to 7.2 too

@zuiderkwast

Copy link
Copy Markdown
Contributor

Isn't it a new feature? We're not supposed to add new features in a patch version.

... or can it be assumed that this is implicitly part of the rebranding?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes This issue should get a line item in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tests for valkey-cli -u URI Rename connection scheme from redis:// to valkey:// .

7 participants