{"record":{"id":"6ba4e06fe521af5a","repo":"vitessio/vitess","slug":"reloadschemakeyspace-s-failed-w","errorCode":null,"errorMessage":"ReloadSchemaKeyspace(%s) failed: %w","messagePattern":"ReloadSchemaKeyspace\\((.+?)\\) failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtadmin/cluster/cluster.go","lineNumber":2256,"sourceCode":"\t\t\tdefer wg.Done()\n\n\t\t\tspan, ctx := trace.NewSpan(ctx, \"Cluster.ReloadSchemaKeyspace\")\n\t\t\tdefer span.Finish()\n\n\t\t\tAnnotateSpan(c, span)\n\t\t\tspan.Annotate(\"keyspace\", ks.Name)\n\t\t\tspan.Annotate(\"concurrency\", req.Concurrency)\n\t\t\tspan.Annotate(\"include_primary\", req.IncludePrimary)\n\t\t\tspan.Annotate(\"wait_position\", req.WaitPosition)\n\n\t\t\tresp, err := c.Vtctld.ReloadSchemaKeyspace(ctx, &vtctldatapb.ReloadSchemaKeyspaceRequest{\n\t\t\t\tKeyspace:       ks.Name,\n\t\t\t\tConcurrency:    req.Concurrency,\n\t\t\t\tIncludePrimary: req.IncludePrimary,\n\t\t\t\tWaitPosition:   req.WaitPosition,\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\trec.RecordError(fmt.Errorf(\"ReloadSchemaKeyspace(%s) failed: %w\", ks.Name, err))\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tm.Lock()\n\t\t\tdefer m.Unlock()\n\t\t\tresults = append(results, &vtadminpb.ReloadSchemasResponse_KeyspaceResult{\n\t\t\t\tKeyspace: &vtadminpb.Keyspace{\n\t\t\t\t\tCluster:  cpb,\n\t\t\t\t\tKeyspace: ks,\n\t\t\t\t},\n\t\t\t\tEvents: resp.Events,\n\t\t\t})\n\t\t}(ks)\n\t}\n\n\twg.Wait()\n\tif rec.HasErrors() {\n\t\treturn nil, rec.Error()","sourceCodeStart":2238,"sourceCodeEnd":2274,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtadmin/cluster/cluster.go#L2238-L2274","documentation":"During Cluster.ReloadSchemas, each keyspace's schema reload runs in a goroutine and its error is collected via errgroup's rec.RecordError, wrapped as 'ReloadSchemaKeyspace(%s) failed'. The wrapper only adds the keyspace name; the cause is the underlying vtctld ReloadSchema call failure.","triggerScenarios":"vtctld ReloadSchema for a specific keyspace fails — tablet unreachable, tablet RPC timeout, some tablets error during reload, or context deadline exceeded mid-reload.","commonSituations":"A tablet down or draining during a cluster-wide schema reload (e.g. after a DDL/migration); network partition to one cell; WaitPosition set to an unknown binlog position after a failed migration.","solutions":["Inspect the wrapped cause in the collected error for the failing tablet","Re-run ReloadSchemas for just the affected keyspace after tablets recover","Remove/decommission unhealthy tablets or fix connectivity to the cell","Check WaitPosition validity if one was supplied in the request"],"exampleFix":"// before\nrec.RecordError(fmt.Errorf(\"ReloadSchemaKeyspace(%s) failed: %w\", ks.Name, err))\n// after (operator: inspect the cause)\nlog.Error(\"schema reload failed\", slog.String(\"keyspace\", ks.Name), slog.Any(\"error\", err))\n// then retry:\n_, err := c.ReloadSchemaKeyspace(ctx, &vtctldatapb.ReloadSchemaKeyspaceRequest{Keyspace: ks.Name})","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"res, err := c.ReloadSchemas(ctx, req)\nif err != nil {\n    var ksErr string\n    if strings.Contains(err.Error(), \"ReloadSchemaKeyspace(\") {\n        // extract keyspace and underlying cause; retry per-keyspace\n    }\n}","preventionTips":["Verify all tablets are healthy before cluster-wide schema reloads","Only pass valid WaitPosition values from completed migrations","Retry per-keyspace instead of re-running the whole reload"],"tags":["vtadmin","schema-reload","tablet-unreachable"],"backgroundTag":"schema-reload-failed","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}