Merge branch 'master' into lattice-fix

This commit is contained in:
Samir Patel 2021-06-04 10:16:46 -05:00 committed by GitHub
commit 5ef218977f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

7
api.go
View file

@ -277,6 +277,13 @@ func (api *API) DeleteIndex(ctx context.Context, indexName string) error {
api.server.logger.Errorf("problem sending DeleteIndex message: %s", err)
return errors.Wrap(err, "sending DeleteIndex message")
}
// Delete ids allocated for index if any present
snap := topology.NewClusterSnapshot(api.cluster.noder, api.cluster.Hasher, api.cluster.ReplicaN)
if snap.IsPrimaryFieldTranslationNode(api.NodeID()) {
if err := api.holder.ida.reset(indexName); err != nil {
return errors.Wrap(err, "deleting id allocation for index")
}
}
api.holder.Stats.Count(MetricDeleteIndex, 1, 1.0)
return nil
}