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

Extend API to support Sidekiq #216

Open
mperham opened this issue Apr 1, 2024 · 7 comments
Open

Extend API to support Sidekiq #216

mperham opened this issue Apr 1, 2024 · 7 comments
Assignees
Labels
API enhancement New feature or request

Comments

@mperham
Copy link

mperham commented Apr 1, 2024

I'm trying to use Garnet from Ruby (I'd love to see Sidekiq running on Garnet!) and find myself blocked by case sensitivity.

% irb
irb(main):001> require "redis-client"
=> true
irb(main):002> r = RedisClient.new
=> #<RedisClient redis://localhost:6379>
irb(main):003> r.call("llen", "foo")
/Users/mperham/.gem/ruby/3.2.0/gems/redis-client-0.21.1/lib/redis_client/connection_mixin.rb:71:in `call_pipelined': ERR unknown command (redis://localhost:6379) (RedisClient::CommandError)
	from /Users/mperham/.gem/ruby/3.2.0/gems/redis-client-0.21.1/lib/redis_client.rb:771:in `block in connect'
	from /Users/mperham/.gem/ruby/3.2.0/gems/redis-client-0.21.1/lib/redis_client/middlewares.rb:16:in `call'
	from /Users/mperham/.gem/ruby/3.2.0/gems/redis-client-0.21.1/lib/redis_client.rb:770:in `connect'
	from /Users/mperham/.gem/ruby/3.2.0/gems/redis-client-0.21.1/lib/redis_client.rb:732:in `raw_connection'
	from /Users/mperham/.gem/ruby/3.2.0/gems/redis-client-0.21.1/lib/redis_client.rb:697:in `ensure_connected'
	from /Users/mperham/.gem/ruby/3.2.0/gems/redis-client-0.21.1/lib/redis_client.rb:277:in `call'
	from (irb):3:in `<main>'
	from /Users/mperham/.gem/ruby/3.2.0/gems/irb-1.12.0/exe/irb:9:in `<top (required)>'
	from /Users/mperham/.gem/ruby/3.2.0/bin/irb:25:in `load'
	from /Users/mperham/.gem/ruby/3.2.0/bin/irb:25:in `<main>'
irb(main):004> r.call("LLEN", "foo")
=> 0

Using v1.0.2.

07::46::01 info: GarnetServer[0] Garnet 1.0.2 64 bit; standalone mode; Port: 6379
07::46::01 info: ArgParser[0] Configuration import from embedded resource succeeded. Path: defaults.conf.
07::46::01 info: ArgParser[0] Configuration file path not specified. Using default values with command-line switches.
07::46::01 info: Options[0] [Store] Using page size of 32m
07::46::01 info: Options[0] [Store] Using log memory size of 16g
@lmaas lmaas added the parser label Apr 1, 2024
@lmaas lmaas self-assigned this Apr 1, 2024
@lmaas
Copy link
Contributor

lmaas commented Apr 1, 2024

Thank you for bringing this issue to our attention. What is happening here is that redis-client is issuing the RESP3 handshake (HELLO 3) during its initial connection to Garnet. However, because Garnet currently does not support RESP3, this results in an error response of ERR unknown command.

You should be able to circumvent this issue by using the redis gem instead, which should work with Garnet:

irb(main):001:0> require 'redis'
=> true
irb(main):002:0>  r = Redis.new
=> #<Redis client v5.1.0 for redis://localhost:6379>
irb(main):003:0> r.call("llen", "foo")
=> 0

@lmaas lmaas closed this as completed Apr 1, 2024
@mperham
Copy link
Author

mperham commented Apr 2, 2024

Sidekiq 7 requires RESP3 because of the better type support. Does Garnet plan to support it? I don't see any mention on the public roadmap:

https://microsoft.github.io/garnet/docs/welcome/roadmap

@mperham
Copy link
Author

mperham commented Apr 2, 2024

...and the Redis 6.2 command set, things like BITFIELD_RO are used for queries. I'm not clear on which commands Garnet might be missing vs Redis 6.2.

@mperham
Copy link
Author

mperham commented Apr 2, 2024

Ah, it looks like Garnet doesn't support blocking list operations so it's a non-starter for job systems. I hope this will change in the future.

@badrishc
Copy link
Contributor

badrishc commented Apr 4, 2024

Which specific blocking list APIs do you need to implement a job system? We can prioritize accordingly, this isn't very hard to add - we just didn't receive a use case for it yet.

@badrishc badrishc reopened this Apr 4, 2024
@badrishc
Copy link
Contributor

badrishc commented Apr 4, 2024

For Sidekiq to work correctly - if you can provide us a list of missing APIs that will be quite useful.

@mperham
Copy link
Author

mperham commented Apr 4, 2024

brpop, blmove and these:

https://github.com/sidekiq/sidekiq/blob/cee6f0eb36fe71a4300ccd715c0cf5bd2ab1d9d0/lib/sidekiq/redis_client_adapter.rb#L27-L32

@TalZaccai TalZaccai assigned TalZaccai and unassigned lmaas Apr 23, 2024
@TalZaccai TalZaccai changed the title Commands are case sensitive Extend API to support Sidekiq Apr 23, 2024
@TalZaccai TalZaccai added API enhancement New feature or request and removed parser labels Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants