Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for example of commands for all RESP3 types #15

Closed
mgravell opened this issue Mar 14, 2023 · 5 comments
Closed

Request for example of commands for all RESP3 types #15

mgravell opened this issue Mar 14, 2023 · 5 comments

Comments

@mgravell
Copy link

mgravell commented Mar 14, 2023

I'm currently implementing RESP3 in a library; I'm paranoid - I don't trust any code that I haven't seen working; it would really help if there were well-known ways of reproducing all of the expected types using vanilla redis; for example:

  • verbatim string: latency doctor
  • map: hgetall
  • set: smembers
  • push: pub/sub

but: I have not yet managed to confirm:

  • boolean (tried: sismember, returns integer)
  • double (tried: incrbyfloat, returns bulk string)
  • blob error
  • big integer
  • attribute metadata
  • streamed bulk-string types
  • streamed aggregates

Are there inbuilt APIs that expose these remaining gaps?

@mgravell mgravell changed the title Request for example of commands for all types Request for example of commands for all RESP3 types Mar 14, 2023
@itamarhaber
Copy link
Member

itamarhaber commented Mar 14, 2023

@mgravell for simple sanity checks, I recommend the built-in DEBUG PROTOCOL (https://github.com/redis/redis/blob/unstable/src/debug.c#L442). Also, mind the new config that disables debug by default ;)

@mgravell
Copy link
Author

That's helpful. Anything that does string/array streaming @itamarhaber ?

@itamarhaber
Copy link
Member

Nope - although these are in the spec, they were never implemented in Redis to this point.

@mgravell
Copy link
Author

That's brilliant, thanks. Possibly worth a mention of debug protocol on the spec page, but: ta

@itamarhaber
Copy link
Member

I'm so dumb I should be put in a home. Use Lua Luke:

EVAL "return { double = 6.379e-5 }" 0

Ref: https://redis.io/docs/manual/programmability/lua-api/#lua-to-resp3-type-conversion

NickCraver added a commit to StackExchange/StackExchange.Redis that referenced this issue Sep 7, 2023
Overall changes:
- [x] introduce `Resp2Type` and `Resp3Type` shims (`Resp2Type` has reduced types); existing code using `[Obsolete] Type` uses `Resp2Type` for minimal code impact
- [x] mark existing `Type` as `[Obsolete]`, and proxy to `Resp2Type` for compat
- [x] deal with null handling differences
- [x] deal with `Boolean`, which works very differently (`t`/`f` instead of `1`/`0`)
- [x] deal with `[+|-]{inf|nan}` when parsing doubles (explicitly called out in the RESP3 spec)
- [x] parse new tokens
- [x] `HELLO` handshake
  - [x] core message and result handling
  - [x] validation and fallback
- [x] prove all return types (see: redis/redis-specifications#15)
- [x] <strike>streamed RESP3</strike> omitting; not implemented by server; can revisit
- [x] deal with pub/sub differences
  - [x] check routing of publish etc
  - [x] check re-wire of subscription if failed
  - [x] check receive notifications
  - [x] connection management (i.e. not to spin up in resp3)
  - [x] connection fallback spinup (i.e. if we were trying resp3 but failed)
- [x] other
  - [x] [undocumented RESP3 delta](redis/redis-doc#2513)
  - [x] run core tests in both RESP2 and RESP3
  - [x] compensate for tests that expect separate subscription connections

Co-authored-by: Nick Craver <[email protected]>
Co-authored-by: Nick Craver <[email protected]>
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

No branches or pull requests

2 participants