fix: harden single-machine load handling
This commit is contained in:
@@ -14,17 +14,18 @@ import (
|
||||
)
|
||||
|
||||
type dbVerifyResult struct {
|
||||
RunID string `json:"run_id"`
|
||||
TenantCode string `json:"tenant_code"`
|
||||
TenantID int64 `json:"tenant_id"`
|
||||
Expected int `json:"expected"`
|
||||
FoundExact int `json:"found_exact"`
|
||||
Missing int `json:"missing"`
|
||||
Mismatch int `json:"mismatch"`
|
||||
DuplicateRows int `json:"duplicate_rows"`
|
||||
Unexpected int `json:"unexpected_rows"`
|
||||
Tables []string `json:"tables"`
|
||||
MissingMIDs []string `json:"missing_client_mids,omitempty"`
|
||||
RunID string `json:"run_id"`
|
||||
TenantCode string `json:"tenant_code"`
|
||||
TenantID int64 `json:"tenant_id"`
|
||||
Expected int `json:"expected"`
|
||||
FoundExact int `json:"found_exact"`
|
||||
Missing int `json:"missing"`
|
||||
Mismatch int `json:"mismatch"`
|
||||
DuplicateRows int `json:"duplicate_rows"`
|
||||
Unexpected int `json:"unexpected_rows"`
|
||||
Tables []string `json:"tables"`
|
||||
MissingMIDs []string `json:"missing_client_mids,omitempty"`
|
||||
UnexpectedMIDs []string `json:"unexpected_client_mids,omitempty"`
|
||||
}
|
||||
|
||||
type persistedIdentity struct {
|
||||
@@ -145,9 +146,11 @@ func runDBVerify(ctx context.Context, coordinatorPath, output, tenantCode, dsnEn
|
||||
for mid := range actual {
|
||||
if _, ok := expected[mid]; !ok {
|
||||
result.Unexpected++
|
||||
result.UnexpectedMIDs = append(result.UnexpectedMIDs, mid)
|
||||
}
|
||||
}
|
||||
sort.Strings(result.MissingMIDs)
|
||||
sort.Strings(result.UnexpectedMIDs)
|
||||
resultRaw, _ := json.MarshalIndent(result, "", " ")
|
||||
if output == "" || output == "-" {
|
||||
if _, err = fmt.Fprintln(os.Stdout, string(resultRaw)); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user