You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-issues@hadoop.apache.org by "Stamatis Zampetakis (Jira)" <ji...@apache.org> on 2021/11/17 16:05:00 UTC

[jira] [Commented] (MAPREDUCE-7368) DBOutputFormat.DBRecordWriter#write must throw exception when it fails

    [ https://issues.apache.org/jira/browse/MAPREDUCE-7368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17445328#comment-17445328 ] 

Stamatis Zampetakis commented on MAPREDUCE-7368:
------------------------------------------------

One example showing the impact of this can be seen in HIVE-25717. The problem can easily go unnoticed when the exception is not propagated.

> DBOutputFormat.DBRecordWriter#write must throw exception when it fails
> ----------------------------------------------------------------------
>
>                 Key: MAPREDUCE-7368
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-7368
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>    Affects Versions: 3.3.1
>            Reporter: Stamatis Zampetakis
>            Priority: Major
>
> When the [DBRecordWriter#write|https://github.com/apache/hadoop/blob/91af256a5b44925e5dfdf333293251a19685ba2a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/db/DBOutputFormat.java#L120] fails with an {{SQLException}} the problem is not propagated but printed in {{System.err}} instead. 
> {code:java}
> public void write(K key, V value) throws IOException {
>       try {
>         key.write(statement);
>         statement.addBatch();
>       } catch (SQLException e) {
>         e.printStackTrace();
>       }
>     }
> {code}
> The consumer of this API has no way to tell that the write failed. Moreover, the exception is not present in the logs which makes the problem very hard debug and can easily lead to data corruption since clients can easily assume that everything went well.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: mapreduce-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: mapreduce-issues-help@hadoop.apache.org