Skip to content

Commit 1382d2e

Browse files
authored
[Distributed] fix the plan index miss (apache#3007)
1 parent 34f2b17 commit 1382d2e

3 files changed

Lines changed: 28 additions & 0 deletions

File tree

server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertMultiTabletPlan.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,15 @@ public void deserialize(ByteBuffer buffer) throws IllegalPathException {
281281
}
282282
}
283283

284+
@Override
285+
public void setIndex(long index) {
286+
super.setIndex(index);
287+
for (InsertTabletPlan insertTabletPlan : insertTabletPlanList) {
288+
// use the InsertMultiTabletPlan's index as the sub InsertTabletPlan's index
289+
insertTabletPlan.setIndex(index);
290+
}
291+
}
292+
284293
@Override
285294
public String toString() {
286295
return "InsertMultiTabletPlan{"

server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertRowsOfOneDevicePlan.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,15 @@ public void deserialize(ByteBuffer buffer) throws IllegalPathException {
131131
}
132132
}
133133

134+
@Override
135+
public void setIndex(long index) {
136+
super.setIndex(index);
137+
for (InsertRowPlan plan : rowPlans) {
138+
// use the InsertRowsOfOneDevicePlan's index as the sub InsertRowPlan's index
139+
plan.setIndex(index);
140+
}
141+
}
142+
134143
@Override
135144
public String toString() {
136145
return "deviceId: " + deviceId + ", times: " + rowPlans.length;

server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertRowsPlan.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import java.util.Objects;
3636

3737
public class InsertRowsPlan extends InsertPlan {
38+
3839
/**
3940
* Suppose there is an InsertRowsPlan, which contains 5 InsertRowPlans,
4041
* insertRowPlanList={InsertRowPlan_0, InsertRowPlan_1, InsertRowPlan_2, InsertRowPlan_3,
@@ -184,6 +185,15 @@ public void deserialize(ByteBuffer buffer) throws IllegalPathException {
184185
}
185186
}
186187

188+
@Override
189+
public void setIndex(long index) {
190+
super.setIndex(index);
191+
for (InsertRowPlan insertRowPlan : insertRowPlanList) {
192+
// use the InsertRowsPlan's index as the sub InsertRowPlan's index
193+
insertRowPlan.setIndex(index);
194+
}
195+
}
196+
187197
public Map<Integer, TSStatus> getResults() {
188198
return results;
189199
}

0 commit comments

Comments
 (0)