-
Notifications
You must be signed in to change notification settings - Fork 78
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
Bug fix for gateway #963
Bug fix for gateway #963
Conversation
Signed-off-by: kpango <kpango@vdaas.org>
[CHATOPS:HELP] ChatOps commands.
|
/changelog |
[CHANGELOG] Please edit the following lines. New Feature
Breaking Changes
PRs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Happy birthday 👏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
I'm not sure but the several dependencies are updated in this PR. Is that okay? |
@rinx I think it's okay, because each dependency are small update and I checked this build on my local cluster it works fine. If you interest please check below each one looks not breaking changes and just update small things. |
@rinx seems e2e test failed to deploy mysql. example should I add sleep command for each |
yes, please. |
okay, I'll do it. |
Signed-off-by: kpango <kpango@vdaas.org>
Maybe E2E tests for deploying with Cassandra requires changes like this. |
Signed-off-by: kpango <kpango@vdaas.org>
@rinx thank you for your attention, I updated |
for _, req := range reqs.GetRequests() { | ||
removeList = append(removeList, &payload.Remove_Request{ | ||
rmr.Requests = append(rmr.Requests, &payload.Remove_Request{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
Config, XXX_NoUnkeyedLiteral, XXX_unrecognized, XXX_sizecache are missing in Remove_Request (exhaustivestruct)
vec.Config.SkipStrictExistCheck = true | ||
} | ||
ids = append(ids, vec.GetVector().GetId()) | ||
ireqs = append(ireqs, &payload.Insert_Request{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
XXX_NoUnkeyedLiteral, XXX_unrecognized, XXX_sizecache are missing in Insert_Request (exhaustivestruct)
ids = append(ids, vec.GetVector().GetId()) | ||
ireqs = append(ireqs, &payload.Insert_Request{ | ||
Vector: vec.GetVector(), | ||
Config: &payload.Insert_Config{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
XXX_NoUnkeyedLiteral, XXX_unrecognized, XXX_sizecache are missing in Insert_Config (exhaustivestruct)
} | ||
res, err = s.MultiInsert(ctx, &payload.Insert_MultiRequest{ | ||
log.Debugf("uuids %v were removed from %v for MultiUpdate it will execute MultiInsert soon, see detailt %#v", ids, locs.GetLocations(), locs) | ||
locs, err = s.MultiInsert(ctx, &payload.Insert_MultiRequest{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
XXX_NoUnkeyedLiteral, XXX_unrecognized, XXX_sizecache are missing in Insert_MultiRequest (exhaustivestruct)
@@ -783,35 +1423,61 @@ func (s *server) GetObject(ctx context.Context, req *payload.Object_VectorReques | |||
} | |||
}() | |||
mvec, err := s.backup.GetVector(ctx, req.GetId().GetId()) | |||
if err == nil && mvec != nil { | |||
return &payload.Object_Vector{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
XXX_NoUnkeyedLiteral, XXX_unrecognized, XXX_sizecache are missing in Object_Vector (exhaustivestruct)
@@ -37,3 +40,16 @@ type ( | |||
ResourceInfo = errdetails.ResourceInfo | |||
RetryInfo = errdetails.RetryInfo | |||
) | |||
|
|||
const ( | |||
ValdResourceOwner = "vdaas.org vald team <vald@vdaas.org>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
exported const ValdResourceOwner should have comment (or a comment on this block) or be unexported (golint)
ValdGRPCResourceTypePrefix = "github.com/vdaas/vald/apis/grpc/v1" | ||
) | ||
|
||
func Serialize(obj interface{}) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
exported function Serialize
should have comment or be unexported (golint)
} | ||
if data != nil { | ||
eg.Go(safety.RecoverWithoutPanicFunc(func() (err error) { | ||
ctx, sspan := trace.StartSpan(ctx, fmt.Sprintf("%s/BidirectionalStream/stream-%020d", apiName, atomic.AddUint64(&cnt, 1))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
line is 127 characters (lll)
Signed-off-by: kpango <kpango@vdaas.org>
0b4a414
to
24a9d97
Compare
if span != nil { | ||
span.SetStatus(trace.StatusCodeNotFound(err.Error())) | ||
} | ||
return nil, status.WrapWithNotFound(fmt.Sprintf("Exists API meta %s's uuid not found", meta.GetId()), err, meta.GetId(), info.Get()) | ||
return nil, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
return statements should not be cuddled if block has more than two lines (wsl)
if span != nil { | ||
span.SetStatus(trace.StatusCodeInternal(err.Error())) | ||
} | ||
log.Error(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
expressions should not be cuddled with blocks (wsl)
if span != nil { | ||
span.SetStatus(trace.StatusCodeInternal(err.Error())) | ||
} | ||
log.Error(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
expressions should not be cuddled with blocks (wsl)
} | ||
return nil, err | ||
} | ||
ids = append(ids, meta) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
append only allowed to cuddle with appended value (wsl)
@@ -84,26 +98,39 @@ func BidirectionalStream(ctx context.Context, stream ServerStream, | |||
data := newData() | |||
err = stream.RecvMsg(data) | |||
if err != nil { | |||
if err == io.EOF || errors.Is(err, io.EOF) { | |||
return finalize() | |||
if err != io.EOF && !errors.Is(err, io.EOF) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint)
975e69e
to
57269ff
Compare
} | ||
return loc, nil | ||
} | ||
|
||
func (s *server) StreamInsert(stream vald.Insert_StreamInsertServer) error { | ||
func (s *server) StreamInsert(stream vald.Insert_StreamInsertServer) (err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
635-683 lines are duplicate of pkg/gateway/meta/handler/grpc/handler.go:911-959
(dupl)
} | ||
return res, nil | ||
} | ||
|
||
func (s *server) StreamUpdate(stream vald.Update_StreamUpdateServer) error { | ||
func (s *server) StreamUpdate(stream vald.Update_StreamUpdateServer) (err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
911-959 lines are duplicate of pkg/gateway/meta/handler/grpc/handler.go:1118-1166
(dupl)
} | ||
return loc, nil | ||
} | ||
|
||
func (s *server) StreamUpsert(stream vald.Upsert_StreamUpsertServer) error { | ||
func (s *server) StreamUpsert(stream vald.Upsert_StreamUpsertServer) (err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
1118-1166 lines are duplicate of pkg/gateway/meta/handler/grpc/handler.go:1371-1419
(dupl)
} | ||
return loc, nil | ||
} | ||
|
||
func (s *server) StreamRemove(stream vald.Remove_StreamRemoveServer) error { | ||
func (s *server) StreamRemove(stream vald.Remove_StreamRemoveServer) (err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
1371-1419 lines are duplicate of pkg/gateway/meta/handler/grpc/handler.go:1546-1594
(dupl)
} | ||
vec.Id = meta | ||
return vec, nil | ||
} | ||
|
||
func (s *server) StreamGetObject(stream vald.Object_StreamGetObjectServer) error { | ||
func (s *server) StreamGetObject(stream vald.Object_StreamGetObjectServer) (err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
1546-1594 lines are duplicate of pkg/gateway/meta/handler/grpc/handler.go:635-683
(dupl)
} | ||
return loc, nil | ||
} | ||
|
||
func (s *server) StreamUpsert(stream vald.Upsert_StreamUpsertServer) error { | ||
func (s *server) StreamUpsert(stream vald.Upsert_StreamUpsertServer) (err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
1352-1400 lines are duplicate of pkg/gateway/lb/handler/grpc/handler.go:1611-1659
(dupl)
} | ||
return locs, nil | ||
} | ||
|
||
func (s *server) StreamRemove(stream vald.Remove_StreamRemoveServer) error { | ||
func (s *server) StreamRemove(stream vald.Remove_StreamRemoveServer) (err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
1611-1659 lines are duplicate of pkg/gateway/lb/handler/grpc/handler.go:1796-1844
(dupl)
} | ||
return vec, nil | ||
} | ||
|
||
func (s *server) StreamGetObject(stream vald.Object_StreamGetObjectServer) error { | ||
func (s *server) StreamGetObject(stream vald.Object_StreamGetObjectServer) (err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
1796-1844 lines are duplicate of pkg/gateway/lb/handler/grpc/handler.go:819-867
(dupl)
return nil, err | ||
} | ||
|
||
if !req.GetConfig().GetSkipStrictExistCheck() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
1019-1045 lines are duplicate of pkg/gateway/lb/handler/grpc/handler.go:1187-1213
(dupl)
return nil, err | ||
} | ||
uuid := vec.GetVector().GetId() | ||
if !vec.GetConfig().GetSkipStrictExistCheck() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
1187-1213 lines are duplicate of pkg/gateway/lb/handler/grpc/handler.go:1019-1045
(dupl)
Signed-off-by: kpango <kpango@vdaas.org>
abbfa88
to
cca2b7c
Compare
Signed-off-by: kpango <kpango@vdaas.org>
4370141
to
02850eb
Compare
"github.com/gogo/protobuf/types" | ||
) | ||
|
||
type Any = types.Any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
exported type Any
should have comment or be unexported (golint)
|
||
type Any = types.Any | ||
|
||
func UnmarshalAny(any *Any, pb proto.Message) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
exported function UnmarshalAny
should have comment or be unexported (golint)
return fmt.Sprintf("code: %d,\tmessage: %s,\terror: %v,details: %v", e.Code, e.Message, e.Error, e.Details) | ||
} | ||
|
||
func DecodeErrorDetails(objs ...interface{}) (es []*ErrorDetails) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
Function 'DecodeErrorDetails' has too many statements (47 > 40) (funlen)
return string(b) | ||
} | ||
|
||
func DecodeDetail(detail *types.Any) (data interface{}, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
Function 'DecodeDetail' has too many statements (58 > 40) (funlen)
) | ||
|
||
var ( | ||
debugInfoMessageName = new(DebugInfo).XXX_MessageName() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
debugInfoMessageName is a global variable (gochecknoglobals)
preconditionFailureViolationMessageName = new(PreconditionFailureViolation).XXX_MessageName() | ||
helpMessageName = new(Help).XXX_MessageName() | ||
helpLinkMessageName = new(HelpLink).XXX_MessageName() | ||
quotaFailureMessageName = new(QuotaFailure).XXX_MessageName() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
quotaFailureMessageName is a global variable (gochecknoglobals)
helpMessageName = new(Help).XXX_MessageName() | ||
helpLinkMessageName = new(HelpLink).XXX_MessageName() | ||
quotaFailureMessageName = new(QuotaFailure).XXX_MessageName() | ||
quotaFailureViolationMessageName = new(QuotaFailureViolation).XXX_MessageName() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
quotaFailureViolationMessageName is a global variable (gochecknoglobals)
helpLinkMessageName = new(HelpLink).XXX_MessageName() | ||
quotaFailureMessageName = new(QuotaFailure).XXX_MessageName() | ||
quotaFailureViolationMessageName = new(QuotaFailureViolation).XXX_MessageName() | ||
requestInfoMessageName = new(RequestInfo).XXX_MessageName() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
requestInfoMessageName is a global variable (gochecknoglobals)
quotaFailureMessageName = new(QuotaFailure).XXX_MessageName() | ||
quotaFailureViolationMessageName = new(QuotaFailureViolation).XXX_MessageName() | ||
requestInfoMessageName = new(RequestInfo).XXX_MessageName() | ||
resourceInfoMessageName = new(ResourceInfo).XXX_MessageName() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
resourceInfoMessageName is a global variable (gochecknoglobals)
quotaFailureViolationMessageName = new(QuotaFailureViolation).XXX_MessageName() | ||
requestInfoMessageName = new(RequestInfo).XXX_MessageName() | ||
resourceInfoMessageName = new(ResourceInfo).XXX_MessageName() | ||
retryInfoMessageName = new(RetryInfo).XXX_MessageName() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
retryInfoMessageName is a global variable (gochecknoglobals)
Signed-off-by: kpango kpango@vdaas.org
Description:
bug fix of gateway for v1 release
Related Issue:
How Has This Been Tested?:
Environment:
Types of changes:
Changes to Core Features:
Checklist: