Do not call it data loss when the instance would not show us the accounts
The dress rehearsal reported MISSING ACCOUNT [email protected] after a migration that lost nothing: SMTP on the migrated instance accepts mail for it, while an address that does not exist is refused, so the account is there. Enumeration is permission-scoped. The "before" snapshot was read by an account with full rights; the "after" snapshot by one whose admin role the migration had not carried across - proven one step earlier, where the quota rebuild was refused as unauthorised. It was shown a fraction of the accounts and the comparison called the remainder lost. "Missing" and "not permitted to see" are different findings and only one of them is about the data. When the migrated instance shows fewer accounts than existed, the result now says COULD NOT VERIFY and names the reader, rather than asserting a loss the evidence does not support. It still fails the run: an unverified migration is not a verified one, and the fix is to re-check with an admin account, which --resume makes cheap. Counting accounts is not a strong enough signal to tell the two cases apart, so it does not try to - it reports the ambiguity instead of guessing. Also fixes the test fake, which ignored ?types= and returned domains as individuals, making every account count in these tests wrong.
This commit is contained in:
@@ -72,6 +72,18 @@ func RunLive(ctx context.Context, store *checkpoint.Store, rs *checkpoint.RunSta
|
||||
return checkpoint.StepOutcome{}, err
|
||||
}
|
||||
switch {
|
||||
case r.Inconclusive():
|
||||
// Fewer accounts came back than existed, so "missing" cannot be
|
||||
// told apart from "not permitted to see". Still a failure - an
|
||||
// unverified migration is not a verified one - but it must not
|
||||
// be reported as data loss, which is a different claim and one
|
||||
// this evidence does not support.
|
||||
return checkpoint.StepOutcome{Verdict: string(StatusFail), Detail: fmt.Sprintf(
|
||||
"COULD NOT VERIFY (not the same as data loss): the migrated instance showed %d of %d account(s) to %s. "+
|
||||
"Either those accounts are gone, or this account cannot see them - enumeration is permission-scoped, and a "+
|
||||
"migration does not always carry an admin role across. Re-check with an account that holds admin on the "+
|
||||
"migrated instance before concluding either. Findings: %s",
|
||||
r.AccountsVisibleAfter, r.AccountsChecked, opts.AdminUser, r.String())}, nil
|
||||
case !r.OK():
|
||||
// Recorded as a completed step with a failing verdict rather
|
||||
// than an error: the comparison ran, and its answer is the
|
||||
|
||||
Reference in New Issue
Block a user