Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ public TSStatus visitRelationalInsertRows(RelationalInsertRowsNode node, DataReg
public TSStatus visitInsertRow(InsertRowNode node, DataRegion dataRegion) {
try {
dataRegion.insert(node);
dataRegion.insertSeparatorToWAL(node);
return StatusUtils.OK;
} catch (OutOfTTLException e) {
LOGGER.warn(DataNodeMiscMessages.ERROR_EXECUTING_PLAN_NODE_CAUSED, node, e.getMessage());
Expand All @@ -104,7 +103,6 @@ public TSStatus visitRelationalInsertTablet(
public TSStatus visitInsertTablet(final InsertTabletNode node, final DataRegion dataRegion) {
try {
dataRegion.insertTablet(node);
dataRegion.insertSeparatorToWAL(node);
return StatusUtils.OK;
} catch (final OutOfTTLException e) {
LOGGER.debug(DataNodeMiscMessages.ERROR_EXECUTING_PLAN_NODE_CAUSED, node, e.getMessage());
Expand Down Expand Up @@ -144,7 +142,6 @@ public TSStatus visitInsertTablet(final InsertTabletNode node, final DataRegion
public TSStatus visitInsertRows(InsertRowsNode node, DataRegion dataRegion) {
try {
dataRegion.insert(node);
dataRegion.insertSeparatorToWAL(node);
return StatusUtils.OK;
} catch (WriteProcessRejectException e) {
LOGGER.warn(DataNodeMiscMessages.REJECT_EXECUTING_PLAN_NODE, node, e.getMessage());
Expand Down Expand Up @@ -184,7 +181,6 @@ public TSStatus visitInsertRows(InsertRowsNode node, DataRegion dataRegion) {
public TSStatus visitInsertMultiTablets(InsertMultiTabletsNode node, DataRegion dataRegion) {
try {
dataRegion.insertTablets(node);
dataRegion.insertSeparatorToWAL(node);
return StatusUtils.OK;
} catch (WriteProcessRejectException e) {
LOGGER.warn(DataNodeMiscMessages.REJECT_EXECUTING_PLAN_NODE, node, e.getMessage());
Expand Down Expand Up @@ -222,7 +218,6 @@ public TSStatus visitInsertRowsOfOneDevice(
InsertRowsOfOneDeviceNode node, DataRegion dataRegion) {
try {
dataRegion.insert(node);
dataRegion.insertSeparatorToWAL(node);
return StatusUtils.OK;
} catch (WriteProcessRejectException e) {
LOGGER.warn(DataNodeMiscMessages.REJECT_EXECUTING_PLAN_NODE, node, e.getMessage());
Expand Down Expand Up @@ -284,6 +279,8 @@ public TSStatus visitDeleteData(DeleteDataNode node, DataRegion dataRegion) {
}
dataRegion.insertSeparatorToWAL(node);
return StatusUtils.OK;
} catch (WriteProcessRejectException e) {
return RpcUtils.getStatus(e.getErrorCode(), e.getMessage());
} catch (IOException | IllegalPathException e) {
LOGGER.error(DataNodeMiscMessages.ERROR_EXECUTING_PLAN_NODE, node, e);
return new TSStatus(TSStatusCode.WRITE_PROCESS_ERROR.getStatusCode());
Expand All @@ -297,8 +294,9 @@ public TSStatus visitDeleteData(
final RelationalDeleteDataNode node, final DataRegion dataRegion) {
try {
dataRegion.deleteByTable(node);
dataRegion.insertSeparatorToWAL(node);
return StatusUtils.OK;
} catch (final WriteProcessRejectException e) {
return RpcUtils.getStatus(e.getErrorCode(), e.getMessage());
} catch (final IOException e) {
LOGGER.error(DataNodeMiscMessages.ERROR_EXECUTING_PLAN_NODE, node, e);
return new TSStatus(TSStatusCode.WRITE_PROCESS_ERROR.getStatusCode());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ protected TSStatus write(PlanNode planNode) {
TSStatus result = null;
int retryTime = 0;
while (retryTime < MAX_WRITE_RETRY_TIMES) {
result = executeWrite(planNode);
result = planNode.accept(new DataExecutionVisitor(), region);
// Let pipe retry with the original event instead of retrying a possibly mutated node here.
if (needRetryForSpecificCases(result.getCode(), planNode)) {
retryTime++;
Expand Down Expand Up @@ -284,10 +284,6 @@ protected TSStatus write(PlanNode planNode) {
return result;
}

protected TSStatus executeWrite(PlanNode planNode) {
return planNode.accept(new DataExecutionVisitor(), region);
}

protected void waitBeforeNextWriteRetry() throws InterruptedException {
Thread.sleep(WRITE_RETRY_WAIT_TIME_IN_MS);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,6 @@ public IoTConsensusDataRegionStateMachine(DataRegion region) {
super(region);
}

@Override
protected TSStatus executeWrite(PlanNode planNode) {
final DataRegion targetRegion = region;
return targetRegion.executeIoTConsensusWrite(
() -> planNode.accept(new DataExecutionVisitor(), targetRegion));
}

@Override
public TSStatus write(IConsensusRequest request) {
try {
Expand Down
Loading
Loading