Tuesday, July 14, 2015

GREENPLUM DB- WARNING: PID 1234 is not a PostgreSQL server process


In one of the GreenPlum databases I encountered the below issue while killing sessions belonging to a particular schema. I got the below warning message.

select pg_terminate_backend(pid) from (select distinct t.relname,l.pid from pg_locks l, pg_stat_all_tables t where l.relation=t.relid and t.schemaname = 'test') x;
WARNING: PID 1234 is not a PostgreSQL server process
WARNING: PID 1234 is not a PostgreSQL server process
WARNING: PID 1234 is not a PostgreSQL server process
WARNING: PID 1234 is not a PostgreSQL server process
WARNING: PID 1234 is not a PostgreSQL server process

I found it bit strange as it was showing some process as non PostgreSQL server process.When checked for that particular pid,we got the below output.

select * from pg_locks where pid='1234';
locktype | database | relation | page | tuple | transactionid | classid | objid | objsubid | transaction | pid | mode | granted | mppsessionid | mppiswriter | gp_segment_id
----------+----------+----------+------+-------+---------------+---------+-------+----------+-------------+-------+-----------------+---------+--------------+-------------+---------------
relation | 16992 | 5560001 | | | | | | | 0 | 1234 | AccessShareLock | t | 17261 | f | 27
relation | 16992 | 5565834 | | | | | | | 0 | 1234 | AccessShareLock | t | 17261 | f | 27
relation | 16992 | 5522075 | | | | | | | 0 | 1234 | AccessShareLock | t | 17261 | f | 27
relation | 16992 | 5527866 | | | | | | | 0 | 1234 | AccessShareLock | t | 17261 | f | 27
relation | 16992 | 5536419 | | | | | | | 0 | 1234 | AccessShareLock | t | 17261 | f | 27
relation | 16992 | 5514445 | | | | | | | 0 | 1234 | AccessShareLock | t | 17261 | f | 27
relation | 16992 | 5568505 | | | | | | | 0 | 1234 | AccessShareLock | t | 17261 | f | 27
relation | 16992 | 5523793 | | | | | | | 0 | 1234 | AccessShareLock | t | 17261 | f | 27
relation | 16992 | 5555297 | | | | | | | 0 | 1234 | AccessShareLock | t | 17261 | f | 27
(9 rows)

From the above we could find out that the process was running on segment 27 in one of the segment servers and we killed the same on the segment server. This was a SELECT zombie process and could not find any link to this. 

After killing the process we were able to kill the sessions belonging to the 'test' schema.We were not able to terminate this process using pg_terminate since this was running on the segment server and not on the master.

No comments:

Post a Comment