From 408dbac00499f69bf581afc492491f0126478232 Mon Sep 17 00:00:00 2001 From: Priec Date: Sun, 9 Aug 2026 21:42:38 +0200 Subject: [PATCH] pgBackRest db backup --- common/proto/backup.proto | 13 --- common/src/proto/descriptor.bin | Bin 157801 -> 156984 bytes common/src/proto/komp_ac.backup.rs | 173 ----------------------------- server | 2 +- 4 files changed, 1 insertion(+), 187 deletions(-) diff --git a/common/proto/backup.proto b/common/proto/backup.proto index 38bebdad..181e44bc 100644 --- a/common/proto/backup.proto +++ b/common/proto/backup.proto @@ -8,8 +8,6 @@ service BackupService { rpc StartCheck(komp_ac.common.Empty) returns (BackupOperationResponse); rpc GetBackupInfo(komp_ac.common.Empty) returns (BackupInfoResponse); rpc GetOperationStatus(GetOperationStatusRequest) returns (BackupOperationResponse); - rpc RestoreLatest(RestoreLatestRequest) returns (BackupOperationResponse); - rpc RestoreTarget(RestoreTargetRequest) returns (BackupOperationResponse); } enum BackupType { @@ -23,7 +21,6 @@ enum OperationKind { OPERATION_KIND_UNSPECIFIED = 0; OPERATION_KIND_BACKUP = 1; OPERATION_KIND_CHECK = 2; - OPERATION_KIND_RESTORE = 3; } enum OperationStatus { @@ -37,16 +34,6 @@ message StartBackupRequest { BackupType backup_type = 1; } -message RestoreLatestRequest { - string confirmation = 1; -} - -message RestoreTargetRequest { - string confirmation = 1; - string target_type = 2; - string target = 3; -} - message GetOperationStatusRequest { string operation_id = 1; } diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index 469176c60d1a0996ac2f6a82753c24e0984db79f..457b8c20f4e988f9924509a7d86202f0e6b74b08 100644 GIT binary patch delta 1310 zcmX|=y>1gh6oqH*%sTeiNt{{#uI1pXU9X*YC4J4%S3{*S- z9W)@JyaMOW-r2^|r+d!1KePVxqw(!~n%-)r~wSJTzJRqFouCDSYIjz2T~w{VUU5TeP(t&&=2+z7b5dzLDA?boKDv67g(s^I#>YO7r^qqKqO@OOq8&V=t`74(}=Q25RN97 zA_R?{X`jj^PjgKxwc55O<&&=v`ugP##Xs mVi9?Vi|{8#4W&ET8UWv&Yz^X?Yz>0#?&EHzpLR2P_2xes4@`Oh delta 2058 zcmb7EO>Y}j6rFeHjcbq7*m-vR6+3ofS2Z*-`B3xW1T`rHsZb@An>CRe463TeA$1q5 zCM(#p@qb{0gpk5tfE9nENQl3{x$oT>kwq7*>@)YA^Ul5Z&HVO9=G~u}>tEI11^T@{ z{imR=qkdQ%jNVMfSEHxH3H}U5-@e6z|D!d{Fgt;0eKa|ne0Mpjko6Dw*=TZ#C#Dpp9IE)XCg|p(s6HXOR?}Zf>Z`h` zg{6~cM}x!DCnv{eUpzVf^lWhS{PbjSl=r8lvigyJ);B+u)mW{WFT=aHdNrNitMTj0 zv*CH~#qj*q+sodq^7LIrt^HT!x_qz7m07i(`92q>jP|_8({@#TsAi_eRrObt4Ry*R zZTyg)hBINnKmnx+F(RO1H%30t=I5c41;)=NvH-GdA`2kPCb9ssEM#FwfoJrrS5Wxx z2VMlxY>;EWz$4H2Ia=hS7@(A+YK-8Qt2cy*Ql83EQWlvQfta5!2@zl}Argpl6cdSS zQNlz*lQ4ZSO~UlSG$3+%W%RsPbLsiu`M}tt6o)U-l1%}CQipD1q6++A(^Ki_`Y*+4Pzdw$rwKZSPITwa*}B{0_}k--|wQe%#3Ybe*GXyUMQXiUDqUm(teHEw-DPj}iR3m8y-0;Xd#_a(3MA1F^HS zT@gC~*sX{iQN;OH#1BRIt-z0C*qN=mNicwJHPLb2)lAXGKn=3haz$hqS&!lpLDoxT zoU50~i422}{GKV;_`cEW-lmJsJ6KOISwEkz#)iZPfZvAr0fD$7>46YqL#CmPe&~Jd z?D&K7FpbYEy3%a7C3YJ9!*5IcPy=&I{D9!MCDYIxeOsmhfF*B}YXpdEdDk)!WZN "OPERATION_KIND_UNSPECIFIED", Self::Backup => "OPERATION_KIND_BACKUP", Self::Check => "OPERATION_KIND_CHECK", - Self::Restore => "OPERATION_KIND_RESTORE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -106,7 +90,6 @@ impl OperationKind { "OPERATION_KIND_UNSPECIFIED" => Some(Self::Unspecified), "OPERATION_KIND_BACKUP" => Some(Self::Backup), "OPERATION_KIND_CHECK" => Some(Self::Check), - "OPERATION_KIND_RESTORE" => Some(Self::Restore), _ => None, } } @@ -334,58 +317,6 @@ pub mod backup_service_client { ); self.inner.unary(req, path, codec).await } - pub async fn restore_latest( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic_prost::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/komp_ac.backup.BackupService/RestoreLatest", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("komp_ac.backup.BackupService", "RestoreLatest"), - ); - self.inner.unary(req, path, codec).await - } - pub async fn restore_target( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic_prost::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/komp_ac.backup.BackupService/RestoreTarget", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("komp_ac.backup.BackupService", "RestoreTarget"), - ); - self.inner.unary(req, path, codec).await - } } } /// Generated server implementations. @@ -429,20 +360,6 @@ pub mod backup_service_server { tonic::Response, tonic::Status, >; - async fn restore_latest( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn restore_target( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; } #[derive(Debug)] pub struct BackupServiceServer { @@ -701,96 +618,6 @@ pub mod backup_service_server { }; Box::pin(fut) } - "/komp_ac.backup.BackupService/RestoreLatest" => { - #[allow(non_camel_case_types)] - struct RestoreLatestSvc(pub Arc); - impl< - T: BackupService, - > tonic::server::UnaryService - for RestoreLatestSvc { - type Response = super::BackupOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::restore_latest(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = RestoreLatestSvc(inner); - let codec = tonic_prost::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/komp_ac.backup.BackupService/RestoreTarget" => { - #[allow(non_camel_case_types)] - struct RestoreTargetSvc(pub Arc); - impl< - T: BackupService, - > tonic::server::UnaryService - for RestoreTargetSvc { - type Response = super::BackupOperationResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::restore_target(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = RestoreTargetSvc(inner); - let codec = tonic_prost::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } _ => { Box::pin(async move { let mut response = http::Response::new( diff --git a/server b/server index 068cfbdb..8eedcdfa 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit 068cfbdba058645ae7035abc586a31a0f2dbf493 +Subproject commit 8eedcdfa344c7029e391a2665b0078c8ccead5b5