Skip to content

Conversation

@monkey92t
Copy link
Collaborator

@monkey92t monkey92t commented Apr 26, 2021

  1. Support redis RESP3 protocol, can work under RESP2 and RESP3.
  2. If redis-server version >=6.0, RESP3 protocol is enabled by default. Otherwise use RESP2 protocol (redis < 6.0).
  3. Remove test Subscribe __redis__:invalidate, it only works in RESP2 mode(redis6.0+).
  4. $EOF:<40 bytes marker><CR><LF> and *?<CR><LF> that have not been enabled by redis-server have not been implemented for the time being, they will be followed up in the future.

Signed-off-by: monkey <golang@88.com>
redis#1715 (comment)

Signed-off-by: monkey <golang@88.com>
Signed-off-by: monkey <golang@88.com>
Signed-off-by: monkey <golang@88.com>
Signed-off-by: monkey <golang@88.com>
@vmihailenco
Copy link
Collaborator

If redis-server version >=6.0, RESP3 protocol is enabled by default. Otherwise use RESP2 protocol (redis < 6.0).

It looks like the code always uses https://redis.io/commands/hello to switch to RESP3. And HELLO is only available since v6.0.0. So I guess v9 branch

  • does not support Redis < 6.0
  • always uses RESP3

Which is fine - I just want to confirm my understanding.

Signed-off-by: monkey <golang@88.com>
@monkey92t
Copy link
Collaborator Author

monkey92t commented Apr 27, 2021

If redis-server version >=6.0, RESP3 protocol is enabled by default. Otherwise use RESP2 protocol (redis < 6.0).

It looks like the code always uses https://redis.io/commands/hello to switch to RESP3. And HELLO is only available since v6.0.0. So I guess v9 branch

  • does not support Redis < 6.0
  • always uses RESP3

Which is fine - I just want to confirm my understanding.

If conn.HELLO(ctx, 3) fails to execute (redis<6.0), there will be no error, and it will continue to use RESP2 to execute commands.
If redis-server >= 6.0, HELLO is executed successfully and RESP3 is used.

In redis5 or lower version, it can work normally.

@vmihailenco vmihailenco merged commit 8ad0124 into redis:v9 Apr 27, 2021
@vmihailenco
Copy link
Collaborator

Awesome, thanks.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants