Use ereport instead of elog in adaptive executor

pull/2848/head
Marco Slot 2019-07-22 18:45:12 +02:00
parent bd111366b0
commit e2bc09838e
1 changed files with 21 additions and 15 deletions

View File

@ -1127,8 +1127,8 @@ CleanUpSessions(DistributedExecution *execution)
MultiConnection *connection = session->connection; MultiConnection *connection = session->connection;
elog(DEBUG4, "Total number of commands sent over the session %ld: %ld", ereport(DEBUG4, (errmsg("Total number of commands sent over the session %ld: %ld",
session->sessionId, session->commandsSent); session->sessionId, session->commandsSent)));
UnclaimConnection(connection); UnclaimConnection(connection);
@ -1176,8 +1176,8 @@ CleanUpSessions(DistributedExecution *execution)
* the connection and everything is cleared up. Otherwise, we'd have been * the connection and everything is cleared up. Otherwise, we'd have been
* on MULTI_CONNECTION_FAILED state. * on MULTI_CONNECTION_FAILED state.
*/ */
elog(WARNING, "unexpected transaction state at the end of execution: %d", ereport(WARNING, (errmsg("unexpected transaction state at the end of "
transactionState); "execution: %d", transactionState)));
} }
/* get ready for the next executions if we need use the same connection */ /* get ready for the next executions if we need use the same connection */
@ -1185,8 +1185,8 @@ CleanUpSessions(DistributedExecution *execution)
} }
else else
{ {
elog(WARNING, "unexpected connection state at the end of execution: %d", ereport(WARNING, (errmsg("unexpected connection state at the end of "
connection->connectionState); "execution: %d", connection->connectionState)));
} }
} }
} }
@ -1308,8 +1308,9 @@ AssignTasksToConnections(DistributedExecution *execution)
WorkerSession *session = WorkerSession *session =
FindOrCreateWorkerSession(workerPool, connection); FindOrCreateWorkerSession(workerPool, connection);
elog(DEBUG4, "Session %ld (%s:%d) has an assigned task", ereport(DEBUG4, (errmsg("Session %ld (%s:%d) has an assigned task",
session->sessionId, connection->hostname, connection->port); session->sessionId, connection->hostname,
connection->port)));
placementExecution->assignedSession = session; placementExecution->assignedSession = session;
@ -1442,7 +1443,8 @@ ExecutionOrderForTask(RowModifyLevel modLevel, Task *task)
case MERGE_FETCH_TASK: case MERGE_FETCH_TASK:
default: default:
{ {
elog(ERROR, "unsupported task type %d in adaptive executor", task->taskType); ereport(ERROR, (errmsg("unsupported task type %d in adaptive executor",
task->taskType)));
} }
} }
} }
@ -1879,8 +1881,8 @@ ManageWorkerPool(WorkerPool *workerPool)
return; return;
} }
elog(DEBUG4, "opening %d new connections to %s:%d", newConnectionCount, ereport(DEBUG4, (errmsg("opening %d new connections to %s:%d", newConnectionCount,
workerPool->nodeName, workerPool->nodePort); workerPool->nodeName, workerPool->nodePort)));
for (connectionIndex = 0; connectionIndex < newConnectionCount; connectionIndex++) for (connectionIndex = 0; connectionIndex < newConnectionCount; connectionIndex++)
{ {
@ -2143,8 +2145,10 @@ ConnectionStateMachine(WorkerSession *session)
ConnStatusType status = PQstatus(connection->pgConn); ConnStatusType status = PQstatus(connection->pgConn);
if (status == CONNECTION_OK) if (status == CONNECTION_OK)
{ {
elog(DEBUG4, "established connection to %s:%d for session %ld", ereport(DEBUG4, (errmsg("established connection to %s:%d for "
connection->hostname, connection->port, session->sessionId); "session %ld",
connection->hostname, connection->port,
session->sessionId)));
workerPool->activeConnectionCount++; workerPool->activeConnectionCount++;
workerPool->idleConnectionCount++; workerPool->idleConnectionCount++;
@ -2176,8 +2180,10 @@ ConnectionStateMachine(WorkerSession *session)
} }
else else
{ {
elog(DEBUG4, "established connection to %s:%d for session %ld", ereport(DEBUG4, (errmsg("established connection to %s:%d for "
connection->hostname, connection->port, session->sessionId); "session %ld",
connection->hostname, connection->port,
session->sessionId)));
workerPool->activeConnectionCount++; workerPool->activeConnectionCount++;
workerPool->idleConnectionCount++; workerPool->idleConnectionCount++;