DieterDP-ng commented on code in PR #8847:
URL: https://github.com/apache/hbase/pull/8847#discussion_r4565120523


##########
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/BackupCopyJob.java:
##########
@@ -49,4 +50,6 @@ int copy(BackupInfo backupInfo, BackupManager backupManager, 
Configuration conf,
    * @throws IOException if cancelling the jobs fails
    */
   void cancel(String jobHandler) throws IOException;
+
+  Optional<Throwable> getError();

Review Comment:
   Not a fan of this, it's better to actually use the Exception-throwing 
capabilities of the existing methods.
   
   - Full backups: add an `Exception` field to `SnapshotCopy` and an override 
on `doWork()` that captures & stores the `Exception`.
   - Incrementals: Add a `Throwable` field to `BackupDistCp`, fill it where you 
now fill the `Optional`.
   - In `MapReduceBackupCopyJob#copy`, check if either has an error, throw it.



##########
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/FullTableBackupClient.java:
##########
@@ -147,8 +147,10 @@ protected void snapshotCopy(BackupInfo backupInfo) throws 
IOException {
       if (res != 0) {
         LOG.error("Exporting Snapshot " + args[1] + " failed with return code: 
" + res + ".");
 
-        throw new IOException("Failed of exporting snapshot " + args[1] + " to 
" + args[3]
-          + " with reason code " + res);
+        String message =
+          "Failed of exporting snapshot " + args[1] + " to " + args[3] + " 
with reason code " + res;
+        throw copyService.getError().map(e -> new IOException(message, e))

Review Comment:
   This won't work as you intend - `SnapshotCopy.run()` ends up in 
`AbstractHBaseTool.run()`, where any `Exception` is swallowed.



-- 
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]

Reply via email to