MCPcopy Create free account
hub / github.com/apache/cloudberry / ParallelSlotsAdoptConn

Function ParallelSlotsAdoptConn

src/fe_utils/parallel_slot.c:431–441  ·  view source on GitHub ↗

* ParallelSlotsAdoptConn * Assign an open connection to the slots array for reuse. * * This turns over ownership of an open connection to a slots array. The * caller should not further use or close the connection. All the connection's * parameters (user, host, port, etc.) except possibly dbname should match * those of the slots array's cparams, as given in ParallelSlotsSetup. If * these

Source from the content-addressed store, hash-verified

429 * these parameters differ, subsequent behavior is undefined.
430 */
431void
432ParallelSlotsAdoptConn(ParallelSlotArray *sa, PGconn *conn)
433{
434 int offset;
435
436 offset = find_unconnected_slot(sa);
437 if (offset >= 0)
438 sa->slots[offset].connection = conn;
439 else
440 disconnectDatabase(conn);
441}
442
443/*
444 * ParallelSlotsTerminate

Callers 3

mainFunction · 0.85
vacuum_one_databaseFunction · 0.85
reindex_one_databaseFunction · 0.85

Calls 2

find_unconnected_slotFunction · 0.85
disconnectDatabaseFunction · 0.85

Tested by

no test coverage detected