Gabriel39 commented on code in PR #70708:
URL: https://github.com/apache/doris/pull/70708#discussion_r4662171557
##########
be/src/exec/pipeline/pipeline_task.cpp:
##########
@@ -266,6 +266,19 @@ Status PipelineTask::_open() {
SCOPED_CPU_TIMER(_task_cpu_timer);
SCOPED_TIMER(_open_timer);
_dry_run = _sink->should_dry_run(_state);
+ RETURN_IF_ERROR(_extract_dependencies());
Review Comment:
Addressed by removing the MongoDB-specific PipelineTask startup gate
entirely in 4a5e8c2669da9fa8c3bfddf5a6e4e8affce8ec7b. Both pipeline_task.cpp
and pipeline_task_test.cpp now match the PR merge base (3b476bd0d0e8) exactly.
The added pre-open extraction and its second extraction are gone, so this PR no
longer publishes the uninitialized group-commit sink dependencies described
here.
Independent probe/build progress is handled by scan-scoped MongoDB client
pools instead: query ID, fragment instance ID and scan output tuple isolate
admission. The existing post-open dependency lifecycle remains intact. The
scan-isolation revision passed 111 related ASAN reader/native-stream,
ScannerContext and PipelineTask tests. No new GroupCommit lifecycle change or
synthetic workaround is included.
##########
fe/fe-connector/fe-connector-mongodb/src/main/java/org/apache/doris/connector/mongodb/MongoScanPlanProvider.java:
##########
@@ -109,8 +127,113 @@ public List<ConnectorScanRange> planScan(ConnectorSession
session, ConnectorScan
// Include complete source roots so pruning cannot turn malformed
nested paths into missing values.
d.setProjectionBson(encode(projection));
}
- // One cursor owns the entire logical namespace. Filters and LIMIT
remain Doris residuals.
- return List.of(new MongoScanRange(d));
+ // A scan node owns this provider and admits its final request once.
Properties loading
+ // must not freeze a smaller pre-filter reservation that later rejects
a legitimate query.
+ long descriptorSize = descriptorBytes(session, handle, d);
+ MongoSplitPlan plan = rangePlanner.plan(session, handle, snapshot,
d.getReadPreference(),
+ request.getScanContext(), descriptorSize);
+ // Properties can be cached before WHERE and projection are attached.
Publish diagnostics
+ // from the same final request as the descriptor, without probing
again during EXPLAIN.
+ rangePlanner.freezeDiagnostics(session, handle,
Map.of("predicate_pushdown", predicate.kind().name(),
+ "projection_pushdown",
Boolean.toString(d.isSetProjectionBson())));
+ // Retain the shared descriptor once; streaming creates owned RPC
values under engine backpressure.
+ // A wide schema must not be copied 256 times merely to keep a frozen
boundary table in FE.
+ return new AbstractList<>() {
+ @Override
+ public ConnectorScanRange get(int index) {
+ java.util.Objects.checkIndex(index, plan.size());
+ MongoRangePlanner.checkCancelled(session,
request.getScanContext());
+ TMongoScanDesc range = d.deepCopy();
+ TMongoSplit split = new TMongoSplit();
+ split.setStrategy(plan.family().isEmpty() ? "single" :
"range");
+ split.setField(plan.field());
+ split.setTypeFamily(plan.family());
+ split.setIndex(index);
+ split.setRequested(plan.requested());
+ split.setAdmitted(plan.admitted());
+ split.setActual(plan.size());
+ split.setReason(plan.reason());
Review Comment:
Not addressed in this PR, as explicitly requested for the review follow-up.
No BE capability gating or version-1 fallback has been added for rolling
upgrades.
Matching FE/BE builds remain required for opt-in version-2 range scans; a
mixed-version deployment can reject those scans on an older BE. The default
single strategy retains version-1 descriptors. This limitation remains explicit
in the PR's Compatibility section and is intentionally left unresolved here.
##########
fe/fe-connector/fe-connector-mongodb/src/main/java/org/apache/doris/connector/mongodb/MongoSnapshot.java:
##########
@@ -41,6 +42,7 @@ final class MongoSnapshot {
static TMongoSnapshot prepare(ConnectorSession session,
MongoCatalogProperties properties,
MongoTableHandle table, Supplier<MongoCatalogClient> client,
String concern,
String preference, long timeoutMs) {
Review Comment:
Fixed in cc8dbd21321e8bce12d19308e7be4894ff438876. The request's scan
context now reaches MongoSnapshot.prepare, source discovery and timestamp
selection. Cancellation/deadline checks surround hello, replica-set/mongos
identity discovery, session creation, cursor creation and hasNext, and run
before completing the shared timestamp. A stopped scan therefore cannot start
the next source operation or publish a timestamp selected by cancelled work
while the query schedulers remain open.
Shared-pin waiters also check their own cancellation at intervals of at most
100 ms without cancelling another scan's selection. Nested resource scopes
preserve cursor-before-session cleanup on cancellation. An already-running
synchronous driver call still finishes under its original CSOT deadline; this
change does not close a cursor concurrently with that call.
Both new planning tests fail on the baseline (selection still runs after
source cancellation; cancelled selection still publishes T) and pass with the
fix. All 174 MongoDB FE tests and 166 upstream connector SPI tests pass.
Recording-driver tests cover the replica-set/mongos command boundaries and
cleanup; a concurrent test keeps the owner blocked while a cancelled waiter
exits and the owner's pin remains usable. Full FE Checkstyle passes. Live
MongoDB integration and remote CI have not been rerun for this FE-only
increment.
--
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]