Skip to content

Commit 9d0d750

Browse files
authored
Fix pipe permission retry and table parser progress (#17844) (#17848)
(cherry picked from commit eaa5bcb)
1 parent 1cb4bf2 commit 9d0d750

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

  • iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/writeback

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/writeback/WriteBackSink.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
package org.apache.iotdb.db.pipe.sink.protocol.writeback;
2121

2222
import org.apache.iotdb.common.rpc.thrift.TSStatus;
23+
import org.apache.iotdb.commons.exception.pipe.PipeRuntimeSinkNonReportTimeConfigurableException;
2324
import org.apache.iotdb.db.auth.AuthorityChecker;
2425
import org.apache.iotdb.db.conf.IoTDBDescriptor;
2526
import org.apache.iotdb.db.pipe.event.common.heartbeat.PipeHeartbeatEvent;
@@ -131,7 +132,8 @@ private void doTransfer(
131132
status = statement.isEmpty() ? RpcUtils.SUCCESS_STATUS : executeStatement(statement);
132133

133134
if (status.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
134-
throw new PipeException(
135+
throwWriteBackExceptionIfNecessary(
136+
status,
135137
String.format(
136138
"Transfer PipeInsertNodeTabletInsertionEvent %s error, result status %s",
137139
pipeInsertNodeTabletInsertionEvent, status));
@@ -162,13 +164,23 @@ private void doTransfer(final PipeRawTabletInsertionEvent pipeRawTabletInsertion
162164
statement.isEmpty() ? RpcUtils.SUCCESS_STATUS : executeStatement(statement);
163165

164166
if (status.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
165-
throw new PipeException(
167+
throwWriteBackExceptionIfNecessary(
168+
status,
166169
String.format(
167170
"Transfer PipeRawTabletInsertionEvent %s error, result status %s",
168171
pipeRawTabletInsertionEvent, status));
169172
}
170173
}
171174

175+
private static void throwWriteBackExceptionIfNecessary(
176+
final TSStatus status, final String exceptionMessage) {
177+
if (status.getCode() == TSStatusCode.NO_PERMISSION.getStatusCode()) {
178+
throw new PipeRuntimeSinkNonReportTimeConfigurableException(exceptionMessage, Long.MAX_VALUE);
179+
}
180+
181+
throw new PipeException(exceptionMessage);
182+
}
183+
172184
private TSStatus executeStatement(final InsertBaseStatement statement) {
173185
return Coordinator.getInstance()
174186
.executeForTreeModel(

0 commit comments

Comments
 (0)