Repository navigation
Conversation
restore --wipe-pvcs failed reliably in the verify-backup pipeline: - Scaling HBase down used the generic 2 minute pod-termination limit. HDFS and HBase take longer to flush and stop, so the wipe timed out and left the instance half wiped for the next attempt. - After deleting the PVCs, HBase was scaled up and the restore job was created immediately. The job then failed with "NoNode for /hbase/hbaseid" / "no region servers available"; HBase reported itself initialized about 24 seconds later. Give the HBase scale-down its own longer termination timeout and wait for every HBase workload to report its replicas ready before returning. Scale-up is no longer deferred: it now happens explicitly before the readiness wait, and on the error paths after scale-down. Refs StackVista/verify-backup#22 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Looks good overall. CI is green, and verify-backup run 45209648761 passed with --wipe-pvcs on this head. Notes on lines outside the diff:
cmd/stackgraph/restore.go:110:WipePVCsruns before theScaleUpAndReleaseLockdefer is registered. With the new error returns below, a failure leaves the StackGraph-dependent deployments scaled down and the restore lock held.stackgraphv2/restore.goregisters the defer first. Suggest doing the same in v1.hbase.go:88-92: ifdeleteRecursivefails after the scale-down, HBase stays at 0 replicas. Wrap these withscaleUpHBaseAfterErrortoo, like the PVC errors.
Minor: the description still says the e2e run is in progress.
| logger.Println() | ||
| logger.Infof("Scaled up HBase after deleting PVCs") | ||
| if err := scale.ScaleUpFromAnnotations(k8sClient, namespace, hbaseSelector, logger); err != nil { | ||
| return fmt.Errorf("failed to scale up HBase after deleting PVCs: %w", err) |
There was a problem hiding this comment.
This and the readiness timeout below are new error returns. The v1 caller in cmd/stackgraph/restore.go hits them before its scale-up/unlock defer exists (see review body).
| return fmt.Errorf("failed to scale up HBase after deleting PVCs: %w", err) | ||
| } | ||
| // The restore job needs live region servers; starting it during HBase initialization fails with NoNode for /hbase/hbaseid. | ||
| if err := scale.WaitForReady(k8sClient, namespace, hbaseSelector, hbaseReadyTimeout, logger); err != nil { |
There was a problem hiding this comment.
In Mono mode the only workload is the stackgraph statefulset, and its readiness probe is HTTP / on masterinfo. That can pass before /hbase/hbaseid exists, so this wait might not prevent the NoNode failure there. Distributed mode is fine: the RS probe checks clusterId. Has Mono been validated, or should this also check that the znode exists?
| // | ||
| //nolint:revive // Package name "scale" with function "WaitForReady" is intentionally verbose for clarity | ||
| func WaitForReady(k8sClient *k8s.Client, namespace, labelSelector string, readyTimeout time.Duration, log *logger.Logger) error { | ||
| ctx := context.Background() |
There was a problem hiding this comment.
Nit: context.Background() means Ctrl-C won't cancel a wait of up to 15 minutes. WipePVCs already has ctx, so it could be passed through.
| }() | ||
| } | ||
|
|
||
| err = WaitForReady(client, "test-ns", "app.kubernetes.io/name=hbase", 7*time.Second, logger.New(true, false)) |
There was a problem hiding this comment.
Nit: these tests take ~15s of real ticker and timeout waits. Making readinessCheckInterval and podTerminationCheckInterval overridable in tests would speed them up.
- Register the v1 scale-up/unlock defer before wiping PVCs, as v2 does, so a wipe failure no longer leaves deployments down and the lock held. - Scale HBase back up when clearing its Zookeeper nodes fails. - After pod readiness, wait for /hbase/hbaseid in Zookeeper. The Mono readiness probe only checks the master info page, which can pass before HBase has registered. - Pass the command context into WaitForReady so Ctrl-C cancels it. - Poll faster in the new tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Addressed in d1f37d4: v1 now registers the scale-up/unlock defer before |
restore --wipe-pvcsfailed in the verify-backup pipeline for two reasons:NoNode for /hbase/hbaseidbecause HBase was still initializing.This PR gives the HBase scale-down its own longer timeout. Before creating the restore job, it waits for every HBase workload to be ready and for
/hbase/hbaseidto exist in Zookeeper. The znode check covers Mono, whose readiness probe can pass before HBase registers. If the wipe fails part-way, HBase and the StackGraph deployments are scaled back up and the restore lock is released, for both v1 and v2.Validation:
go test ./...and golangci-lint v2.15.0 pass. verify-backup run 45209648761 passed end to end with--wipe-pvcs(Distributed) on 6c3600d. The review follow-up (d1f37d4) has not had an end-to-end run, and Mono has not been tested on a live instance.Tracking: https://github.com/StackVista/verify-backup/issues/22
🤖 Generated with Claude Code