| 304 | |
| 305 | |
| 306 | static TupleTableSlot * |
| 307 | execMotionUnsortedReceiver(MotionState *node) |
| 308 | { |
| 309 | /* RECEIVER LOGIC */ |
| 310 | TupleTableSlot *slot; |
| 311 | MinimalTuple tuple; |
| 312 | Motion *motion = (Motion *) node->ps.plan; |
| 313 | EState *estate = node->ps.state; |
| 314 | |
| 315 | AssertState(motion->motionType == MOTIONTYPE_GATHER || |
| 316 | motion->motionType == MOTIONTYPE_GATHER_SINGLE || |
| 317 | motion->motionType == MOTIONTYPE_HASH || |
| 318 | motion->motionType == MOTIONTYPE_BROADCAST || |
| 319 | motion->motionType == MOTIONTYPE_BROADCAST_WORKERS || |
| 320 | (motion->motionType == MOTIONTYPE_EXPLICIT && motion->segidColIdx > 0)); |
| 321 | |
| 322 | Assert(node->ps.state->motionlayer_context); |
| 323 | |
| 324 | if (node->stopRequested) |
| 325 | { |
| 326 | SendStopMessage(node->ps.state->motionlayer_context, |
| 327 | node->ps.state->interconnect_context, |
| 328 | motion->motionID); |
| 329 | return NULL; |
| 330 | } |
| 331 | |
| 332 | if (estate->interconnect_context == NULL) |
| 333 | { |
| 334 | if (!estate->es_interconnect_is_setup && estate->dispatcherState && |
| 335 | !estate->es_got_eos) |
| 336 | { |
| 337 | /* |
| 338 | * We could only possibly get here in the following scenario: |
| 339 | * 1. We are QD gracefully aborting a transaction. |
| 340 | * 2. We have torn down the interconnect of the current slice. |
| 341 | * 3. Since an error has happened, we no longer need to finish fetching |
| 342 | * all the tuples, hence squelching the executor subtree. |
| 343 | * 4. We are in the process of ExecSquelchShareInputScan(), and the |
| 344 | * Shared Scan has this Motion below it. |
| 345 | * |
| 346 | * NB: if you need to change this, see also execMotionSortedReceiver() |
| 347 | */ |
| 348 | ereport(NOTICE, |
| 349 | (errmsg("An ERROR must have happened. Stopping a Shared Scan."))); |
| 350 | return NULL; |
| 351 | } |
| 352 | else |
| 353 | ereport(ERROR, (errmsg("Interconnect is down unexpectedly."))); |
| 354 | } |
| 355 | |
| 356 | tuple = RecvTupleFrom(node->ps.state->motionlayer_context, |
| 357 | node->ps.state->interconnect_context, |
| 358 | motion->motionID, ANY_ROUTE); |
| 359 | |
| 360 | if (!tuple) |
| 361 | { |
| 362 | #ifdef CDB_MOTION_DEBUG |
| 363 | if (gp_log_interconnect >= GPVARS_VERBOSITY_DEBUG) |
no test coverage detected