foreverneverer commented on code in PR #1112:
URL: https://github.com/apache/incubator-pegasus/pull/1112#discussion_r947815671
##########
src/rdsn/src/common/backup.thrift:
##########
@@ -64,24 +64,28 @@ struct configuration_restore_request
9:optional string restore_path;
}
+// meta -> replica
struct backup_request
{
- 1:dsn.gpid pid;
- 2:policy_info policy;
- 3:string app_name;
- 4:i64 backup_id;
+ 1:dsn.gpid pid;
+ 2:string app_name;
+ 3:i64 backup_id;
+ 4:backup_status status;
+ 5:string backup_provider_type;
// user specified backup_path.
- 5:optional string backup_path;
+ 6:optional string backup_root_path;
}
struct backup_response
{
1:dsn.error_code err;
2:dsn.gpid pid;
- 3:i32 progress; // the progress of the cold_backup
- 4:string policy_name;
- 5:i64 backup_id;
- 6:i64 checkpoint_total_size;
+ 3:i64 backup_id;
+ 4:backup_status status;
+ 5:optional dsn.error_code checkpoint_err;
+ 6:optional dsn.error_code upload_err;
Review Comment:
With your design, the sender needs to judge the response as follows:
```c++
if (rpc == ok) {
if ( resp.err == ok) {
if (resp.checkpoint_err == ok) {
/** if you define `more clear err code as you say`, maybe
need:**/
/** if (err_a == ...) {
if (err_b == ...)
}
}
}
}
```
This logic is also redundant. don't suggest this design, you can refer the
origin rpc defination, I think the origin is elegant
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]