feat(cache): add Redis single-key operations support for ElastiCache Serverless#61
feat(cache): add Redis single-key operations support for ElastiCache Serverless#61busla wants to merge 1 commit into
Conversation
…Serverless Add REDIS_SINGLE_KEY_OPS configuration option to force single-key Redis operations even in non-cluster mode. This is required for AWS ElastiCache Serverless which internally shards data but doesn't support the Redis Cluster protocol, causing CROSSSLOT errors with batch operations. - Add REDIS_SINGLE_KEY_OPS env var (default: false) in cacheConfig.ts - Update batchDeleteKeys() in redisUtils.ts to use single-key ops when enabled - Add 'single-key-ops' mode logging for observability 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis pull request introduces Redis operational refinement by adding a new configuration flag REDIS_SINGLE_KEY_OPS and updating deletion logic in redisUtils.ts to support three distinct modes: cluster, single-key-ops, and single-node. Build artifacts are now ignored via .gitignore updates. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Recreating as draft PR targeting upstream |
Summary
Adds a new
REDIS_SINGLE_KEY_OPSconfiguration option to support AWS ElastiCache Serverless (Valkey 8.1) which internally shards data but doesn't expose the Redis Cluster protocol.Problem
USE_REDIS_CLUSTER=falsecauses CROSSSLOT errors on batch operationsUSE_REDIS_CLUSTER=truefails withClusterAllFailedErrorbecause ElastiCache Serverless doesn't supportCLUSTER NODES/CLUSTER SLOTScommandsSolution
REDIS_SINGLE_KEY_OPSenv var forces single-key operations without requiring cluster clientUSE_REDIS_CLUSTER=false+REDIS_SINGLE_KEY_OPS=trueChange Type
Testing
USE_REDIS=true,USE_REDIS_CLUSTER=false,REDIS_SINGLE_KEY_OPS=truesingle-key-opsmode indicatorTechnical Details
Files Changed:
packages/api/src/cache/cacheConfig.ts- AddedREDIS_SINGLE_KEY_OPSconfigurationpackages/api/src/cache/redisUtils.ts- UpdatedbatchDeleteKeys()to respect new optionConfiguration:
# For AWS ElastiCache Serverless USE_REDIS=true USE_REDIS_CLUSTER=false REDIS_SINGLE_KEY_OPS=true REDIS_URI=rediss://your-elasticache-endpoint:6379Summary by CodeRabbit
Chores
Improvements
✏️ Tip: You can customize this high-level summary in your review settings.