Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@YaacovHazan
Copy link
Collaborator

  • add new command line argument, '--resp', to send HELLO command
    at the begining of a connection to set the RESP mode: 2 or 3.
  • the redis protocol component updated to support the new RESP 3 types.
    exceptional are:
    • Push type: Maybe will be added on next phase, but need to understand better
      how and what does it mean to benchmark Redis with push commands.
    • Streamed strings & Streamed aggregated: Currently not used by Redis.

yaacov Hazan added 2 commits June 21, 2022 20:12
- add new command line argument, '--resp', to send HELLO command
  at the begining of a connection to set the RESP mode: 2 or 3.
- the redis protocol component updated to support the new RESP 3 types.
  exceptional are:
  - Push type: Maybe will be added on next phase, but need to understand better
    how and what does it mean to benchmark Redis with push commands.
  - Streamed strings & Streamed aggregated: Currently not used by Redis.
- remove unused set_authentication() & set_select_db()
- unite all the setup state enums of aute, db selection, cluster slots
  and the new hello to one setup_state enum, as all of them have the same
  states of none, sent and done.
@YaacovHazan YaacovHazan requested a review from yossigo June 21, 2022 18:00
{ "port", 1, 0, 'p' },
{ "unix-socket", 1, 0, 'S' },
{ "protocol", 1, 0, 'P' },
{ "resp", 1, 0, o_resp },
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you consider extending --protocol instead of adding another flag?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, but for me, it seems more internal configuration under the Redis protocol. and for backport compatibility, we probably need to add another 2 options (redis-resp2, redis-resp3) as the existing one refers to not set resp version at all.

protocol.cpp Outdated
Comment on lines 266 to 268
if (conf == PROTOCOL_CONF_RESP2 || conf == PROTOCOL_CONF_RESP3) {
m_resp3 = conf == PROTOCOL_CONF_RESP3;
size = evbuffer_add_printf(m_write_buf,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to maintain a backwards compatible mode where we don't send HELLO and we assume we're using RESP2? Without it, we'd lose compatibility with Redis <6.0.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure I got it. In the current implementation if the user doesn't add --resp he will get the old behavior (will not get into this piece of code).

return size;
}

bool redis_protocol::aggregate_type(char c) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if these additional branches are going to have some measurable impact on performance, being executed in tight loops. If that's the case, maybe we'd want to subclass redis_protocol into V2 and V3 instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well not sore it is noticeable and that simple benchmark (of memtier-benchmark) will show us something.
regarding your suggestion to subclass it, do you mean that V2 will not have the impact on the performance as V3?
@filipecosta90 WDYT about this performance concern?

@YaacovHazan YaacovHazan linked an issue Jul 10, 2022 that may be closed by this pull request
- change config->protocol to be one of the PROTOCOL_TYPE enum (instead of char *)
- use --protocol to set resp2 or resp3 instead of --resp
@YaacovHazan YaacovHazan merged commit 1d5ac99 into redis:master Jul 28, 2022
@YaacovHazan YaacovHazan deleted the support-resp-3 branch July 28, 2022 16:31
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.

RESP3 support

2 participants