Skip to content

Add 'extended-redis-compatibility' config#306

Merged
zuiderkwast merged 7 commits into
valkey-io:unstablefrom
zuiderkwast:redis-compatility-knob
Apr 18, 2024
Merged

Add 'extended-redis-compatibility' config#306
zuiderkwast merged 7 commits into
valkey-io:unstablefrom
zuiderkwast:redis-compatility-knob

Conversation

@zuiderkwast

@zuiderkwast zuiderkwast commented Apr 12, 2024

Copy link
Copy Markdown
Contributor

New config 'extended-redis-compatibility' (yes/no) default no

  • When yes:

    • Use "Redis" in the following error replies:
      • -LOADING Redis is loading the dataset in memory
      • -BUSY Redis is busy...
      • -MISCONF Redis is configured to...
    • Use === REDIS BUG REPORT in the crash log delimiters (START and END).
    • The HELLO command returns "server" => "redis" and "version" => "7.2.4" (our Redis OSS compatibility version).
    • The INFO field for mode is called "redis_mode".
  • When no:

    • Use "Valkey" instead of "Redis" in the mentioned errors and crash log delimiters.
    • The HELLO command returns "server" => "valkey" and the Valkey version for "version".
    • The INFO field for mode is called "server_mode".
  • Documentation added in valkey.conf:

    Valkey is largely compatible with Redis OSS, apart from a few cases where
    Redis OSS compatibility mode makes Valkey pretend to be Redis. Enable this
    only if you have problems with tools or clients. This is a temporary
    configuration added in Valkey 8.0 and is scheduled to have no effect in Valkey
    9.0 and be completely removed in Valkey 10.0.

  • A test case for the config is added. It is designed to fail if the config is not deprecated (has no effect) in Valkey 9 and deleted in Valkey 10.

  • Other test cases are adjusted to work regardless of this config.

Fixes #274
Fixes #61

Comment thread valkey.conf Outdated
@madolson madolson added major-decision-pending Major decision pending by TSC team major-decision-approved Major decision approved by TSC team and removed major-decision-pending Major decision pending by TSC team labels Apr 15, 2024
Add the config, including docs as comments in valkey.conf.

Define SERVER_TITLE "Valkey" in version.h.

Make the errors -LOADING, -BUSY and -MISCONF depend on the config.

Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
… config

Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
This commit includes a test that will remind us to delete the temporary
config when the time comes.

Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
@zuiderkwast zuiderkwast force-pushed the redis-compatility-knob branch from 161b6d0 to 82b95c8 Compare April 17, 2024 12:58
Explain the plans for removal in future versions.

Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Add the config, including docs as comments in valkey.conf.

Define SERVER_TITLE "Valkey" in version.h.

Make the errors -LOADING, -BUSY and -MISCONF depend on the config.

Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
@zuiderkwast zuiderkwast force-pushed the redis-compatility-knob branch from 82b95c8 to 8c26e98 Compare April 17, 2024 12:59
@zuiderkwast zuiderkwast added release-notes This issue should get a line item in the release notes breaking-change Indicates a possible backwards incompatible change labels Apr 18, 2024
@zuiderkwast zuiderkwast merged commit 9e2b783 into valkey-io:unstable Apr 18, 2024
@zuiderkwast zuiderkwast deleted the redis-compatility-knob branch April 18, 2024 12:10
PatrickJS pushed a commit to PatrickJS/placeholderkv that referenced this pull request Apr 24, 2024
New config 'extended-redis-compatibility' (yes/no) default no

* When yes:
  * Use "Redis" in the following error replies:
    - `-LOADING Redis is loading the dataset in memory`
    - `-BUSY Redis is busy`...
    - `-MISCONF Redis is configured to`...
* Use `=== REDIS BUG REPORT` in the crash log delimiters (START and
END).
* The HELLO command returns `"server" => "redis"` and `"version" =>
"7.2.4"` (our Redis OSS compatibility version).
  * The INFO field for mode is called `"redis_mode"`.
* When no:
* Use "Valkey" instead of "Redis" in the mentioned errors and crash log
delimiters.
* The HELLO command returns `"server" => "valkey"` and the Valkey
version for `"version"`.
  * The INFO field for mode is called `"server_mode"`.

* Documentation added in valkey.conf:

> Valkey is largely compatible with Redis OSS, apart from a few cases
where
> Redis OSS compatibility mode makes Valkey pretend to be Redis. Enable
this
  > only if you have problems with tools or clients. This is a temporary
> configuration added in Valkey 8.0 and is scheduled to have no effect
in Valkey
  > 9.0 and be completely removed in Valkey 10.0.

* A test case for the config is added. It is designed to fail if the
config is not deprecated (has no effect) in Valkey 9 and deleted in
Valkey 10.

* Other test cases are adjusted to work regardless of this config.

Fixes valkey-io#274
Fixes valkey-io#61

---------

Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Comment thread src/server.c
Comment on lines 5608 to 5610
"redis_git_sha1:%s\r\n", serverGitSHA1(),
"redis_git_dirty:%i\r\n", strtol(serverGitDirty(),NULL,10) > 0,
"redis_build_id:%s\r\n", serverBuildIdString(),

@enjoy-binbin enjoy-binbin Jun 30, 2026

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.

@zuiderkwast

Do you remember why we didn't deal with these fields (redis_git_sha1/redis_git_dirty/redis_build_id)? I thought we did.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You mean why we didn't rename them to valkey or server?

I think some of maintainers were worried that it would break some tools or clients. I'm not sure. I want to get rid of these names some time. Maybe in 10.0 we can do it?

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.

Yes, why wasn't server_git_sha1 added in the same way when server.extended_redis_compat was used?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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 see #1736 is changing without server.extended_redis_compat, i think it would be great if it they are changeing together. I feel like now we don't have chance to get rid of it.

"%s_mode:", (server.extended_redis_compat ? "redis" : "server"),
            "%s\r\n", mode,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm OK with it. I don't know if others will agree... @valkey-io/core-team WDYT?

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

Labels

breaking-change Indicates a possible backwards incompatible change major-decision-approved Major decision approved by TSC team 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.

[NEW] Redis-compatibility mode The reply from HELLO

3 participants