Files
cozystack/internal
Andrey Kolkov 69f80dbdc2 fix(mongodb): drop the false-positive stall detector and harden the cancel
The pinned psmdb operator persists a backup's status only when the state
string or error changes, so status.lastTransition freezes at the instant a
dump enters running and never advances while it streams. A stall detector
keyed on that field fires on every dump that outruns its window and raises
the same signal a genuine wedge would, so it cannot be acted on either
way. Drop it: a running dump is polled quietly and never cancelled, since
this CR carries no field a driver-side timer can use to tell a slow dump
from a wedged one.

The deadline cancel re-read the live state but could not tell "could not
read" from "not started": the helper returned "" for a nil client, a
throttle, a 403 and a real absence alike, and a live ready or error state
also fell through, so an unanswerable read or a just-completed CR was
deleted, taking a finished archive with it via the delete-backup
finalizer. The helper now returns an error, and the cancel deletes only on
a positive not-started answer, deferring on anything else.

The restore's point-in-time refusal keyed on the resolved credentialsSecret
name, which a BackupClass can set to any Secret; record the useSystemBucket
flag on the backup snapshot and key the refusal on that instead.

The storage-race retry deleted the errored CR, but the lookup kept
returning it while it lingered Terminating, so a fresh CR was never minted;
skip a CR carrying a deletion timestamp in the lookup.

Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
2026-09-22 12:03:58 +04:00
..