diff --git a/pkg/logbackuppb/logbackuppb.pb.go b/pkg/logbackuppb/logbackuppb.pb.go index 419cbf93e..c114a1c92 100644 --- a/pkg/logbackuppb/logbackuppb.pb.go +++ b/pkg/logbackuppb/logbackuppb.pb.go @@ -379,6 +379,146 @@ func (m *FlushEvent) GetCheckpoint() uint64 { return 0 } +type FlushNowRequest struct { +} + +func (m *FlushNowRequest) Reset() { *m = FlushNowRequest{} } +func (m *FlushNowRequest) String() string { return proto.CompactTextString(m) } +func (*FlushNowRequest) ProtoMessage() {} +func (*FlushNowRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9a556fe18b032662, []int{7} +} +func (m *FlushNowRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FlushNowRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FlushNowRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *FlushNowRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_FlushNowRequest.Merge(m, src) +} +func (m *FlushNowRequest) XXX_Size() int { + return m.Size() +} +func (m *FlushNowRequest) XXX_DiscardUnknown() { + xxx_messageInfo_FlushNowRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_FlushNowRequest proto.InternalMessageInfo + +type FlushNowResponse struct { + Results []*FlushResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` +} + +func (m *FlushNowResponse) Reset() { *m = FlushNowResponse{} } +func (m *FlushNowResponse) String() string { return proto.CompactTextString(m) } +func (*FlushNowResponse) ProtoMessage() {} +func (*FlushNowResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9a556fe18b032662, []int{8} +} +func (m *FlushNowResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FlushNowResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FlushNowResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *FlushNowResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_FlushNowResponse.Merge(m, src) +} +func (m *FlushNowResponse) XXX_Size() int { + return m.Size() +} +func (m *FlushNowResponse) XXX_DiscardUnknown() { + xxx_messageInfo_FlushNowResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_FlushNowResponse proto.InternalMessageInfo + +func (m *FlushNowResponse) GetResults() []*FlushResult { + if m != nil { + return m.Results + } + return nil +} + +type FlushResult struct { + TaskName string `protobuf:"bytes,1,opt,name=task_name,json=taskName,proto3" json:"task_name,omitempty"` + Success bool `protobuf:"varint,2,opt,name=success,proto3" json:"success,omitempty"` + ErrorMessage string `protobuf:"bytes,3,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` +} + +func (m *FlushResult) Reset() { *m = FlushResult{} } +func (m *FlushResult) String() string { return proto.CompactTextString(m) } +func (*FlushResult) ProtoMessage() {} +func (*FlushResult) Descriptor() ([]byte, []int) { + return fileDescriptor_9a556fe18b032662, []int{9} +} +func (m *FlushResult) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FlushResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FlushResult.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *FlushResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_FlushResult.Merge(m, src) +} +func (m *FlushResult) XXX_Size() int { + return m.Size() +} +func (m *FlushResult) XXX_DiscardUnknown() { + xxx_messageInfo_FlushResult.DiscardUnknown(m) +} + +var xxx_messageInfo_FlushResult proto.InternalMessageInfo + +func (m *FlushResult) GetTaskName() string { + if m != nil { + return m.TaskName + } + return "" +} + +func (m *FlushResult) GetSuccess() bool { + if m != nil { + return m.Success + } + return false +} + +func (m *FlushResult) GetErrorMessage() string { + if m != nil { + return m.ErrorMessage + } + return "" +} + func init() { proto.RegisterType((*RegionIdentity)(nil), "logbackup.RegionIdentity") proto.RegisterType((*RegionCheckpoint)(nil), "logbackup.RegionCheckpoint") @@ -387,43 +527,52 @@ func init() { proto.RegisterType((*SubscribeFlushEventRequest)(nil), "logbackup.SubscribeFlushEventRequest") proto.RegisterType((*SubscribeFlushEventResponse)(nil), "logbackup.SubscribeFlushEventResponse") proto.RegisterType((*FlushEvent)(nil), "logbackup.FlushEvent") + proto.RegisterType((*FlushNowRequest)(nil), "logbackup.FlushNowRequest") + proto.RegisterType((*FlushNowResponse)(nil), "logbackup.FlushNowResponse") + proto.RegisterType((*FlushResult)(nil), "logbackup.FlushResult") } func init() { proto.RegisterFile("logbackuppb.proto", fileDescriptor_9a556fe18b032662) } var fileDescriptor_9a556fe18b032662 = []byte{ - // 485 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcd, 0x6e, 0xd3, 0x40, - 0x18, 0xf4, 0x26, 0x28, 0x4d, 0xbe, 0xb4, 0xa1, 0x2c, 0x7f, 0xc1, 0x11, 0x56, 0x64, 0x04, 0x2a, - 0x07, 0x0c, 0xa4, 0x27, 0x0e, 0x5c, 0x8a, 0x02, 0xaa, 0x88, 0x84, 0xe4, 0x56, 0x5c, 0xa3, 0xd8, - 0xfe, 0x70, 0x2c, 0x47, 0xbb, 0x66, 0x77, 0x1d, 0x29, 0x4f, 0xc0, 0x95, 0x23, 0x8f, 0xc0, 0xa3, - 0x70, 0xec, 0xb1, 0x47, 0x94, 0x48, 0x3c, 0x07, 0xf2, 0xda, 0x4e, 0x8c, 0x48, 0x9b, 0x9e, 0x76, - 0x35, 0x33, 0x3b, 0x33, 0xfe, 0x3e, 0x19, 0xee, 0xcc, 0x78,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0x95, 0x09, 0x67, 0x12, 0xe9, 0x5b, 0x68, 0x6f, 0x5a, 0x94, 0xd6, 0xbd, 0xff, 0xac, 0x37, 0xe3, - 0x71, 0xab, 0x7a, 0xfb, 0x0d, 0x98, 0x67, 0xa9, 0x27, 0x7d, 0x11, 0x79, 0xa8, 0x23, 0x86, 0x73, - 0x64, 0xaa, 0xec, 0xdc, 0x83, 0x96, 0x3f, 0x8b, 0x90, 0xa9, 0x71, 0xb1, 0x9a, 0x96, 0xdb, 0xcc, - 0x81, 0xd3, 0xc0, 0x1e, 0x41, 0x6f, 0xeb, 0xd3, 0xa2, 0xd8, 0x0b, 0x68, 0x60, 0x06, 0x94, 0x9d, - 0xee, 0x57, 0x3a, 0x55, 0xe4, 0x85, 0xc8, 0xf6, 0x00, 0x36, 0x68, 0x16, 0x2c, 0xd5, 0x44, 0xa8, - 0x71, 0x8c, 0x0b, 0x1d, 0xbc, 0xef, 0x36, 0x35, 0xf0, 0x11, 0x17, 0xf4, 0x21, 0xec, 0x21, 0x0b, - 0x34, 0x55, 0xd3, 0x54, 0x03, 0x59, 0x90, 0x11, 0x3b, 0x76, 0x34, 0xf8, 0x43, 0xa0, 0x35, 0xe2, - 0xe1, 0x89, 0x2e, 0x41, 0x39, 0x3c, 0xd8, 0x3e, 0x5b, 0x7a, 0x54, 0xa9, 0x7a, 0xed, 0x52, 0xcd, - 0xe7, 0x37, 0x50, 0xe6, 0xf3, 0xb0, 0x0d, 0x3a, 0x85, 0xbb, 0x5b, 0x06, 0x46, 0x9f, 0x56, 0x3c, - 0xae, 0xde, 0x85, 0xf9, 0x6c, 0x97, 0xac, 0xcc, 0x79, 0x45, 0x4e, 0x06, 0x97, 0x3f, 0x9b, 0xe4, - 0xd7, 0xd2, 0x22, 0x17, 0x4b, 0x8b, 0xfc, 0x5e, 0x5a, 0xe4, 0xfb, 0xca, 0x32, 0x7e, 0xac, 0x2c, - 0xe3, 0x62, 0x65, 0x19, 0x97, 0x2b, 0xcb, 0x80, 0x43, 0x2e, 0x42, 0x47, 0x45, 0xf1, 0xdc, 0x89, - 0xe7, 0xfa, 0x8f, 0xf4, 0x1a, 0xfa, 0x38, 0xfe, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x52, 0x14, 0x33, - 0x5f, 0xee, 0x03, 0x00, 0x00, + // 587 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcb, 0x6e, 0xd3, 0x40, + 0x14, 0x8d, 0x53, 0x94, 0x26, 0x37, 0x7d, 0x0e, 0x50, 0x82, 0x23, 0xac, 0xca, 0x08, 0x54, 0x16, + 0x84, 0x92, 0xae, 0x58, 0xb0, 0x29, 0x04, 0x54, 0x51, 0x8a, 0x34, 0xad, 0xd8, 0x5a, 0x7e, 0x5c, + 0x1c, 0xcb, 0xa9, 0xc7, 0xcc, 0x8c, 0x83, 0xfa, 0x05, 0x6c, 0x59, 0xf2, 0x09, 0x6c, 0xf8, 0x0f, + 0x96, 0x5d, 0x76, 0x89, 0x92, 0x1f, 0x41, 0x1e, 0x7b, 0x12, 0x53, 0xd2, 0x96, 0xd5, 0x8c, 0xcf, + 0x39, 0x73, 0xee, 0x99, 0xb9, 0x57, 0x86, 0xcd, 0x11, 0x0b, 0x3d, 0xd7, 0x8f, 0xb3, 0x34, 0xf5, + 0x7a, 0x29, 0x67, 0x92, 0x91, 0xd6, 0x0c, 0x32, 0x57, 0x91, 0x73, 0xc6, 0x35, 0x63, 0xde, 0x09, + 0x59, 0xc8, 0xd4, 0xf6, 0x59, 0xbe, 0x2b, 0xd1, 0x75, 0x9e, 0x09, 0xa9, 0xb6, 0x05, 0x60, 0x0f, + 0x60, 0x8d, 0x62, 0x18, 0xb1, 0xe4, 0x20, 0xc0, 0x44, 0x46, 0xf2, 0x8c, 0xac, 0x41, 0x3d, 0x0a, + 0x3a, 0xc6, 0xb6, 0xb1, 0x73, 0x8b, 0xd6, 0xa3, 0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 0xdc, 0x80, 0x79, 0x07, 0xcd, 0xee, 0x42, 0x4e, 0x1b, 0xed, 0xf7, + 0x2f, 0x7e, 0x34, 0x8d, 0x5f, 0x13, 0xcb, 0x38, 0x9f, 0x58, 0xc6, 0xef, 0x89, 0x65, 0x7c, 0x9b, + 0x5a, 0xb5, 0xef, 0x53, 0xab, 0x76, 0x3e, 0xb5, 0x6a, 0x17, 0x53, 0xab, 0x06, 0x1b, 0x8c, 0x87, + 0x3d, 0x19, 0xc5, 0xe3, 0x5e, 0x3c, 0x56, 0x3f, 0x27, 0xaf, 0xa1, 0x96, 0xbd, 0x3f, 0x01, 0x00, + 0x00, 0xff, 0xff, 0xe8, 0x4e, 0x8d, 0x4c, 0xf9, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -440,6 +589,7 @@ const _ = grpc.SupportPackageIsVersion4 type LogBackupClient interface { GetLastFlushTSOfRegion(ctx context.Context, in *GetLastFlushTSOfRegionRequest, opts ...grpc.CallOption) (*GetLastFlushTSOfRegionResponse, error) SubscribeFlushEvent(ctx context.Context, in *SubscribeFlushEventRequest, opts ...grpc.CallOption) (LogBackup_SubscribeFlushEventClient, error) + FlushNow(ctx context.Context, in *FlushNowRequest, opts ...grpc.CallOption) (*FlushNowResponse, error) } type logBackupClient struct { @@ -491,10 +641,20 @@ func (x *logBackupSubscribeFlushEventClient) Recv() (*SubscribeFlushEventRespons return m, nil } +func (c *logBackupClient) FlushNow(ctx context.Context, in *FlushNowRequest, opts ...grpc.CallOption) (*FlushNowResponse, error) { + out := new(FlushNowResponse) + err := c.cc.Invoke(ctx, "/logbackup.LogBackup/FlushNow", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // LogBackupServer is the server API for LogBackup service. type LogBackupServer interface { GetLastFlushTSOfRegion(context.Context, *GetLastFlushTSOfRegionRequest) (*GetLastFlushTSOfRegionResponse, error) SubscribeFlushEvent(*SubscribeFlushEventRequest, LogBackup_SubscribeFlushEventServer) error + FlushNow(context.Context, *FlushNowRequest) (*FlushNowResponse, error) } // UnimplementedLogBackupServer can be embedded to have forward compatible implementations. @@ -507,6 +667,9 @@ func (*UnimplementedLogBackupServer) GetLastFlushTSOfRegion(ctx context.Context, func (*UnimplementedLogBackupServer) SubscribeFlushEvent(req *SubscribeFlushEventRequest, srv LogBackup_SubscribeFlushEventServer) error { return status.Errorf(codes.Unimplemented, "method SubscribeFlushEvent not implemented") } +func (*UnimplementedLogBackupServer) FlushNow(ctx context.Context, req *FlushNowRequest) (*FlushNowResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FlushNow not implemented") +} func RegisterLogBackupServer(s *grpc.Server, srv LogBackupServer) { s.RegisterService(&_LogBackup_serviceDesc, srv) @@ -551,6 +714,24 @@ func (x *logBackupSubscribeFlushEventServer) Send(m *SubscribeFlushEventResponse return x.ServerStream.SendMsg(m) } +func _LogBackup_FlushNow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FlushNowRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LogBackupServer).FlushNow(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/logbackup.LogBackup/FlushNow", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LogBackupServer).FlushNow(ctx, req.(*FlushNowRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _LogBackup_serviceDesc = grpc.ServiceDesc{ ServiceName: "logbackup.LogBackup", HandlerType: (*LogBackupServer)(nil), @@ -559,6 +740,10 @@ var _LogBackup_serviceDesc = grpc.ServiceDesc{ MethodName: "GetLastFlushTSOfRegion", Handler: _LogBackup_GetLastFlushTSOfRegion_Handler, }, + { + MethodName: "FlushNow", + Handler: _LogBackup_FlushNow_Handler, + }, }, Streams: []grpc.StreamDesc{ { @@ -838,6 +1023,113 @@ func (m *FlushEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *FlushNowRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FlushNowRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FlushNowRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *FlushNowResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FlushNowResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FlushNowResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Results) > 0 { + for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Results[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogbackuppb(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *FlushResult) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FlushResult) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FlushResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ErrorMessage) > 0 { + i -= len(m.ErrorMessage) + copy(dAtA[i:], m.ErrorMessage) + i = encodeVarintLogbackuppb(dAtA, i, uint64(len(m.ErrorMessage))) + i-- + dAtA[i] = 0x1a + } + if m.Success { + i-- + if m.Success { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.TaskName) > 0 { + i -= len(m.TaskName) + copy(dAtA[i:], m.TaskName) + i = encodeVarintLogbackuppb(dAtA, i, uint64(len(m.TaskName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintLogbackuppb(dAtA []byte, offset int, v uint64) int { offset -= sovLogbackuppb(v) base := offset @@ -962,6 +1254,50 @@ func (m *FlushEvent) Size() (n int) { return n } +func (m *FlushNowRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *FlushNowResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Results) > 0 { + for _, e := range m.Results { + l = e.Size() + n += 1 + l + sovLogbackuppb(uint64(l)) + } + } + return n +} + +func (m *FlushResult) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.TaskName) + if l > 0 { + n += 1 + l + sovLogbackuppb(uint64(l)) + } + if m.Success { + n += 2 + } + l = len(m.ErrorMessage) + if l > 0 { + n += 1 + l + sovLogbackuppb(uint64(l)) + } + return n +} + func sovLogbackuppb(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1668,6 +2004,274 @@ func (m *FlushEvent) Unmarshal(dAtA []byte) error { } return nil } +func (m *FlushNowRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogbackuppb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FlushNowRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FlushNowRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipLogbackuppb(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLogbackuppb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FlushNowResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogbackuppb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FlushNowResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FlushNowResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogbackuppb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLogbackuppb + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLogbackuppb + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Results = append(m.Results, &FlushResult{}) + if err := m.Results[len(m.Results)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLogbackuppb(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLogbackuppb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FlushResult) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogbackuppb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FlushResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FlushResult: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TaskName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogbackuppb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthLogbackuppb + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLogbackuppb + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TaskName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogbackuppb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Success = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ErrorMessage", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogbackuppb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthLogbackuppb + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLogbackuppb + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ErrorMessage = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLogbackuppb(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLogbackuppb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipLogbackuppb(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/proto/logbackuppb.proto b/proto/logbackuppb.proto index 77784b001..926d3b250 100644 --- a/proto/logbackuppb.proto +++ b/proto/logbackuppb.proto @@ -52,6 +52,19 @@ message FlushEvent { uint64 checkpoint = 3; } +message FlushNowRequest { +} + +message FlushNowResponse { + repeated FlushResult results = 1; +} + +message FlushResult { + string task_name = 1; + bool success = 2; + string error_message = 3; +} + // The log backup service. // Generally, most essential interfaces of log backup (say, checkpoint management, task management) are // provided by adding some key in the embed etcd of PD. @@ -59,4 +72,5 @@ message FlushEvent { service LogBackup { rpc GetLastFlushTSOfRegion(GetLastFlushTSOfRegionRequest) returns (GetLastFlushTSOfRegionResponse) {} rpc SubscribeFlushEvent(SubscribeFlushEventRequest) returns (stream SubscribeFlushEventResponse) {} + rpc FlushNow(FlushNowRequest) returns (FlushNowResponse) {} } diff --git a/scripts/proto.lock b/scripts/proto.lock index b7f08518b..ef4ae4afb 100644 --- a/scripts/proto.lock +++ b/scripts/proto.lock @@ -12737,6 +12737,40 @@ "type": "uint64" } ] + }, + { + "name": "FlushNowRequest" + }, + { + "name": "FlushNowResponse", + "fields": [ + { + "id": 1, + "name": "results", + "type": "FlushResult", + "is_repeated": true + } + ] + }, + { + "name": "FlushResult", + "fields": [ + { + "id": 1, + "name": "task_name", + "type": "string" + }, + { + "id": 2, + "name": "success", + "type": "bool" + }, + { + "id": 3, + "name": "error_message", + "type": "string" + } + ] } ], "services": [ @@ -12753,6 +12787,11 @@ "in_type": "SubscribeFlushEventRequest", "out_type": "SubscribeFlushEventResponse", "out_streamed": true + }, + { + "name": "FlushNow", + "in_type": "FlushNowRequest", + "out_type": "FlushNowResponse" } ] }