Skip to content

Commit 97476bb

Browse files
committed
Merge branch 'master' of https://github.com/apache/iotdb into fix-audit-logger
2 parents 705f73d + f4d628a commit 97476bb

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/thrift/async/handler/PipeTransferTrackableHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public void onComplete(final TPipeTransferResp response) {
6464
public void onError(final Exception exception) {
6565
if (client != null) {
6666
ThriftClient.resolveException(exception, client);
67+
client.setPrintLogWhenEncounterException(false);
6768
}
6869

6970
if (connector.isClosed()) {

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/InsertTabletStatement.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
package org.apache.iotdb.db.queryengine.plan.statement.crud;
2121

2222
import org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot;
23+
import org.apache.iotdb.commons.conf.CommonDescriptor;
2324
import org.apache.iotdb.commons.exception.MetadataException;
2425
import org.apache.iotdb.commons.path.PartialPath;
2526
import org.apache.iotdb.commons.schema.table.column.TsTableColumnCategory;
@@ -702,11 +703,15 @@ protected void subRemoveAttributeColumns(List<Integer> columnsToKeep) {
702703

703704
@Override
704705
public String toString() {
706+
final int size = CommonDescriptor.getInstance().getConfig().getPathLogMaxSize();
705707
return "InsertTabletStatement{"
706708
+ "deviceIDs="
707709
+ Arrays.toString(deviceIDs)
708710
+ ", measurements="
709-
+ Arrays.toString(measurements)
711+
+ Arrays.toString(
712+
Objects.nonNull(measurements) && measurements.length > size
713+
? Arrays.copyOf(measurements, size)
714+
: measurements)
710715
+ ", rowCount="
711716
+ rowCount
712717
+ ", timeRange=["

iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncPipeDataTransferServiceClient.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class AsyncPipeDataTransferServiceClient extends IClientRPCService.AsyncC
4949
private static final AtomicInteger idGenerator = new AtomicInteger(0);
5050
private final int id = idGenerator.incrementAndGet();
5151

52-
private final boolean printLogWhenEncounterException;
52+
private boolean printLogWhenEncounterException;
5353

5454
private final TEndPoint endpoint;
5555
private final ClientManager<TEndPoint, AsyncPipeDataTransferServiceClient> clientManager;
@@ -85,6 +85,7 @@ public void onComplete() {
8585
public void onError(final Exception e) {
8686
super.onError(e);
8787
ThriftClient.resolveException(e, this);
88+
setPrintLogWhenEncounterException(false);
8889
returnSelf(
8990
(i) -> i instanceof IllegalStateException && "Client has an error!".equals(i.getMessage()));
9091
}
@@ -106,6 +107,10 @@ public boolean printLogWhenEncounterException() {
106107
return printLogWhenEncounterException;
107108
}
108109

110+
public void setPrintLogWhenEncounterException(final boolean printLogWhenEncounterException) {
111+
this.printLogWhenEncounterException = printLogWhenEncounterException;
112+
}
113+
109114
/**
110115
* return self, the method doesn't need to be called by the user and will be triggered after the
111116
* RPC is finished.

iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/receiver/PipeReceiverStatusHandler.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
import org.slf4j.Logger;
3636
import org.slf4j.LoggerFactory;
3737

38+
import javax.annotation.Nullable;
39+
3840
import java.util.Arrays;
3941
import java.util.Collections;
4042
import java.util.List;
@@ -106,7 +108,7 @@ public void handle(
106108
*/
107109
public void handle(
108110
final TSStatus status,
109-
final String exceptionMessage,
111+
final @Nullable String exceptionMessage,
110112
final String recordMessage,
111113
final boolean log4NoPrivileges) {
112114

@@ -206,7 +208,7 @@ public void handle(
206208
break;
207209
default:
208210
// Some auth error may be wrapped in other codes
209-
if (exceptionMessage.contains(NO_PERMISSION_STR)) {
211+
if (Objects.nonNull(exceptionMessage) && exceptionMessage.contains(NO_PERMISSION_STR)) {
210212
if (skipIfNoPrivileges) {
211213
if (log4NoPrivileges && LOGGER.isWarnEnabled()) {
212214
LOGGER.warn(

0 commit comments

Comments
 (0)