Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(horaemeta): drop metadata of partition table by http api #1477

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions horaemeta/server/cluster/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,20 @@ func (m *managerImpl) DropTable(ctx context.Context, clusterName, schemaName, ta
return errors.WithMessage(err, "get table")
}

// If the table is partitioned, delete the table metadata directly.
if table.IsPartitioned() {
_, err = cluster.metadata.DropTableMetadata(ctx,
chunshao90 marked this conversation as resolved.
Show resolved Hide resolved
schemaName,
tableName,
)
if err != nil {
return errors.WithMessage(err, "cluster drop table")
chunshao90 marked this conversation as resolved.
Show resolved Hide resolved
}
return nil
}

// If the table is not a partition table, delete the table metadata and remove the table from the shard.
// So we need to check if the table has been assigned to a shard.
getShardNodeResult, err := cluster.metadata.GetShardNodeByTableIDs([]storage.TableID{table.ID})
if err != nil {
return errors.WithMessage(err, "get shard node by tableID")
Expand Down
Loading