Doris-Breakwater commented on issue #71468:
URL: https://github.com/apache/doris/issues/71468#issuecomment-7449564268

   The reported behavior matches a server-side Arrow Flight SQL correctness 
bug. With `enable_parallel_result_sink=true`, a query can fail on one BE while 
another endpoint returns its full partition and ends successfully. The report 
observed successful EOF on the peer in 25 of 27 runs. I verified the failure 
path in source at `bb33ea1dbd` and `10e3ba56a0`. The runtime results are from 
the supplied reproduction.
   
   **What the code confirms**
   
   - On master, the ordinary OLAP Flight path saves the BE cancellation route 
after dispatch, closes the coordinator, and unregisters the query. Branch 4.1 
does the same through `FlightSqlChannel`. When a BE execution error arrives 
after unregister, `QeProcessorImpl.reportExecStatus` acknowledges the ordinary 
report with `OK` and skips the coordinator's error handling. That leaves the 
peer buffer free to finish normally. [Master 
dispatch](https://github.com/apache/doris/blob/bb33ea1dbd/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java#L1923-L1953),
 [master 
unregister](https://github.com/apache/doris/blob/bb33ea1dbd/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java#L862-L867),
 [master status 
handler](https://github.com/apache/doris/blob/bb33ea1dbd/fe/fe-core/src/main/java/org/apache/doris/qe/QeProcessorImpl.java#L314-L325),
 [4.1 
dispatch](https://github.com/apache/doris/blob/10e3ba56a0/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java#L1541-L1566
 ), [4.1 status 
handler](https://github.com/apache/doris/blob/10e3ba56a0/fe/fe-core/src/main/java/org/apache/doris/qe/QeProcessorImpl.java#L303-L312)
   - A read error can also trigger the existing early-close fan-out with a 
generic cancellation reason. The 4.1 revision removes cancelled buffers and 
returns the reported missing-schema error on a subsequent lookup. Master 
retains the status supplied at removal, so it can return that status for a 
later `DoGet`. This retention still depends on which status reaches the BE. [BE 
reader](https://github.com/apache/doris/blob/bb33ea1dbd/be/src/service/arrow_flight/arrow_flight_batch_reader.cpp#L167-L181),
 [early-close 
fan-out](https://github.com/apache/doris/blob/bb33ea1dbd/fe/fe-core/src/main/java/org/apache/doris/arrowflight/FlightSqlQueryCancellation.java#L150-L164),
 [4.1 buffer 
lookup](https://github.com/apache/doris/blob/10e3ba56a0/be/src/runtime/result_buffer_mgr.cpp#L124-L132),
 [master buffer 
cancellation](https://github.com/apache/doris/blob/bb33ea1dbd/be/src/runtime/result_buffer_mgr.cpp#L175-L199),
 [#70676](https://github.com/apache/doris/pull/70676), [#70850 
follow-up](https://g
 ithub.com/apache/doris/issues/70850)
   
   **Patch and validation**
   
   - Please open the proposed PR. Reuse the existing query-cancel RPC to carry 
the original execution status to every BE. Look up the retained Flight route by 
execution query ID. The current lookup is keyed by result ID, which matches the 
query ID in parallel mode and uses an instance ID in nonparallel mode. Make 
repeat reports and cancellation feedback idempotent, account for route removal 
by early-close cancellation, and preserve successful `FINISHED` and 
`LIMIT_REACH` handling. A 4.1 backport also needs to preserve the error for 
`DoGet` opened after buffer removal. [Result ID 
selection](https://github.com/apache/doris/blob/bb33ea1dbd/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java#L585-L598),
 [cancel 
RPC](https://github.com/apache/doris/blob/bb33ea1dbd/be/src/service/internal_service.cpp#L670-L700)
   - Add a deterministic two-BE regression that injects the failure after 
tickets are issued and FE unregister completes. Check `boom 12345` on an active 
sibling stream before it reaches EOF and on a sibling opened after 
cancellation. Exercise failure fan-out without reading the failed endpoint 
first, then test that reading it first preserves the execution error and that a 
genuine client abort still cleans up. A stream that has already returned EOF 
cannot be changed by a later cancellation.
   - Please include the client library and version and a minimal 
endpoint-reading script in the PR. One correlated trace for a failing query ID 
would establish FE receipt after unregister and the cancellation ordering on 
both BEs. Include ticket issuance, the FE report status, each BE's first cancel 
reason, and the terminal status from each `DoGet`.
   
   Breakwater-GitHub-Analysis-Slot: slot_fcdefd374217
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to