Skip to content

Commit

Permalink
Use empty config when deleting a namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
merlimat committed Sep 22, 2024
1 parent df50882 commit 935d47b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions coordinator/impl/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func NewCoordinator(metadataProvider MetadataProvider,
}
}

c.initialShardController()
c.initialShardController(&initialClusterConf)

go common.DoWithLabels(
c.ctx,
Expand All @@ -159,10 +159,10 @@ func (c *coordinator) allUnavailableNodes() []string {
return nodes
}

func (c *coordinator) initialShardController() {
func (c *coordinator) initialShardController(initialClusterConf *model.ClusterConfig) {
for ns, shards := range c.clusterStatus.Namespaces {
for shard, shardMetadata := range shards.Shards {
namespaceConfig := GetNamespaceConfig(c.Namespaces, ns)
namespaceConfig := GetNamespaceConfig(initialClusterConf.Namespaces, ns)
c.shardControllers[shard] = NewShardController(ns, shard, namespaceConfig, shardMetadata, c.rpc, c)
}
}
Expand Down Expand Up @@ -572,6 +572,5 @@ func GetNamespaceConfig(namespaces []model.NamespaceConfig, namespace string) *m
}
}

// This should never happen since we're going through the same list of namespaces that was already checked
panic("namespace not found")
return &model.NamespaceConfig{}
}

0 comments on commit 935d47b

Please sign in to comment.