hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reidc...@apache.org
Subject [hbase] branch branch-2 updated: HBASE-22928 ScanMetrics counter update may not happen in case of exception in TableRecordReaderImpl
Date Mon, 02 Sep 2019 02:48:46 GMT
This is an automated email from the ASF dual-hosted git repository.

reidchan pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2 by this push:
     new 58319b8  HBASE-22928 ScanMetrics counter update may not happen in case of exception
in TableRecordReaderImpl
58319b8 is described below

commit 58319b8cc63495f1130a6d4918429eda21914f20
Author: Pankaj <pankaj.kr@huawei.com>
AuthorDate: Mon Sep 2 08:17:44 2019 +0530

    HBASE-22928 ScanMetrics counter update may not happen in case of exception in TableRecordReaderImpl
    
    Signed-off-by: Reid Chan <reidchan@apache.org>
---
 .../org/apache/hadoop/hbase/mapreduce/TableRecordReaderImpl.java    | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableRecordReaderImpl.java
b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableRecordReaderImpl.java
index 28f4da1..1fa943b 100644
--- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableRecordReaderImpl.java
+++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableRecordReaderImpl.java
@@ -77,6 +77,10 @@ public class TableRecordReaderImpl {
    * @throws IOException When restarting fails.
    */
   public void restart(byte[] firstRow) throws IOException {
+    // Update counter metrics based on current scan before reinitializing it
+    if (currentScan != null) {
+      updateCounters();
+    }
     currentScan = new Scan(scan);
     currentScan.withStartRow(firstRow);
     currentScan.setScanMetricsEnabled(true);
@@ -219,6 +223,7 @@ public class TableRecordReaderImpl {
       } catch (IOException e) {
         // do not retry if the exception tells us not to do so
         if (e instanceof DoNotRetryIOException) {
+          updateCounters();
           throw e;
         }
         // try to handle all other IOExceptions by restarting
@@ -257,6 +262,7 @@ public class TableRecordReaderImpl {
       updateCounters();
       return false;
     } catch (IOException ioe) {
+      updateCounters();
       if (logScannerActivity) {
         long now = System.currentTimeMillis();
         LOG.info("Mapper took " + (now-timestamp)


Mime
View raw message