return NULL;
}
-/*
- * returns true if the conInfo object belongs to the current child process
- */
-bool pool_is_my_coninfo(ConnectionInfo* connInfo)
-{
- int pool;
- ProcessInfo *pi = pool_get_my_process_info();
- for (pool = 0; pool < pool_config->max_pool; pool++)
- {
- int backend_id;
- for (backend_id = 0; backend_id < NUM_BACKENDS; backend_id++)
- {
- int poolBE = pool*MAX_NUM_BACKENDS+backend_id;
- ConnectionInfo* cInfo = &pi->connection_info[poolBE];
- if (cInfo == connInfo)
- {
- ereport(DEBUG1,
- (errmsg("connection Info object is local")));
- return true;
- }
- }
- }
- return false;
-}
-
/*
* sets the flag to mark that the connection will be terminated by the
* backend and it should not be considered as a backend node failure.
extern void pool_coninfo_unset_frontend_connected(int proc_id, int pool_index);
extern ConnectionInfo* pool_coninfo_backend_pid(int backend_pid, int* backend_node_id);
-extern bool pool_is_my_coninfo(ConnectionInfo* connInfo);
extern void pool_set_connection_will_be_terminated(ConnectionInfo* connInfo);
extern void pool_unset_connection_will_be_terminated(ConnectionInfo* connInfo);
(errmsg("found the pg_terminate_backend request for backend pid:%d on backend node:%d",backend_pid,backend_node),
errdetail("setting the connection flag")));
- if (pool_is_my_coninfo(conn)){
- ereport(LOG,
- (errmsg("pg_terminate_backend refer to the current child process connection"),
- errdetail("setting the connection flag not required")));
- }
- else{
- pool_set_connection_will_be_terminated(conn);
- }
+ pool_set_connection_will_be_terminated(conn);
/* It was the pg_terminate_backend call so send the query to appropriate backend */
query_context->pg_terminate_backend_conn = conn;
pool_force_query_node_to_backend(query_context, backend_node);