-
Notifications
You must be signed in to change notification settings - Fork 18
feat: add deployment_id support for multi-deployment #512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Review - Deployment ID Support for Multi-DeploymentThis PR implements a clean solution for enabling multiple Outpost deployments to share Redis infrastructure. Overall well-designed and tested. Strengths
Critical Issues1. Panic on Redis Connection Failure (HIGH PRIORITY) The panic() call will crash the application if Redis is temporarily unavailable during startup. This should return an error instead for graceful handling. 2. Missing Input Validation (MEDIUM PRIORITY) No validation exists for DeploymentID format. Special characters like colons, braces, or asterisks could interfere with Redis key patterns or hash tags. Recommend adding validation for alphanumeric, hyphens, and underscores only with reasonable length limits. Minor Suggestions
Performance & SecurityPerformance: Efficient implementation with no extra Redis round trips. Key prefix concatenation is minimal overhead. Security: Good isolation between deployments. Main concern is lack of input validation allowing potential special character injection. Test CoverageExcellent coverage with E2E tests, isolation tests, and backward compatibility tests. Consider adding tests for invalid deployment ID formats once validation is added. RecommendationApprove after fixing the panic issue and adding deployment ID validation. The remaining suggestions can be addressed in follow-up PRs. Great work on this feature! |
PR Review: Add deployment_id Support for Multi-DeploymentSummaryThis PR successfully implements deployment-scoped Redis keys to enable multiple Outpost deployments to share the same Redis infrastructure while maintaining complete data isolation. The implementation is well-designed, thoroughly tested, and follows good practices. ✅ Strengths1. Excellent Architecture
2. Comprehensive Test Coverage
3. Proper Error Handling
4. Good Documentation
🔍 Observations & Suggestions1. Minor: Alert Store Parameter Inconsistency // alert/monitor.go:130
alertMonitor.store = NewRedisAlertStore(redisClient, alertMonitor.deploymentID)
// vs. entity store pattern:
entityStore := models.NewEntityStore(redisClient,
models.WithDeploymentID(cfg.DeploymentID),
)Suggestion: Consider making 2. Config Validation: Character Restrictions Question: Have you considered whether this needs to allow additional characters (dots, colons) for compatibility with existing deployment naming schemes? The current restrictions seem reasonable, but worth confirming with your deployment workflows. 3. RSMQ Namespace Approach // internal/deliverymq/retry.go:29-32
namespace := "rsmq"
if deploymentID != "" {
namespace = fmt.Sprintf("deployment:%s:rsmq", deploymentID)
}This is clean and avoids touching queue name logic. ✅ 4. Test Infrastructure Enhancement RUN?=This will improve developer workflow. 🛡️ Security Considerations
⚡ Performance Considerations
🐛 Potential IssuesNone identified. The implementation is solid. 📝 Minor Nits
// MIGRATION LOCK BEHAVIOR:
// 1. One node acquires the lock...
// 2. Other nodes fail with lock errors...The indentation changed from spaces to numbered list indentation. While this improves readability, it appears to be unrelated formatting cleanup in the diff.
✅ Test Coverage AssessmentExcellent coverage:
🎯 RecommendationsBefore Merge:
Post-Merge:
Final Verdict: ✅ APPROVEThis is a well-crafted PR that solves a real multi-tenancy problem with a clean, testable implementation. The code quality is high, test coverage is comprehensive, and the approach is sound for both standalone and Redis Cluster deployments. Great work! 🎉 Review generated with Claude Code |
|
To save precious bytes I'd tend to leave out the |
|
@alexbouchardd updated |
Pull Request Review: Multi-Deployment Support via
|
Summary
Adds
deployment_idconfiguration to enable multiple Outpost deployments to share Redis infrastructure. WhenDEPLOYMENT_IDis set, all Redis keys are prefixed withdeployment:{id}:,ensuring tenants across different deployments never conflict even with identical IDs.
Key Design
Deployment-scoped keys (prefixed when
DEPLOYMENT_IDset):tenant:{TENANT_ID}:*,destination:{DESTINATION_ID}:*alert:{DESTINATION_ID}:consecutive_failuresrsmq:QUEUES,rsmq:deliverymq-retry:*Global keys (never prefixed):
outpostrcoutpost:lockoutpost:migration:*,.outpost:migration:lockPattern:
deployment:dp_001:tenant:{ID}:*when set,tenant:{ID}:*when emptyImplementation
DeploymentIDdeploymentPrefix()methoddeploymentPrefix()methodcfg.DeploymentIDto entity store, alert monitor, and retry schedulerDEPLOYMENT_IDcan skip hash tag migrationdeployment_id: "dp_e2e_test"to verify no regression