{"record":{"id":"6fc0c3071b0f6259","repo":"weaviate/weaviate","slug":"get-shard-q-w-6fc0c3","errorCode":null,"errorMessage":"get shard %q: %w","messagePattern":"get shard %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/repos/db/index_async_checkpoint.go","lineNumber":34,"sourceCode":"\t\"errors\"\n\t\"fmt\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"time\"\n\n\t\"github.com/sirupsen/logrus\"\n\tenterrors \"github.com/weaviate/weaviate/entities/errors\"\n\t\"github.com/weaviate/weaviate/usecases/replica\"\n)\n\n// createAsyncCheckpoint applies a fan-out create. createdAt must be the\n// initiator's timestamp (convergence tie-breaker). Returns nil for shards\n// not hosted on this node so a class-wide broadcast can no-op safely.\nfunc (i *Index) createAsyncCheckpoint(ctx context.Context, shardName string, cutoffMs int64, createdAt time.Time) error {\n\t// Never load a shard from async replication.\n\tshard, release, err := i.getLoadedShard(shardName)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get shard %q: %w\", shardName, err)\n\t}\n\tif shard == nil {\n\t\t// Not hosted here is benign for a fan-out create; hosted-but-unloaded is a visible 412.\n\t\tif i.shards.Load(shardName) == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"%w: shard %q not loaded on this node\", errAsyncReplicationNotActive, shardName)\n\t}\n\tdefer release()\n\treturn shard.CreateAsyncCheckpoint(ctx, cutoffMs, createdAt)\n}\n\n// createAsyncCheckpointShards is best-effort: errors are joined (preserving\n// errors.Is) so REST/gRPC mappers can still classify a sentinel result.\nfunc (i *Index) createAsyncCheckpointShards(ctx context.Context, shardNames []string, cutoffMs int64, createdAt time.Time) error {\n\tvar (\n\t\terrsMu sync.Mutex\n\t\terrs   []error","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/repos/db/index_async_checkpoint.go#L16-L52","documentation":"Index.createAsyncCheckpoint resolves the local shard via getLoadedShard to create an async-replication checkpoint. Any error from that lookup (other than the shard simply not being present) is wrapped as \"get shard %q: %w\". This is distinct from the benign not-hosted case, which returns nil so a class-wide fan-out can no-op safely.","triggerScenarios":"Calling CreateAsyncCheckpoints (or the internal createAsyncCheckpoint) when getLoadedShard fails for a shard: shard map access error, store-related failure while resolving the shard.","commonSituations":"Checkpoint creation racing with shard shutdown/reload; internal state errors in the shard registry on a node undergoing maintenance.","solutions":["Read the wrapped cause to identify why getLoadedShard failed and address it (e.g. wait for shard reload to finish).","Retry checkpoint creation after the shard settles (load/reload complete).","If the node is being drained, re-issue checkpoints once the node is stable."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := idx.CreateAsyncCheckpoints(ctx, cutoff, shards)\nif err != nil {\n\tif !errors.Is(err, errAsyncReplicationNotActive) {\n\t\t// get shard %q failure: retry after shard settles\n\t}\n}","preventionTips":["Avoid creating checkpoints during shard reload/offload","Ensure shards fully loaded before maintenance operations","Check node stability before fan-out operations"],"tags":["async-replication","checkpoint","sharding"],"backgroundTag":"checkpoint-creation-failed","analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}