ColinLeeo commented on code in PR #18869:
URL: https://github.com/apache/iotdb/pull/18869#discussion_r4320799527
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/distribute/TableDistributedPlanGenerator.java:
##########
@@ -689,6 +689,12 @@ public List<PlanNode> visitGroup(GroupNode node,
PlanContext context) {
for (PlanNode child : childrenNodes) {
if (canSortEliminated(node.getOrderingScheme(),
nodeOrderingMap.get(child.getPlanNodeId()))) {
result.add(child);
+ } else if (groupingInvalidatedByCollect(
+ child, node.getOrderingScheme().getOrderBy().subList(0,
node.getPartitionKeyCount()))) {
+ SortNode sort =
+ new SortNode(queryId.genPlanNodeId(), child,
node.getOrderingScheme(), false, false);
+ nodeOrderingMap.put(sort.getPlanNodeId(), sort.getOrderingScheme());
+ result.add(sort);
Review Comment:
Agreed. Deregistration should detach pending requests from both indexes
without cancelling or completing their futures. This avoids triggering
admission listeners and preserves the owner’s ability to cancel through
tryCancel() and account for the pending bytes correctly.
The local fix follows this approach. Regression coverage uses a real
SourceHandle and checks abort(), abort(Throwable), and close() after forced
deregistration. Pool-level tests also cover unrelated queries freeing memory
and recreation of an FI with the same ID. All four regression tests fail on
788a995c75 and pass with the fix. The changes have not been pushed yet.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]