{"record":{"id":"c64e675a6d21cf09","repo":"weaviate/weaviate","slug":"can-not-assign-new-nodes-to-shard-s-it-didn-t-ex","errorCode":null,"errorMessage":"can not assign new nodes to shard %s, it didn't exist in the new partitions","messagePattern":"can not assign new nodes to shard (.+?), it didn't exist in the new partitions","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cluster/schema/meta_class.go","lineNumber":733,"sourceCode":"// unfreeze creates a process requests and add them in memory to compare it later when\n// TenantProcessRequest comes.\n// it keeps the requested state ACTIVE/INACTIVE in memory.\n// it updates the tenant status to UNFREEZING in RAFT schema.\n// NOTE: can make some of the requests nil.\nfunc (m *metaClass) unfreeze(nodeID string, i int, req *command.UpdateTenantsRequest, p *sharding.Physical) error {\n\tname := req.Tenants[i].Name\n\tprocess := m.shardProcess(name, command.TenantProcessRequest_ACTION_UNFREEZING)\n\n\tpartitions, err := m.Sharding.GetPartitions(req.ClusterNodes, []string{name}, m.Class.ReplicationConfig.Factor)\n\tif err != nil {\n\t\treq.Tenants[i] = nil\n\t\treturn fmt.Errorf(\"get partitions: %w\", err)\n\t}\n\n\tnewNodes, ok := partitions[name]\n\tif !ok {\n\t\treq.Tenants[i] = nil\n\t\treturn fmt.Errorf(\"can not assign new nodes to shard %s, it didn't exist in the new partitions\", name)\n\t}\n\n\toldNodes := p.BelongsToNodes\n\tp.Status = types.TenantActivityStatusUNFREEZING\n\tp.BelongsToNodes = newNodes\n\n\tnewToOld := map[string]string{}\n\tslices.Sort(newNodes)\n\tslices.Sort(oldNodes)\n\n\tfor idx, node := range newNodes {\n\t\tif idx >= len(oldNodes) {\n\t\t\t// ignore new nodes if the replication factor increase\n\t\t\t// and relay on replication client will replicate the data\n\t\t\t// after it's downloaded\n\t\t\tcontinue\n\t\t}\n\t\tnewToOld[node] = oldNodes[idx]","sourceCodeStart":715,"sourceCodeEnd":751,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/cluster/schema/meta_class.go#L715-L751","documentation":"During unfreeze, GetPartitions succeeded but the resulting partitions map has no entry for the tenant's shard, so no new node assignment can be made. The tenant entry is nulled and this error is returned, leaving the tenant unfrozen-but-unassigned (operation aborted).","triggerScenarios":"UpdateTenants unfreeze path where partitions[name] lookup misses — the shard disappeared from the recomputed sharding state, e.g. after sharding state corruption, tenant deletion racing unfreeze, or class recreation.","commonSituations":"Unfreezing a tenant whose shard was removed while frozen (tenant deleted, class rebuilt); mismatches between the sharding state snapshot used at freeze time and the current one; multi-node cluster where one node has stale schema state.","solutions":["Verify the tenant still exists in the class's sharding state and that the class wasn't recreated; re-check with GetTenants","Recompute/re-sync the sharding state across the cluster (schema manager rebuild or restore from a consistent snapshot)","Delete and re-add the tenant if its shard is genuinely gone, accepting data implications for the offloaded (COLD) tenant","Check node membership and replication factor consistency — GetPartitions output depends on req.ClusterNodes and the class replication config"],"exampleFix":"// before\nclients.UpdateTenants(class, []Tenant{{Name: t, Status: HOT}}) // shard missing after class rebuild\n// after\ntenants, _ := clients.GetTenants(class)\nif _, ok := tenants[t]; !ok { clients.AddTenants(class, []Tenant{{Name: t, Status: HOT}}) } else { clients.UpdateTenants(...) }","handlingStrategy":"validation","validationCode":"tenants, err := getTenants(class)\nif _, ok := tenants[tenant]; !ok { return ErrTenantShardMissing }","typeGuard":"func shardExists(partitions map[string][]string, tenant string) bool {\n  _, ok := partitions[tenant]\n  return ok\n}","tryCatchPattern":null,"preventionTips":["Verify the tenant/shard still exists before unfreezing","Avoid deleting tenants or recreating classes while tenants are frozen","Re-sync sharding state across nodes before lifecycle operations"],"tags":["multi-tenancy","unfreeze","sharding","tenant-not-found"],"backgroundTag":"shard-placement-unavailable","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"}