diff --git a/native/cpp/CommonCpp/grpc/protos/backup.proto b/native/cpp/CommonCpp/grpc/protos/backup.proto --- a/native/cpp/CommonCpp/grpc/protos/backup.proto +++ b/native/cpp/CommonCpp/grpc/protos/backup.proto @@ -20,7 +20,7 @@ service BackupService { rpc CreateNewBackup(stream CreateNewBackupRequest) returns (stream CreateNewBackupResponse) {} - rpc SendLog(stream SendLogRequest) returns (google.protobuf.Empty) {} + rpc SendLog(stream SendLogRequest) returns (SendLogResponse) {} rpc RecoverBackupKey(stream RecoverBackupKeyRequest) returns (stream RecoverBackupKeyResponse) {} rpc PullBackup(PullBackupRequest) returns (stream PullBackupResponse) {} } @@ -52,6 +52,10 @@ } } +message SendLogResponse { + string logCheckpoint = 1; +} + // RecoverBackupKey message RecoverBackupKeyRequest { diff --git a/services/backup/src/BackupServiceImpl.h b/services/backup/src/BackupServiceImpl.h --- a/services/backup/src/BackupServiceImpl.h +++ b/services/backup/src/BackupServiceImpl.h @@ -21,7 +21,7 @@ grpc::ServerReadReactor *SendLog( grpc::CallbackServerContext *context, - google::protobuf::Empty *response) override; + backup::SendLogResponse *response) override; grpc::ServerBidiReactor< backup::RecoverBackupKeyRequest, diff --git a/services/backup/src/BackupServiceImpl.cpp b/services/backup/src/BackupServiceImpl.cpp --- a/services/backup/src/BackupServiceImpl.cpp +++ b/services/backup/src/BackupServiceImpl.cpp @@ -27,7 +27,7 @@ grpc::ServerReadReactor *BackupServiceImpl::SendLog( grpc::CallbackServerContext *context, - google::protobuf::Empty *response) { + backup::SendLogResponse *response) { return new reactor::SendLogReactor(response); } diff --git a/services/backup/src/Reactors/server/SendLogReactor.h b/services/backup/src/Reactors/server/SendLogReactor.h --- a/services/backup/src/Reactors/server/SendLogReactor.h +++ b/services/backup/src/Reactors/server/SendLogReactor.h @@ -15,7 +15,7 @@ class SendLogReactor : public ServerReadReactorBase< backup::SendLogRequest, - google::protobuf::Empty> { + backup::SendLogResponse> { enum class State { USER_ID = 1, BACKUP_ID = 2, @@ -52,7 +52,7 @@ void initializePutReactor(); public: - using ServerReadReactorBase:: + using ServerReadReactorBase:: ServerReadReactorBase; std::unique_ptr diff --git a/services/backup/src/Reactors/server/SendLogReactor.cpp b/services/backup/src/Reactors/server/SendLogReactor.cpp --- a/services/backup/src/Reactors/server/SendLogReactor.cpp +++ b/services/backup/src/Reactors/server/SendLogReactor.cpp @@ -63,6 +63,7 @@ } this->backupID = request.backupid(); this->logID = this->generateLogID(this->backupID); + this->response->set_logcheckpoint(this->logID); this->state = State::LOG_HASH; return nullptr; };