PR: https://github.com/greenplum-db/gpdb/pull/12550
Crash:
Stack trace on QD:
ExecMotionUnsortedReceiver()
gets called after interconnect is torn down. See mppExecFinishup()
.
Plan:
Notice we there is a Gather Motion below Shared Scan.
See ExecSquelchShareInputScan()
and commit 9fbd2da
Plan:
7X
6X:
Without this commit, this query hangs on 6X, but does not hang on 7X. This query does not hang on 7X because by the time the producer slice gets to ExecSquelchShareInputScan()
, local_state->ready
is alreay set in a prevous call to init_tuplestore_state()
via ExecShareInputScan()
A case that leads to wrong result if w/o commit 9fbd2da (now added to shared_scan
test)
https://github.com/greenplum-db/gpdb/pull/12550#discussion_r711195354
Greenplum supports three interconnect protocols: TCP, UDP and Proxy(if enable_ic_proxy
is configured). UDP by default. Can be set by GUC gp_interconnect_type
.
Relavent functions:
On QD:
On QD and all QE segments:
Called by standard_ExecutorStart()
and ExecSetParamPlan()
. The former is the usual entry point of ExectutorStart (on both QD and QE), the latter is for Planner's InitPlan/SubPlan only.
The main purpose of this function is for the QD and each QE process to setup TCP/UDP connection(s) between itself and its sender(child) processes (correspond to the receiving motion on this slice) and its receiver(parent) process (correspond to the sending motion on this slice).
This function creates a ChunkTransportStateEntry
, which stores all information of a given motion node.
This is a good function to break on to observe how each connection is setup on a QD or QE process. Since each process would only be working on one slice, this founction should be called at most N + 1 (N sender/child slices and 1 receiver/parent slice) times on each process.
Question: Can a slice have multiple prarent/receiving slices?
Note: ChunkTransportStateEntry
stores information for a givin Motion, each Motion could have multiple MotionConn
s. For example, in a 3 segment cluster, the numConns
of a Broadcast Motion would be 3. The conns
array is stored in ChunkTransportStateEntry
.
Toy query:
break on createChunkTransportState()
on the QD process and an arbitary QE process and observe sendSlice
and recvSlice
.
The counterpart of SetupInterconnect()
. Called at mppExecutorFinishup()
, ExecSetParamPlan()
, mappExecutorCleanup()
and other cleanup handling places.
The counterpart of createChunkTransportState()