Skip to content
Snippets Groups Projects

Make ClickHouse sync write buffer compatible with Redis 6

Merged Felipe Cardozo requested to merge issue_506384_fix_lpop into master

What does this MR do and why?

Customers using Redis 6.0 have multiple errors in the logs related to ClickHouse sync workers. These are happening because when reading from the Redis buffer to write to ClickHouse we are using lpop with an extra limit argument which is not supported by Redis 6.

This MR removes the extra argument and instead uses a Redis pipeline to read the records in batches.

Customers with old redis versions should stop seeing error logs from UsageEvents::DumpWriteBufferCronWorker.

References

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

No changes to the current behavior.

How to set up and validate locally

  1. On your local environment downgrade the Redis version to 6.0. If you are using asdf this can be achieved by:
    1. Change gdk .tool_versions of redis to 6.0.0
    2. Change gitlab folder .tool_versions redis to 6.0.0
    3. Rename or delete PATH_TO_GDK/redis/dump.rdb so redis 6 does not try to load the db from the newer version
    4. run asdf_install.
    5. OPTIONAL run asdf current and check if redis version is set to 6.0.0 on gitlab folder.
  2. Running rspec spec/lib/click_house/write_buffer_spec.rb will raise failures related to compatibility problems. Another way to reproduce this error is opening a rails console and running ClickHouse::WriteBuffer.pop('anything', 1)
  3. Checkout to this branch and repeat step 2, no errors should happen.
Edited by Felipe Cardozo

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading