1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// SPDX-License-Identifier: BUSL-1.1
//! Physical-plan execution trait for leader-based request routing.
//!
//! [`PlanExecutor`]: the physical-plan execution path introduced in C-β.
//! The legacy [`RequestForwarder`] SQL-string path was deleted in C-δ.6.
use crate;
// ── Physical-plan execution (C-β) ────────────────────────────────────────────
/// Sink for streamed result chunks driven by [`PlanExecutor::execute_plan_streaming`].
///
/// The transport server provides a `ChunkSink` whose `send_chunk` writes one
/// `RPC_EXECUTE_STREAM_CHUNK` envelope to the QUIC stream and awaits the write
/// inline, so QUIC flow control back-pressures the producer (the local stream
/// pull) when the coordinator falls behind.
///
/// `send_chunk` returning `Err` means the client / coordinator is gone (the
/// stream was reset or finished early): the producer MUST stop pulling and
/// return without writing a terminal frame.
///
/// `read_version_lsn` is that frame's per-collection read version (its scanned
/// collection's `coll_write_lsn` at read time), distinct from the core-global
/// `watermark_lsn`. The shuffle fan-out sink max-folds it so the producer can
/// report the observed read version for cross-shard OCC validation; the plain
/// `ExecuteStream` sink (which only carries `watermark_lsn` on the wire) ignores
/// it.
/// Trait for executing a pre-planned `PhysicalPlan` on the local Data Plane.
///
/// Implemented in `nodedb/src/control/exec_receiver.rs` by `LocalPlanExecutor`.
/// The cluster RPC handler calls this when it receives an `ExecuteRequest`.
///
/// Responsibilities:
/// 1. Validate that `deadline_remaining_ms > 0`.
/// 2. For each `DescriptorVersionEntry`, verify the local descriptor version matches.
/// 3. Decode `plan_bytes` via `nodedb::bridge::physical_plan::wire::decode`.
/// 4. Dispatch through the local SPSC bridge.
/// 5. Collect response payloads.
/// 6. Map errors to `TypedClusterError`.
/// No-op executor for single-node mode or testing.
;