Make ClickHouse sync write buffer compatible with Redis 6
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
- On your local environment downgrade the Redis version to 6.0. If you are using
asdf
this can be achieved by:- Change gdk
.tool_versions
of redis to6.0.0
- Change gitlab folder
.tool_versions
redis to6.0.0
- Rename or delete
PATH_TO_GDK/redis/dump.rdb
so redis 6 does not try to load the db from the newer version - run
asdf_install
. - OPTIONAL run
asdf current
and check if redis version is set to 6.0.0 on gitlab folder.
- Change gdk
- 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 runningClickHouse::WriteBuffer.pop('anything', 1)
- Checkout to this branch and repeat step 2, no errors should happen.
Edited by Felipe Cardozo
Merge request reports
Activity
Please register or sign in to reply