You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -409,6 +410,24 @@ See [internal/foundation/config/testdata/validConfigMapConfig.yaml](internal/fou
409
410
-**Dependency Injection**: Centralized dependency creation via `internal/app/` eliminates boilerplate from commands
410
411
-**Testability**: All layers use interfaces for external dependencies, enabling comprehensive unit testing
411
412
-**Clean Commands**: Commands are thin (50-100 lines) and focused on business logic
413
+
-**Restore Lock Protection**: Prevents parallel restore operations that could corrupt data
414
+
415
+
### Restore Lock Protection
416
+
417
+
The CLI prevents parallel restore operations that could corrupt data by using Kubernetes annotations on Deployments and StatefulSets. When a restore starts:
418
+
419
+
1. The CLI checks for existing restore locks before proceeding
420
+
2. If another restore is in progress for the same datastore, the operation is blocked
421
+
3. Mutually exclusive datastores are also protected (e.g., Stackgraph and Settings cannot restore simultaneously because they share HBase data)
422
+
423
+
If a restore operation is interrupted or fails, the lock annotations may remain. To manually remove a stuck lock:
exitWithError(errors.New("commands that interact with Minio require SUSE Observability to be deployed with .Values.global.backup.enabled=true"), os.Stderr)
23
+
appCtx.Logger.Errorf("commands that interact with Minio require SUSE Observability to be deployed with .Values.global.backup.enabled=true")
24
+
os.Exit(1)
25
25
}
26
26
iferr:=runFunc(appCtx); err!=nil {
27
-
exitWithError(err, os.Stderr)
27
+
appCtx.Logger.Errorf(err.Error())
28
+
os.Exit(1)
28
29
}
29
30
}
30
-
31
-
// ExitWithError prints an error message to the writer and exits with status code 1.
32
-
// This is a helper function to avoid repeating error handling code in commands.
0 commit comments