PostgreSQL crash in CentOS/Redhat 07

I am using CentOS 7 with PostgreSQL 9.6. When I try to execute a job using the crontab or via ssh from another machine my PostgreSQL server is getting crashed.

FATAL:  semctl(1867782, 6, SETVAL, 0) failed: Invalid argument
LOG:  server process (PID 25979) exited with exit code 1
LOG:  terminating any other active server processes
WARNING:  terminating connection because of crash of another server process
DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and repeat your command.
LOG:  archiver process (PID 25096) exited with exit code 1
LOG:  all server processes terminated; reinitializing
LOG:  could not remove shared memory segment “/PostgreSQL.797133824”: No such file or directory
LOG:  semctl(1671168, 0, IPC_RMID, …) failed: Invalid argument
LOG:  semctl(1703937, 0, IPC_RMID, …) failed: Invalid argument
LOG:  semctl(1736706, 0, IPC_RMID, …) failed: Invalid argument
LOG:  semctl(1769475, 0, IPC_RMID, …) failed: Invalid argument
LOG:  semctl(1802244, 0, IPC_RMID, …) failed: Invalid argument
LOG:  semctl(1835013, 0, IPC_RMID, …) failed: Invalid argument
LOG:  semctl(1867782, 0, IPC_RMID, …) failed: Invalid argument
LOG:  semctl(1900551, 0, IPC_RMID, …) failed: Invalid argument
LOG:  database system was interrupted; last known up at 2018-04-02 11:35:51 IST
LOG:  database system was not properly shut down; automatic recovery in progress
LOG:  redo starts at 0/3000140
LOG:  invalid record length at 0/3000220: wanted 24, got 0
LOG:  redo done at 0/30001E8
LOG:  MultiXact member wraparound protections are now enabled


Solution:


From REDHAT/CENTOS – 07 


* logind will now automatically remove all IPC objects owned
  by a user if she or he fully logs out. This makes sure that
  users who are logged out cannot continue to consume IPC
  resources. This covers SysV memory, semaphores and message
  queues as well as POSIX shared memory and message
  queues. Traditionally, SysV and POSIX IPC had no life-cycle
  limits. With this functionality, that is corrected. This may
  be turned off by using the RemoveIPC= switch of logind.conf.

Removing the IPC objects cause the crash of PostgreSQL. To overcome this 
  
1) Set RemoveIPC=no in /etc/systemd/logind.conf

2) Reboot the server or restart systemd-logind as follows:
 # systemctl daemon-reload
 # systemctl restart systemd-logind

Reference :


In oracle database also this problem is there so in Oracle Linux this is configured by default(RemoveIPC=no).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s