The GitHub Actions job "Lint PR" on kvrocks.git/patch-2 has failed.
Run started by GitHub user i18nsite (triggered by i18nsite).

Head commit for run:
d5981a9beeb729a8808ddc8cac1d0557a4e5c488 / i18n.site <[email protected]>
fix sentinel resp3 support

fix https://github.com/apache/kvrocks/issues/3285
[English](#en) / [中文](#cn)

<a id="en"></a>

## Root Cause Analysis

The issue occurs because Kvrocks reports its Redis version as `4.0.0` (defined 
in `src/server/server.h:61`), while RESP3 protocol was introduced in Redis 6.0. 

**Most Redis client libraries perform version checking before attempting to use 
RESP3.** When clients see a server version below 6.0, they skip the `HELLO 3` 
command entirely and default to RESP2, even if the server actually supports 
RESP3.

### How Redis Clients Check Version

1. Client connects to Redis/Kvrocks
2. Client checks server version (via `INFO` or `HELLO` response)
3. **If version < 6.0**: Client assumes RESP3 is not supported and uses RESP2
4. **If version >= 6.0**: Client sends `HELLO 3` to negotiate RESP3

### Why This Affects Sentinel Connections

When connecting through Redis Sentinel:
- Sentinel provides the master address to the client
- Client connects to the master and checks its version
- If Kvrocks reports version `4.0.0`, the client library won't attempt RESP3
- This happens regardless of the `resp3-enabled` configuration

## Solution

**Update `REDIS_VERSION` from `"4.0.0"` to `"7.0.0"`** in 
[src/server/server.h](cci:7://file:///Users/z/git/kvrocks/kvrocks/src/server/server.h:0:0-0:0).

### Why 7.0.0 Instead of 6.0.0?

While RESP3 was introduced in Redis 6.0, **Redis 7.0 is the first version with 
full, production-ready RESP3 support**. Some client libraries may have 
additional checks or optimizations specifically for Redis 7.0+. Using version 
`7.0.0` ensures maximum compatibility with all modern Redis clients.

### Code Change Required

```cpp
// src/server/server.h:61
-constexpr const char *REDIS_VERSION = "4.0.0";
+constexpr const char *REDIS_VERSION = "7.0.0";

Report URL: https://github.com/apache/kvrocks/actions/runs/19847305458

With regards,
GitHub Actions via GitBox

Reply via email to