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

Different id returned when GetObject RPC and Exists RPC #1709

Merged
merged 1 commit into from
Jun 22, 2022
Merged
Changes from all commits
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
8 changes: 2 additions & 6 deletions pkg/agent/core/ngt/handler/grpc/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package grpc
import (
"context"
"fmt"
"strconv"

"github.com/vdaas/vald/apis/grpc/v1/payload"
"github.com/vdaas/vald/apis/grpc/v1/vald"
Expand Down Expand Up @@ -66,8 +65,7 @@ func (s *server) Exists(ctx context.Context, uid *payload.Object_ID) (res *paylo
log.Warn(err)
return nil, err
}
oid, ok := s.ngt.Exists(uuid)
if !ok {
if _, ok := s.ngt.Exists(uuid); !ok {
err = errors.ErrObjectIDNotFound(uid.GetId())
err = status.WrapWithNotFound(fmt.Sprintf("Exists API meta %s's uuid not found", uid.GetId()), err,
&errdetails.RequestInfo{
Expand All @@ -84,9 +82,7 @@ func (s *server) Exists(ctx context.Context, uid *payload.Object_ID) (res *paylo
}
return nil, err
}
return &payload.Object_ID{
Id: strconv.Itoa(int(oid)),
}, nil
return uid, nil
}

func (s *server) GetObject(ctx context.Context, id *payload.Object_VectorRequest) (res *payload.Object_Vector, err error) {
Expand Down