Skip to content

fix: flush *collection* keys on collection cache flush#1845

Open
epipav wants to merge 1 commit intomainfrom
fix/partial-collection-cache-flush-missing-keys
Open

fix: flush *collection* keys on collection cache flush#1845
epipav wants to merge 1 commit intomainfrom
fix/partial-collection-cache-flush-missing-keys

Conversation

@epipav
Copy link
Copy Markdown
Collaborator

@epipav epipav commented Apr 16, 2026

No description provided.

Signed-off-by: anilb <epipav@gmail.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the production “partial cache flush” GitHub Actions workflow so that running a collection flush also clears Redis keys related to collection caching, helping prevent stale collection-related data after a collection-level invalidation.

Changes:

  • After flushing all project-related cache entries for projects in a collection, additionally delete Redis keys matching *collection*.
  • Adds logging to indicate collection-key flushing is occurring.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +139 to +141
echo "Flushing collection cache keys matching *collection*"
kubectl exec -i redis-client -n insights -- \
sh -c "redis-cli -h redis-svc -a \"$REDIS_PASS\" --scan --pattern \"*collection*\" 2>/dev/null | xargs -r redis-cli -h redis-svc -a \"$REDIS_PASS\" DEL 2>/dev/null"
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This SCAN | xargs | DEL pipeline can silently succeed while deleting nothing if the SCAN fails (e.g., auth/connection issues), because stderr is redirected to /dev/null and the shell won’t propagate earlier pipeline failures. Also, if many keys match, a single xargs invocation can exceed the max command length. Consider enabling pipefail / checking exit codes and batching xargs (e.g., limit keys per DEL call) so failures are surfaced and large invalidations are reliable.

Copilot uses AI. Check for mistakes.
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

Successfully merging this pull request may close these issues.

3 participants