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

Deprecated the zrangebyscore command #928

Open
rizrei opened this issue Feb 7, 2024 · 0 comments
Open

Deprecated the zrangebyscore command #928

rizrei opened this issue Feb 7, 2024 · 0 comments

Comments

@rizrei
Copy link

rizrei commented Feb 7, 2024

In our project, we decided to try to use the delayed_sidekiq strategy and encountered the following problems:

  1. Create User records with the delayed_sidekiq strategy

    Chewy.strategy(:delayed_sidekiq) { 3.times { |i| FactoryBot.create(:user, email: "delayed_sidekiq#{i}@mail.com") } }

    The following error appears in the sidekiq logs:

    [sidekiq#5788] Redis has deprecated the `zrangebyscore` command, called at ["/Users/r1zrei/.rvm/gems/ruby-2.7.2@product-x/gems/chewy-7.3.3/lib/chewy/ strategy/delayed_sidekiq/worker.rb:14:in `block in perform'"]

    redis doc
    I replaced this line lib/chewy/strategy/delayed_sidekiq/worker.rb:14 with

    timechunk_keys = redis.zrange(timechunks_key, -1, score, byscore: true)
  2. To store data we use a postgres database, where primary_key is in uuid format
    lib/chewy/strategy/delayed_sidekiq/worker.rb:47 in this place the id is converted to integer, as a result, importing new index does not work

    "d2ab25ce-3ec4-49f9-8e53-78665ac0a568".to_i # 0
    UsersIndex.import 0
  • Chewy 7.3.3
  • Redis 6.2.5
  • Elasticsearch 7.9.2
  • Ruby 2.7.2
  • Rails 6.1.7
  • Sudekiq 7.2.0
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

1 participant