From 8996af56c3767e339a331f1fab5fd8cc42ca5827 Mon Sep 17 00:00:00 2001 From: hailin0 Date: Sun, 17 Sep 2023 20:17:15 +0800 Subject: [PATCH] Fix write response metadata field(measure/stream) (#330) --- api/proto/banyandb/measure/v1/write.proto | 2 +- api/proto/banyandb/stream/v1/write.proto | 2 +- banyand/liaison/grpc/stream.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/proto/banyandb/measure/v1/write.proto b/api/proto/banyandb/measure/v1/write.proto index 9d007334f..3def94939 100644 --- a/api/proto/banyandb/measure/v1/write.proto +++ b/api/proto/banyandb/measure/v1/write.proto @@ -55,7 +55,7 @@ message WriteResponse { // status indicates the request processing result model.v1.Status status = 2 [(validate.rules).enum.defined_only = true]; // the metadata from request when request fails - common.v1.Metadata metadata = 3 [(validate.rules).message.required = true]; + common.v1.Metadata metadata = 3; } message InternalWriteRequest { diff --git a/api/proto/banyandb/stream/v1/write.proto b/api/proto/banyandb/stream/v1/write.proto index 1c3347f11..01b8f221e 100644 --- a/api/proto/banyandb/stream/v1/write.proto +++ b/api/proto/banyandb/stream/v1/write.proto @@ -54,7 +54,7 @@ message WriteResponse { // status indicates the request processing result model.v1.Status status = 2 [(validate.rules).enum.defined_only = true]; // the metadata from request when request fails - common.v1.Metadata metadata = 3 [(validate.rules).message.required = true]; + common.v1.Metadata metadata = 3; } message InternalWriteRequest { diff --git a/banyand/liaison/grpc/stream.go b/banyand/liaison/grpc/stream.go index d188f9757..0fbee9a4b 100644 --- a/banyand/liaison/grpc/stream.go +++ b/banyand/liaison/grpc/stream.go @@ -99,7 +99,7 @@ func (s *streamService) Write(stream streamv1.StreamService_WriteServer) error { entity, tagValues, shardID, err := s.navigate(writeEntity.GetMetadata(), writeEntity.GetElement().GetTagFamilies()) if err != nil { s.sampled.Error().Err(err).RawJSON("written", logger.Proto(writeEntity)).Msg("failed to navigate to the write target") - reply(nil, modelv1.Status_STATUS_INTERNAL_ERROR, writeEntity.GetMessageId(), stream, s.sampled) + reply(writeEntity.GetMetadata(), modelv1.Status_STATUS_INTERNAL_ERROR, writeEntity.GetMessageId(), stream, s.sampled) continue } if s.ingestionAccessLog != nil {