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

stack commented on HBASE-19972:
-------------------------------

I pushed this addendum:

diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSink.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSink.java
index fcce84fa1a..aa6c39cd53 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSink.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSink.java
@@ -1,4 +1,4 @@
-/**
+/*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -317,8 +317,8 @@ public class TestReplicationSink {
     Path dir = TEST_UTIL.getDataTestDirOnTestFS("testReplicateEntries");
     Path familyDir = new Path(dir, Bytes.toString(FAM_NAME1));
     int numRows = 10;
-
     List<Path> p = new ArrayList<>(1);
+    final String hfilePrefix = "hfile-";

     // 1. Generate 25 hfile ranges
     Random rng = new SecureRandom();
@@ -335,7 +335,7 @@ public class TestReplicationSink {
     FileSystem fs = dir.getFileSystem(conf);
     Iterator<Integer> numbersItr = numberList.iterator();
     for (int i = 0; i < 25; i++) {
-      Path hfilePath = new Path(familyDir, "hfile_" + i);
+      Path hfilePath = new Path(familyDir, hfilePrefix + i);
       HFileTestUtil.createHFile(conf, fs, hfilePath, FAM_NAME1, FAM_NAME1,
         Bytes.toBytes(numbersItr.next()), Bytes.toBytes(numbersItr.next()), 
numRows);
       p.add(hfilePath);
@@ -370,10 +370,10 @@ public class TestReplicationSink {
               
.append(Bytes.toString(TABLE_NAME1.getName())).append(Path.SEPARATOR)
               
.append(Bytes.toString(loadDescriptor.getEncodedRegionName().toByteArray()))
               
.append(Path.SEPARATOR).append(Bytes.toString(FAM_NAME1)).append(Path.SEPARATOR)
-              .append("hfile_" + i).toString();
+              .append(hfilePrefix + i).toString();
       String dst = baseNamespaceDir + Path.SEPARATOR + pathToHfileFromNS;
-
-      FileUtil.copy(fs, p.get(0), fs, new Path(dst), false, conf);
+      Path dstPath = new Path(dst);
+      FileUtil.copy(fs, p.get(0), fs, dstPath, false, conf);
     }

     entries.add(builder.build());

branch-2 and master have an extra test that writes hfiles in a form that is not 
kosher... The new test this patch added was failing because it would try to 
reenable table with the dirty bulk loaded files in it and fail. Fixed by making 
the filenames in bulk load test fit expected hfile name... Really, the test 
should cleanup after itself.

> Should rethrow  the RetriesExhaustedWithDetailsException when failed to apply 
> the batch in ReplicationSink
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-19972
>                 URL: https://issues.apache.org/jira/browse/HBASE-19972
>             Project: HBase
>          Issue Type: Bug
>          Components: Replication
>            Reporter: Zheng Hu
>            Assignee: Zheng Hu
>            Priority: Critical
>             Fix For: 1.5.0, 2.0.0-beta-2, 1.4.2
>
>         Attachments: HBASE-19972-branch-1.4.patch, HBASE-19972.v1.patch, 
> HBASE-19972.v1.patch
>
>
> As [~Apache9] said in HBASE-12091. 
> In ReplicationSink#batch,we swallow the RetriesExhaustedWithDetailsException 
> except 
> TableNotFoundException,   actually,  should rethrow the exception. 
> {code:java}
> try {
>       Connection connection = getConnection();
>       table = connection.getTable(tableName);
>       for (List<Row> rows : allRows) {
>         table.batch(rows);
>       }
>     } catch (RetriesExhaustedWithDetailsException rewde) {
>       for (Throwable ex : rewde.getCauses()) {
>         if (ex instanceof TableNotFoundException) {
>           throw new TableNotFoundException("'"+tableName+"'");
>         }
>       }
>     } 
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to