diff --git a/pkg/wal/wal.pb.go b/pkg/wal/wal.pb.go index 2ae5f25..3114e8e 100644 --- a/pkg/wal/wal.pb.go +++ b/pkg/wal/wal.pb.go @@ -33,6 +33,9 @@ const ( // STATUS indicates that the Plugin is able to // reply to the Status RPC request WALCapability_RPC_STATUS WALCapability_RPC_Type = 3 + // SET_FIRST_REQUIRED indicates that the Plugin is able to + // reply to the SetFirstRequired RPC request + WALCapability_RPC_SET_FIRST_REQUIRED WALCapability_RPC_Type = 4 ) // Enum value maps for WALCapability_RPC_Type. @@ -42,12 +45,14 @@ var ( 1: "ARCHIVE_WAL", 2: "RESTORE_WAL", 3: "STATUS", + 4: "SET_FIRST_REQUIRED", } WALCapability_RPC_Type_value = map[string]int32{ - "UNKNOWN": 0, - "ARCHIVE_WAL": 1, - "RESTORE_WAL": 2, - "STATUS": 3, + "UNKNOWN": 0, + "ARCHIVE_WAL": 1, + "RESTORE_WAL": 2, + "STATUS": 3, + "SET_FIRST_REQUIRED": 4, } ) @@ -75,7 +80,7 @@ func (x WALCapability_RPC_Type) Number() protoreflect.EnumNumber { // Deprecated: Use WALCapability_RPC_Type.Descriptor instead. func (WALCapability_RPC_Type) EnumDescriptor() ([]byte, []int) { - return file_proto_wal_proto_rawDescGZIP(), []int{8, 0, 0} + return file_proto_wal_proto_rawDescGZIP(), []int{10, 0, 0} } type WALArchiveRequest struct { @@ -420,6 +425,104 @@ func (x *WALStatusResult) GetAdditionalInformation() map[string]string { return nil } +type SetFirstRequiredRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // This field is REQUIRED. Value of this field is the name of + // the CNPG cluster for which the WAL should be archived + ClusterName string `protobuf:"bytes,1,opt,name=clusterName,proto3" json:"clusterName,omitempty"` + // This field is REQUIRED. Value of this field is the name of the first + // required WAL in the WAL archive for this cluster (normally based on the + // begin WAL of the first available base backup for the cluster) + FirstRequiredWAL string `protobuf:"bytes,2,opt,name=firstRequiredWAL,proto3" json:"firstRequiredWAL,omitempty"` +} + +func (x *SetFirstRequiredRequest) Reset() { + *x = SetFirstRequiredRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_wal_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetFirstRequiredRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetFirstRequiredRequest) ProtoMessage() {} + +func (x *SetFirstRequiredRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_wal_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetFirstRequiredRequest.ProtoReflect.Descriptor instead. +func (*SetFirstRequiredRequest) Descriptor() ([]byte, []int) { + return file_proto_wal_proto_rawDescGZIP(), []int{6} +} + +func (x *SetFirstRequiredRequest) GetClusterName() string { + if x != nil { + return x.ClusterName + } + return "" +} + +func (x *SetFirstRequiredRequest) GetFirstRequiredWAL() string { + if x != nil { + return x.FirstRequiredWAL + } + return "" +} + +type SetFirstRequiredResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SetFirstRequiredResult) Reset() { + *x = SetFirstRequiredResult{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_wal_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetFirstRequiredResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetFirstRequiredResult) ProtoMessage() {} + +func (x *SetFirstRequiredResult) ProtoReflect() protoreflect.Message { + mi := &file_proto_wal_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetFirstRequiredResult.ProtoReflect.Descriptor instead. +func (*SetFirstRequiredResult) Descriptor() ([]byte, []int) { + return file_proto_wal_proto_rawDescGZIP(), []int{7} +} + type WALCapabilitiesRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -429,7 +532,7 @@ type WALCapabilitiesRequest struct { func (x *WALCapabilitiesRequest) Reset() { *x = WALCapabilitiesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_wal_proto_msgTypes[6] + mi := &file_proto_wal_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -442,7 +545,7 @@ func (x *WALCapabilitiesRequest) String() string { func (*WALCapabilitiesRequest) ProtoMessage() {} func (x *WALCapabilitiesRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_wal_proto_msgTypes[6] + mi := &file_proto_wal_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -455,7 +558,7 @@ func (x *WALCapabilitiesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use WALCapabilitiesRequest.ProtoReflect.Descriptor instead. func (*WALCapabilitiesRequest) Descriptor() ([]byte, []int) { - return file_proto_wal_proto_rawDescGZIP(), []int{6} + return file_proto_wal_proto_rawDescGZIP(), []int{8} } type WALCapabilitiesResult struct { @@ -471,7 +574,7 @@ type WALCapabilitiesResult struct { func (x *WALCapabilitiesResult) Reset() { *x = WALCapabilitiesResult{} if protoimpl.UnsafeEnabled { - mi := &file_proto_wal_proto_msgTypes[7] + mi := &file_proto_wal_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -484,7 +587,7 @@ func (x *WALCapabilitiesResult) String() string { func (*WALCapabilitiesResult) ProtoMessage() {} func (x *WALCapabilitiesResult) ProtoReflect() protoreflect.Message { - mi := &file_proto_wal_proto_msgTypes[7] + mi := &file_proto_wal_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -497,7 +600,7 @@ func (x *WALCapabilitiesResult) ProtoReflect() protoreflect.Message { // Deprecated: Use WALCapabilitiesResult.ProtoReflect.Descriptor instead. func (*WALCapabilitiesResult) Descriptor() ([]byte, []int) { - return file_proto_wal_proto_rawDescGZIP(), []int{7} + return file_proto_wal_proto_rawDescGZIP(), []int{9} } func (x *WALCapabilitiesResult) GetCapabilities() []*WALCapability { @@ -521,7 +624,7 @@ type WALCapability struct { func (x *WALCapability) Reset() { *x = WALCapability{} if protoimpl.UnsafeEnabled { - mi := &file_proto_wal_proto_msgTypes[8] + mi := &file_proto_wal_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -534,7 +637,7 @@ func (x *WALCapability) String() string { func (*WALCapability) ProtoMessage() {} func (x *WALCapability) ProtoReflect() protoreflect.Message { - mi := &file_proto_wal_proto_msgTypes[8] + mi := &file_proto_wal_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -547,7 +650,7 @@ func (x *WALCapability) ProtoReflect() protoreflect.Message { // Deprecated: Use WALCapability.ProtoReflect.Descriptor instead. func (*WALCapability) Descriptor() ([]byte, []int) { - return file_proto_wal_proto_rawDescGZIP(), []int{8} + return file_proto_wal_proto_rawDescGZIP(), []int{10} } func (m *WALCapability) GetType() isWALCapability_Type { @@ -585,7 +688,7 @@ type WALCapability_RPC struct { func (x *WALCapability_RPC) Reset() { *x = WALCapability_RPC{} if protoimpl.UnsafeEnabled { - mi := &file_proto_wal_proto_msgTypes[12] + mi := &file_proto_wal_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -598,7 +701,7 @@ func (x *WALCapability_RPC) String() string { func (*WALCapability_RPC) ProtoMessage() {} func (x *WALCapability_RPC) ProtoReflect() protoreflect.Message { - mi := &file_proto_wal_proto_msgTypes[12] + mi := &file_proto_wal_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -611,7 +714,7 @@ func (x *WALCapability_RPC) ProtoReflect() protoreflect.Message { // Deprecated: Use WALCapability_RPC.ProtoReflect.Descriptor instead. func (*WALCapability_RPC) Descriptor() ([]byte, []int) { - return file_proto_wal_proto_rawDescGZIP(), []int{8, 0} + return file_proto_wal_proto_rawDescGZIP(), []int{10, 0} } func (x *WALCapability_RPC) GetType() WALCapability_RPC_Type { @@ -682,54 +785,70 @@ var file_proto_wal_proto_rawDesc = []byte{ 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x22, 0x18, 0x0a, 0x16, 0x57, 0x41, 0x4c, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, - 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x5c, 0x0a, 0x15, 0x57, - 0x41, 0x4c, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x12, 0x43, 0x0a, 0x0c, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, - 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6e, 0x70, - 0x67, 0x69, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x41, - 0x4c, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0c, 0x63, 0x61, 0x70, - 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x22, 0xd9, 0x01, 0x0a, 0x0d, 0x57, 0x41, - 0x4c, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x37, 0x0a, 0x03, 0x72, - 0x70, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, - 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x41, 0x4c, 0x43, - 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x50, 0x43, 0x48, 0x00, 0x52, - 0x03, 0x72, 0x70, 0x63, 0x1a, 0x86, 0x01, 0x0a, 0x03, 0x52, 0x50, 0x43, 0x12, 0x3c, 0x0a, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x63, 0x6e, 0x70, - 0x67, 0x69, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x41, - 0x4c, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x50, 0x43, 0x2e, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x41, 0x0a, 0x04, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, - 0x0f, 0x0a, 0x0b, 0x41, 0x52, 0x43, 0x48, 0x49, 0x56, 0x45, 0x5f, 0x57, 0x41, 0x4c, 0x10, 0x01, - 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x45, 0x53, 0x54, 0x4f, 0x52, 0x45, 0x5f, 0x57, 0x41, 0x4c, 0x10, - 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x10, 0x03, 0x42, 0x06, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x32, 0xec, 0x02, 0x0a, 0x03, 0x57, 0x41, 0x4c, 0x12, 0x54, 0x0a, - 0x07, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x12, 0x23, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, - 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x41, 0x4c, 0x41, - 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, + 0x01, 0x22, 0x67, 0x0a, 0x17, 0x53, 0x65, 0x74, 0x46, 0x69, 0x72, 0x73, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x69, 0x72, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, + 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2a, + 0x0a, 0x10, 0x66, 0x69, 0x72, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x57, + 0x41, 0x4c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x66, 0x69, 0x72, 0x73, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x57, 0x41, 0x4c, 0x22, 0x18, 0x0a, 0x16, 0x53, 0x65, + 0x74, 0x46, 0x69, 0x72, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x22, 0x18, 0x0a, 0x16, 0x57, 0x41, 0x4c, 0x43, 0x61, 0x70, 0x61, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x5c, + 0x0a, 0x15, 0x57, 0x41, 0x4c, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x43, 0x0a, 0x0c, 0x63, 0x61, 0x70, 0x61, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, + 0x2e, 0x57, 0x41, 0x4c, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0c, + 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x22, 0xf1, 0x01, 0x0a, + 0x0d, 0x57, 0x41, 0x4c, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x37, + 0x0a, 0x03, 0x72, 0x70, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6e, + 0x70, 0x67, 0x69, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, + 0x41, 0x4c, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x50, 0x43, + 0x48, 0x00, 0x52, 0x03, 0x72, 0x70, 0x63, 0x1a, 0x9e, 0x01, 0x0a, 0x03, 0x52, 0x50, 0x43, 0x12, + 0x3c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, - 0x2e, 0x57, 0x41, 0x4c, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x07, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x23, + 0x2e, 0x57, 0x41, 0x4c, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x52, + 0x50, 0x43, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x59, 0x0a, + 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, + 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x52, 0x43, 0x48, 0x49, 0x56, 0x45, 0x5f, 0x57, 0x41, + 0x4c, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x45, 0x53, 0x54, 0x4f, 0x52, 0x45, 0x5f, 0x57, + 0x41, 0x4c, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x10, 0x03, + 0x12, 0x16, 0x0a, 0x12, 0x53, 0x45, 0x54, 0x5f, 0x46, 0x49, 0x52, 0x53, 0x54, 0x5f, 0x52, 0x45, + 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x10, 0x04, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x32, 0xd7, 0x03, 0x0a, 0x03, 0x57, 0x41, 0x4c, 0x12, 0x54, 0x0a, 0x07, 0x41, 0x72, 0x63, 0x68, + 0x69, 0x76, 0x65, 0x12, 0x23, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x61, 0x64, 0x61, 0x70, + 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x41, 0x4c, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, + 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x41, 0x4c, 0x41, + 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x54, + 0x0a, 0x07, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x23, 0x2e, 0x63, 0x6e, 0x70, 0x67, + 0x69, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x41, 0x4c, + 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, - 0x31, 0x2e, 0x57, 0x41, 0x4c, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x61, 0x64, 0x61, 0x70, - 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x41, 0x4c, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, - 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x06, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x22, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x61, 0x64, 0x61, 0x70, - 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x41, 0x4c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, - 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x41, 0x4c, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x66, 0x0a, 0x0f, - 0x47, 0x65, 0x74, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, - 0x28, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, + 0x31, 0x2e, 0x57, 0x41, 0x4c, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x22, + 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, + 0x31, 0x2e, 0x57, 0x41, 0x4c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, + 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x41, 0x4c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x69, 0x0a, 0x10, 0x53, 0x65, 0x74, 0x46, 0x69, + 0x72, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x29, 0x2e, 0x63, 0x6e, + 0x70, 0x67, 0x69, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x65, 0x74, 0x46, 0x69, 0x72, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x61, + 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x46, 0x69, 0x72, + 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x22, 0x00, 0x12, 0x66, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, + 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x28, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x61, 0x64, + 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x41, 0x4c, 0x43, 0x61, 0x70, 0x61, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x27, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x41, 0x4c, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x63, 0x6e, 0x70, 0x67, - 0x69, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x41, 0x4c, - 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x22, 0x00, 0x42, 0x2a, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2d, 0x70, - 0x67, 0x2f, 0x63, 0x6e, 0x70, 0x67, 0x2d, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x77, 0x61, 0x6c, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x42, 0x2a, 0x5a, 0x28, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6e, 0x61, + 0x74, 0x69, 0x76, 0x65, 0x2d, 0x70, 0x67, 0x2f, 0x63, 0x6e, 0x70, 0x67, 0x2d, 0x69, 0x2f, 0x70, + 0x6b, 0x67, 0x2f, 0x77, 0x61, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -745,40 +864,44 @@ func file_proto_wal_proto_rawDescGZIP() []byte { } var file_proto_wal_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_proto_wal_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_proto_wal_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_proto_wal_proto_goTypes = []interface{}{ - (WALCapability_RPC_Type)(0), // 0: cnpgi.adapter.v1.WALCapability.RPC.Type - (*WALArchiveRequest)(nil), // 1: cnpgi.adapter.v1.WALArchiveRequest - (*WALArchiveResult)(nil), // 2: cnpgi.adapter.v1.WALArchiveResult - (*WALRestoreRequest)(nil), // 3: cnpgi.adapter.v1.WALRestoreRequest - (*WALRestoreResult)(nil), // 4: cnpgi.adapter.v1.WALRestoreResult - (*WALStatusRequest)(nil), // 5: cnpgi.adapter.v1.WALStatusRequest - (*WALStatusResult)(nil), // 6: cnpgi.adapter.v1.WALStatusResult - (*WALCapabilitiesRequest)(nil), // 7: cnpgi.adapter.v1.WALCapabilitiesRequest - (*WALCapabilitiesResult)(nil), // 8: cnpgi.adapter.v1.WALCapabilitiesResult - (*WALCapability)(nil), // 9: cnpgi.adapter.v1.WALCapability - nil, // 10: cnpgi.adapter.v1.WALArchiveRequest.ParametersEntry - nil, // 11: cnpgi.adapter.v1.WALRestoreRequest.ParametersEntry - nil, // 12: cnpgi.adapter.v1.WALStatusResult.AdditionalInformationEntry - (*WALCapability_RPC)(nil), // 13: cnpgi.adapter.v1.WALCapability.RPC + (WALCapability_RPC_Type)(0), // 0: cnpgi.adapter.v1.WALCapability.RPC.Type + (*WALArchiveRequest)(nil), // 1: cnpgi.adapter.v1.WALArchiveRequest + (*WALArchiveResult)(nil), // 2: cnpgi.adapter.v1.WALArchiveResult + (*WALRestoreRequest)(nil), // 3: cnpgi.adapter.v1.WALRestoreRequest + (*WALRestoreResult)(nil), // 4: cnpgi.adapter.v1.WALRestoreResult + (*WALStatusRequest)(nil), // 5: cnpgi.adapter.v1.WALStatusRequest + (*WALStatusResult)(nil), // 6: cnpgi.adapter.v1.WALStatusResult + (*SetFirstRequiredRequest)(nil), // 7: cnpgi.adapter.v1.SetFirstRequiredRequest + (*SetFirstRequiredResult)(nil), // 8: cnpgi.adapter.v1.SetFirstRequiredResult + (*WALCapabilitiesRequest)(nil), // 9: cnpgi.adapter.v1.WALCapabilitiesRequest + (*WALCapabilitiesResult)(nil), // 10: cnpgi.adapter.v1.WALCapabilitiesResult + (*WALCapability)(nil), // 11: cnpgi.adapter.v1.WALCapability + nil, // 12: cnpgi.adapter.v1.WALArchiveRequest.ParametersEntry + nil, // 13: cnpgi.adapter.v1.WALRestoreRequest.ParametersEntry + nil, // 14: cnpgi.adapter.v1.WALStatusResult.AdditionalInformationEntry + (*WALCapability_RPC)(nil), // 15: cnpgi.adapter.v1.WALCapability.RPC } var file_proto_wal_proto_depIdxs = []int32{ - 10, // 0: cnpgi.adapter.v1.WALArchiveRequest.parameters:type_name -> cnpgi.adapter.v1.WALArchiveRequest.ParametersEntry - 11, // 1: cnpgi.adapter.v1.WALRestoreRequest.parameters:type_name -> cnpgi.adapter.v1.WALRestoreRequest.ParametersEntry - 12, // 2: cnpgi.adapter.v1.WALStatusResult.additionalInformation:type_name -> cnpgi.adapter.v1.WALStatusResult.AdditionalInformationEntry - 9, // 3: cnpgi.adapter.v1.WALCapabilitiesResult.capabilities:type_name -> cnpgi.adapter.v1.WALCapability - 13, // 4: cnpgi.adapter.v1.WALCapability.rpc:type_name -> cnpgi.adapter.v1.WALCapability.RPC + 12, // 0: cnpgi.adapter.v1.WALArchiveRequest.parameters:type_name -> cnpgi.adapter.v1.WALArchiveRequest.ParametersEntry + 13, // 1: cnpgi.adapter.v1.WALRestoreRequest.parameters:type_name -> cnpgi.adapter.v1.WALRestoreRequest.ParametersEntry + 14, // 2: cnpgi.adapter.v1.WALStatusResult.additionalInformation:type_name -> cnpgi.adapter.v1.WALStatusResult.AdditionalInformationEntry + 11, // 3: cnpgi.adapter.v1.WALCapabilitiesResult.capabilities:type_name -> cnpgi.adapter.v1.WALCapability + 15, // 4: cnpgi.adapter.v1.WALCapability.rpc:type_name -> cnpgi.adapter.v1.WALCapability.RPC 0, // 5: cnpgi.adapter.v1.WALCapability.RPC.type:type_name -> cnpgi.adapter.v1.WALCapability.RPC.Type 1, // 6: cnpgi.adapter.v1.WAL.Archive:input_type -> cnpgi.adapter.v1.WALArchiveRequest 3, // 7: cnpgi.adapter.v1.WAL.Restore:input_type -> cnpgi.adapter.v1.WALRestoreRequest 5, // 8: cnpgi.adapter.v1.WAL.Status:input_type -> cnpgi.adapter.v1.WALStatusRequest - 7, // 9: cnpgi.adapter.v1.WAL.GetCapabilities:input_type -> cnpgi.adapter.v1.WALCapabilitiesRequest - 2, // 10: cnpgi.adapter.v1.WAL.Archive:output_type -> cnpgi.adapter.v1.WALArchiveResult - 4, // 11: cnpgi.adapter.v1.WAL.Restore:output_type -> cnpgi.adapter.v1.WALRestoreResult - 6, // 12: cnpgi.adapter.v1.WAL.Status:output_type -> cnpgi.adapter.v1.WALStatusResult - 8, // 13: cnpgi.adapter.v1.WAL.GetCapabilities:output_type -> cnpgi.adapter.v1.WALCapabilitiesResult - 10, // [10:14] is the sub-list for method output_type - 6, // [6:10] is the sub-list for method input_type + 7, // 9: cnpgi.adapter.v1.WAL.SetFirstRequired:input_type -> cnpgi.adapter.v1.SetFirstRequiredRequest + 9, // 10: cnpgi.adapter.v1.WAL.GetCapabilities:input_type -> cnpgi.adapter.v1.WALCapabilitiesRequest + 2, // 11: cnpgi.adapter.v1.WAL.Archive:output_type -> cnpgi.adapter.v1.WALArchiveResult + 4, // 12: cnpgi.adapter.v1.WAL.Restore:output_type -> cnpgi.adapter.v1.WALRestoreResult + 6, // 13: cnpgi.adapter.v1.WAL.Status:output_type -> cnpgi.adapter.v1.WALStatusResult + 8, // 14: cnpgi.adapter.v1.WAL.SetFirstRequired:output_type -> cnpgi.adapter.v1.SetFirstRequiredResult + 10, // 15: cnpgi.adapter.v1.WAL.GetCapabilities:output_type -> cnpgi.adapter.v1.WALCapabilitiesResult + 11, // [11:16] is the sub-list for method output_type + 6, // [6:11] is the sub-list for method input_type 6, // [6:6] is the sub-list for extension type_name 6, // [6:6] is the sub-list for extension extendee 0, // [0:6] is the sub-list for field type_name @@ -863,7 +986,7 @@ func file_proto_wal_proto_init() { } } file_proto_wal_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WALCapabilitiesRequest); i { + switch v := v.(*SetFirstRequiredRequest); i { case 0: return &v.state case 1: @@ -875,7 +998,7 @@ func file_proto_wal_proto_init() { } } file_proto_wal_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WALCapabilitiesResult); i { + switch v := v.(*SetFirstRequiredResult); i { case 0: return &v.state case 1: @@ -887,6 +1010,30 @@ func file_proto_wal_proto_init() { } } file_proto_wal_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WALCapabilitiesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_wal_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WALCapabilitiesResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_wal_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*WALCapability); i { case 0: return &v.state @@ -898,7 +1045,7 @@ func file_proto_wal_proto_init() { return nil } } - file_proto_wal_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_proto_wal_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*WALCapability_RPC); i { case 0: return &v.state @@ -911,7 +1058,7 @@ func file_proto_wal_proto_init() { } } } - file_proto_wal_proto_msgTypes[8].OneofWrappers = []interface{}{ + file_proto_wal_proto_msgTypes[10].OneofWrappers = []interface{}{ (*WALCapability_Rpc)(nil), } type x struct{} @@ -920,7 +1067,7 @@ func file_proto_wal_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_wal_proto_rawDesc, NumEnums: 1, - NumMessages: 13, + NumMessages: 15, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/wal/wal_grpc.pb.go b/pkg/wal/wal_grpc.pb.go index 5610e08..e6b2ff4 100644 --- a/pkg/wal/wal_grpc.pb.go +++ b/pkg/wal/wal_grpc.pb.go @@ -19,10 +19,11 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - WAL_Archive_FullMethodName = "/cnpgi.adapter.v1.WAL/Archive" - WAL_Restore_FullMethodName = "/cnpgi.adapter.v1.WAL/Restore" - WAL_Status_FullMethodName = "/cnpgi.adapter.v1.WAL/Status" - WAL_GetCapabilities_FullMethodName = "/cnpgi.adapter.v1.WAL/GetCapabilities" + WAL_Archive_FullMethodName = "/cnpgi.adapter.v1.WAL/Archive" + WAL_Restore_FullMethodName = "/cnpgi.adapter.v1.WAL/Restore" + WAL_Status_FullMethodName = "/cnpgi.adapter.v1.WAL/Status" + WAL_SetFirstRequired_FullMethodName = "/cnpgi.adapter.v1.WAL/SetFirstRequired" + WAL_GetCapabilities_FullMethodName = "/cnpgi.adapter.v1.WAL/GetCapabilities" ) // WALClient is the client API for WAL service. @@ -35,6 +36,8 @@ type WALClient interface { Restore(ctx context.Context, in *WALRestoreRequest, opts ...grpc.CallOption) (*WALRestoreResult, error) // Status gets the statistics of the WAL file archive Status(ctx context.Context, in *WALStatusRequest, opts ...grpc.CallOption) (*WALStatusResult, error) + // SetFirstRequired sets the first required WAL for the cluster + SetFirstRequired(ctx context.Context, in *SetFirstRequiredRequest, opts ...grpc.CallOption) (*SetFirstRequiredResult, error) // GetCapabilities gets the capabilities of the WAL service GetCapabilities(ctx context.Context, in *WALCapabilitiesRequest, opts ...grpc.CallOption) (*WALCapabilitiesResult, error) } @@ -74,6 +77,15 @@ func (c *wALClient) Status(ctx context.Context, in *WALStatusRequest, opts ...gr return out, nil } +func (c *wALClient) SetFirstRequired(ctx context.Context, in *SetFirstRequiredRequest, opts ...grpc.CallOption) (*SetFirstRequiredResult, error) { + out := new(SetFirstRequiredResult) + err := c.cc.Invoke(ctx, WAL_SetFirstRequired_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *wALClient) GetCapabilities(ctx context.Context, in *WALCapabilitiesRequest, opts ...grpc.CallOption) (*WALCapabilitiesResult, error) { out := new(WALCapabilitiesResult) err := c.cc.Invoke(ctx, WAL_GetCapabilities_FullMethodName, in, out, opts...) @@ -93,6 +105,8 @@ type WALServer interface { Restore(context.Context, *WALRestoreRequest) (*WALRestoreResult, error) // Status gets the statistics of the WAL file archive Status(context.Context, *WALStatusRequest) (*WALStatusResult, error) + // SetFirstRequired sets the first required WAL for the cluster + SetFirstRequired(context.Context, *SetFirstRequiredRequest) (*SetFirstRequiredResult, error) // GetCapabilities gets the capabilities of the WAL service GetCapabilities(context.Context, *WALCapabilitiesRequest) (*WALCapabilitiesResult, error) mustEmbedUnimplementedWALServer() @@ -111,6 +125,9 @@ func (UnimplementedWALServer) Restore(context.Context, *WALRestoreRequest) (*WAL func (UnimplementedWALServer) Status(context.Context, *WALStatusRequest) (*WALStatusResult, error) { return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") } +func (UnimplementedWALServer) SetFirstRequired(context.Context, *SetFirstRequiredRequest) (*SetFirstRequiredResult, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetFirstRequired not implemented") +} func (UnimplementedWALServer) GetCapabilities(context.Context, *WALCapabilitiesRequest) (*WALCapabilitiesResult, error) { return nil, status.Errorf(codes.Unimplemented, "method GetCapabilities not implemented") } @@ -181,6 +198,24 @@ func _WAL_Status_Handler(srv interface{}, ctx context.Context, dec func(interfac return interceptor(ctx, in, info, handler) } +func _WAL_SetFirstRequired_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetFirstRequiredRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WALServer).SetFirstRequired(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WAL_SetFirstRequired_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WALServer).SetFirstRequired(ctx, req.(*SetFirstRequiredRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _WAL_GetCapabilities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(WALCapabilitiesRequest) if err := dec(in); err != nil { @@ -218,6 +253,10 @@ var WAL_ServiceDesc = grpc.ServiceDesc{ MethodName: "Status", Handler: _WAL_Status_Handler, }, + { + MethodName: "SetFirstRequired", + Handler: _WAL_SetFirstRequired_Handler, + }, { MethodName: "GetCapabilities", Handler: _WAL_GetCapabilities_Handler, diff --git a/proto/wal.proto b/proto/wal.proto index 476b20e..91765d9 100644 --- a/proto/wal.proto +++ b/proto/wal.proto @@ -12,6 +12,9 @@ service WAL { // Status gets the statistics of the WAL file archive rpc Status(WALStatusRequest) returns (WALStatusResult) {} + // SetFirstRequired sets the first required WAL for the cluster + rpc SetFirstRequired(SetFirstRequiredRequest) returns (SetFirstRequiredResult) {} + // GetCapabilities gets the capabilities of the WAL service rpc GetCapabilities(WALCapabilitiesRequest) returns (WALCapabilitiesResult) {} } @@ -76,6 +79,21 @@ message WALStatusResult { map additionalInformation = 4; } +message SetFirstRequiredRequest { + // This field is REQUIRED. Value of this field is the name of + // the CNPG cluster for which the WAL should be archived + string clusterName = 1; + + // This field is REQUIRED. Value of this field is the name of the first + // required WAL in the WAL archive for this cluster (normally based on the + // begin WAL of the first available base backup for the cluster) + string firstRequiredWAL = 2; +} + +message SetFirstRequiredResult { + // Intentionally empty. +} + message WALCapabilitiesRequest { // Intentionally empty. } @@ -102,6 +120,10 @@ message WALCapability { // STATUS indicates that the Plugin is able to // reply to the Status RPC request STATUS = 3; + + // SET_FIRST_REQUIRED indicates that the Plugin is able to + // reply to the SetFirstRequired RPC request + SET_FIRST_REQUIRED = 4; } Type type = 1;