提交 a5d8860c 编写于 作者: H Heikki Linnakangas

Remove redundant 'numPrimaryConns' field.

It was always set to same value as 'numConns'. I guess there was some idea
of also connecting to mirrors with the interconnect, but that hasn't been
used for a long time.
上级 eae000eb
......@@ -612,7 +612,7 @@ TeardownInterconnect(ChunkTransportState *transportStates,
*
* motNodeID - motion node ID for this ChunkTransportState.
*
* numPrimaryConns - number of primary connections for this motion node.
* numConns - number of primary connections for this motion node.
* All are incoming if this is a receiving motion node.
* All are outgoing if this is a sending motion node.
*
......@@ -625,7 +625,7 @@ ChunkTransportStateEntry *
createChunkTransportState(ChunkTransportState *transportStates,
Slice *sendSlice,
Slice *recvSlice,
int numPrimaryConns)
int numConns)
{
ChunkTransportStateEntry *pEntry;
int motNodeID;
......@@ -667,8 +667,7 @@ createChunkTransportState(ChunkTransportState *transportStates,
pEntry->valid = true;
pEntry->motNodeId = motNodeID;
pEntry->numConns = numPrimaryConns;
pEntry->numPrimaryConns = numPrimaryConns;
pEntry->numConns = numConns;
pEntry->scanStart = 0;
pEntry->sendSlice = sendSlice;
pEntry->recvSlice = recvSlice;
......
......@@ -122,7 +122,7 @@ getMotionConn(ChunkTransportStateEntry *pEntry, int iConn)
{
Assert(pEntry);
Assert(pEntry->conns);
Assert(iConn < pEntry->numConns + pEntry->numPrimaryConns);
Assert(iConn < pEntry->numConns);
return pEntry->conns + iConn;
}
......@@ -592,8 +592,7 @@ startOutgoingConnections(ChunkTransportState *transportStates,
/*
* Setup a MotionConn entry for each of our outbound connections. Request
* a connection to each receiving backend's listening port. NB: Some
* mirrors could be down & have no CdbProcess entry.
* a connection to each receiving backend's listening port.
*/
conn = pEntry->conns;
......@@ -2209,9 +2208,8 @@ dumpEntryConnections(int elevel, ChunkTransportStateEntry *pEntry)
pEntry->motNodeId, i);
else
elog(elevel, "... motNodeId=%d conns[%d]: "
"%s%d pid=%d sockfd=%d remote=%s local=%s",
"%d pid=%d sockfd=%d remote=%s local=%s",
pEntry->motNodeId, i,
(i < pEntry->numPrimaryConns) ? "seg" : "mir",
conn->remoteContentId,
conn->cdbProc ? conn->cdbProc->pid : 0,
conn->sockfd,
......
......@@ -6742,10 +6742,10 @@ dumpConnections(ChunkTransportStateEntry *pEntry, const char *fname)
FILE *ofile = fopen(fname, "w+");
fprintf(ofile, "Entry connections: conn num %d \n", pEntry->numPrimaryConns);
fprintf(ofile, "Entry connections: conn num %d \n", pEntry->numConns);
fprintf(ofile, "==================================\n");
for (i = 0; i < pEntry->numPrimaryConns; i++)
for (i = 0; i < pEntry->numConns; i++)
{
conn = &pEntry->conns[i];
......
......@@ -317,10 +317,9 @@ typedef struct ChunkTransportStateEntry
int motNodeId;
bool valid;
/* Connection array: first the primaries, then the mirrors (if needed) */
/* Connection array */
MotionConn *conns;
int numConns; /* all, including mirrors if present */
int numPrimaryConns; /* does not include mirrors */
int numConns;
/*
* used for receiving. to select() from a set of interesting MotionConns
......
......@@ -299,7 +299,7 @@ extern void putTransportDirectBuffer(ChunkTransportState *transportStates,
extern ChunkTransportStateEntry *createChunkTransportState(ChunkTransportState *transportStates,
Slice *sendSlice,
Slice *recvSlice,
int numPrimaryConns);
int numConns);
extern ChunkTransportStateEntry *removeChunkTransportState(ChunkTransportState *transportStates,
int16 motNodeID);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册