Skip to content

Commit 5fcfbcc

Browse files
committed
patch bufferedMutator deals exception
1 parent 25f6b26 commit 5fcfbcc

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

src/main/java/com/alipay/oceanbase/hbase/util/OHBufferedMutatorImpl.java

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -275,15 +275,11 @@ private void execute(boolean flushAll) throws IOException {
275275
// if commit all successfully, clean execBuffer
276276
execBuffer.clear();
277277
} catch (Exception ex) {
278-
LOGGER.error(LCD.convert("01-00026"), ex);
279-
if (ex.getCause() instanceof RetriesExhaustedWithDetailsException) {
280-
LOGGER.error(tableName + ": One or more of the operations have failed after retries.");
281-
RetriesExhaustedWithDetailsException retryException = (RetriesExhaustedWithDetailsException) ex.getCause();
282-
// recollect failed mutations
283-
execBuffer.clear();
284-
for (int i = 0; i < retryException.getNumExceptions(); ++i) {
285-
execBuffer.add((Mutation) retryException.getRow(i));
286-
}
278+
// do not recollect error operations, notify outside
279+
LOGGER.error("error happens, table name: {}", tableName.getNameAsString(), ex);
280+
if (ex instanceof RetriesExhaustedWithDetailsException) {
281+
LOGGER.error("TableName: {}, One or more of the operations have failed after retries.", tableName.getNameAsString(), ex);
282+
RetriesExhaustedWithDetailsException retryException = (RetriesExhaustedWithDetailsException) ex;
287283
if (listener != null) {
288284
listener.onException(retryException, this);
289285
} else {
@@ -293,13 +289,6 @@ private void execute(boolean flushAll) throws IOException {
293289
LOGGER.error("Errors unrelated to operations occur during mutation operation", ex);
294290
throw ex;
295291
}
296-
} finally {
297-
for (Mutation mutation : execBuffer) {
298-
long size = mutation.heapSize();
299-
currentAsyncBufferSize.addAndGet(size);
300-
asyncWriteBuffer.add(mutation);
301-
undealtMutationCount.incrementAndGet();
302-
}
303292
}
304293
}
305294

0 commit comments

Comments
 (0)