From 6ebba3cf2356be46200592ac3c3eb4b4b0d0e420 Mon Sep 17 00:00:00 2001 From: tedyu Date: Fri, 13 Oct 2017 08:38:14 -0700 Subject: [PATCH] HBASE-18998 processor.getRowsToLock() always assumes there is some row being locked --- .../hadoop/hbase/regionserver/HRegion.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java index 559ac958da6..14fbd7f0896 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java @@ -7279,10 +7279,10 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi try { processor.process(now, region, mutations, walEdit); } catch (IOException e) { + String row = processor.getRowsToLock().isEmpty() ? "" : + " on row(s):" + Bytes.toStringBinary(processor.getRowsToLock().iterator().next()) + "..."; LOG.warn("RowProcessor:" + processor.getClass().getName() + - " throws Exception on row(s):" + - Bytes.toStringBinary( - processor.getRowsToLock().iterator().next()) + "...", e); + " throws Exception" + row, e); throw e; } return; @@ -7296,10 +7296,10 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi processor.process(now, region, mutations, walEdit); return null; } catch (IOException e) { + String row = processor.getRowsToLock().isEmpty() ? "" : + " on row(s):" + Bytes.toStringBinary(processor.getRowsToLock().iterator().next()) + "..."; LOG.warn("RowProcessor:" + processor.getClass().getName() + - " throws Exception on row(s):" + - Bytes.toStringBinary( - processor.getRowsToLock().iterator().next()) + "...", e); + " throws Exception" + row, e); throw e; } } @@ -7308,9 +7308,9 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi try { task.get(timeout, TimeUnit.MILLISECONDS); } catch (TimeoutException te) { - LOG.error("RowProcessor timeout:" + timeout + " ms on row(s):" + - Bytes.toStringBinary(processor.getRowsToLock().iterator().next()) + - "..."); + String row = processor.getRowsToLock().isEmpty() ? "" : + " on row(s):" + Bytes.toStringBinary(processor.getRowsToLock().iterator().next()) + "..."; + LOG.error("RowProcessor timeout:" + timeout + " ms" + row); throw new IOException(te); } catch (Exception e) { throw new IOException(e);