-
Notifications
You must be signed in to change notification settings - Fork 0
STAC-24078: Handle parallel execution #13
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements a restore lock mechanism to prevent parallel restore operations that could corrupt data. The solution uses Kubernetes annotations on Deployments and StatefulSets to coordinate restore operations and implements mutual exclusion between datastores that share underlying data (stackgraph and settings both use HBase).
Changes:
- Added restore lock package with conflict detection and mutual exclusion support
- Integrated lock acquisition/release into scale down/up workflow with automatic cleanup on failure
- Updated all restore commands to use the new locking mechanism
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/orchestration/restorelock/datastore.go | Defines datastore identifiers and mutual exclusion groups |
| internal/orchestration/restorelock/lock.go | Core lock management logic with conflict checking |
| internal/orchestration/restorelock/lock_test.go | Comprehensive tests for lock functionality |
| internal/orchestration/restorelock/datastore_test.go | Tests for datastore grouping and mutual exclusion |
| internal/orchestration/scale/scale.go | New ScaleDownWithLock and ScaleUpAndReleaseLock wrapper functions |
| internal/clients/k8s/client.go | K8s client methods for managing restore lock annotations |
| internal/foundation/config/config.go | Datastore constants and method to retrieve all selectors |
| cmd/*/restore.go | Updated restore commands to use ScaleDownWithLock |
| cmd/*/check_and_finalize.go | Updated finalization to use ScaleUpAndReleaseLock |
| internal/foundation/logger/logger.go | Added emoji prefixes for better visual distinction |
| internal/foundation/logger/logger_test.go | Updated tests for emoji changes |
| cmd/cmdutils/common.go | Simplified error handling using logger |
| README.md | Added restore lock protection documentation |
| ARCHITECTURE.md | Documented restore lock pattern in architecture guide |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Output
Mutually exclusive stackgraph and settings restores
Running two Stackgraph restores