Skip to content

Deprecated the zrangebyscore command #928

@rizrei

Description

@rizrei

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions