hycdong commented on code in PR #1129: URL: https://github.com/apache/incubator-pegasus/pull/1129#discussion_r953386981
########## src/rdsn/src/meta/meta_backup_engine.cpp: ########## @@ -179,6 +179,86 @@ void meta_backup_engine::backup_app_partition(const gpid &pid) }); } +// ThreadPool: THREAD_POOL_DEFAULT +void meta_backup_engine::on_backup_reply(const error_code err, + const backup_response &response, + const gpid &pid, + const rpc_address &primary) +{ + { + zauto_read_lock l(_lock); + if (_is_backup_failed) { + derror_f("partition[{}] handle backup failed", pid); + return; + } + + // TODO(heyuchen): check if backup canceled + } + + auto rep_error = err == ERR_OK ? response.err : err; + if (rep_error != ERR_OK) { + derror_f( + "backup_id({}): receive backup response for partition {} from server {}, error = {}", + _cur_backup.backup_id, + pid.to_string(), + primary.to_string(), + rep_error); + handle_replica_backup_failed(pid.get_app_id()); + return; + } + + if (response.backup_id != _cur_backup.backup_id) { + dwarn_f("backup_id({}): receive outdated backup response(backup_id={}) for partition {} " + "from server {}, ignore it", + _cur_backup.backup_id, + response.backup_id, + pid.to_string(), + primary.to_string()); + retry_backup(pid); + return; + } + + if (response.__isset.checkpoint_upload_err) { Review Comment: No. -- 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: dev-unsubscr...@pegasus.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@pegasus.apache.org For additional commands, e-mail: dev-h...@pegasus.apache.org