Skip to content

Batch large pipelined Redis commands

Sylvester Chin requested to merge sc1-fix-batch-large-pipeline into master

What does this MR do and why?

This MR breaks large pipelines in Gitlab::Redis::Cache into batches of 1000.

It uses the same idea as reactive_set_cache's keys.each_slice(1000) { |subset| pipeline.unlink(*subset) }. In Redis, pipelines sizes should be capped since the server holds the responses in memory and huge pipelines could place an unexpectedly large load on the server as seen in the incident issue below.

See https://gitlab.com/gitlab-com/gl-infra/reliability/-/issues/23699. This is CA for gitlab-com/gl-infra/production#14406 (closed).

Does not affect self-managed as it is behind a feature-flag.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Sylvester Chin

Merge request reports