Skip to content

Commit

Permalink
added proper return message
Browse files Browse the repository at this point in the history
Signed-off-by: Nischay <[email protected]>
  • Loading branch information
nish112022 committed Oct 29, 2024
1 parent 86b9c3e commit 56479be
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/datacoord/index_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ func (s *Server) DropIndex(ctx context.Context, req *indexpb.DropIndexRequest) (
indexes := s.meta.indexMeta.GetIndexesForCollection(req.GetCollectionID(), req.GetIndexName())
if len(indexes) == 0 {
log.Info(fmt.Sprintf("there is no index on collection: %d with the index name: %s", req.CollectionID, req.IndexName))
return merr.Success(), nil
return merr.Status(merr.ErrIndexNotFound), nil
}

if !req.GetDropAll() && len(indexes) > 1 {
Expand Down
2 changes: 1 addition & 1 deletion internal/rootcoord/drop_collection_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (t *dropCollectionTask) Execute(ctx context.Context) error {
if errors.Is(err, merr.ErrCollectionNotFound) {
// make dropping collection idempotent.
log.Warn("drop non-existent collection", zap.String("collection", t.Req.GetCollectionName()))
return nil
return merr.ErrCollectionNotFound
}

if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion internal/rootcoord/drop_partition_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/milvus-io/milvus/internal/util/proxyutil"
"github.com/milvus-io/milvus/pkg/common"
"github.com/milvus-io/milvus/pkg/log"
"github.com/milvus-io/milvus/pkg/util/merr"
)

type dropPartitionTask struct {
Expand Down Expand Up @@ -64,7 +65,7 @@ func (t *dropPartitionTask) Execute(ctx context.Context) error {
if partID == common.InvalidPartitionID {
log.Warn("drop an non-existent partition", zap.String("collection", t.Req.GetCollectionName()), zap.String("partition", t.Req.GetPartitionName()))
// make dropping partition idempotent.
return nil
return merr.ErrPartitionNotFound
}

redoTask := newBaseRedoTask(t.core.stepExecutor)
Expand Down

0 comments on commit 56479be

Please sign in to comment.