openGauss 由於 RemoveIPC 未關閉導致資料庫 crash
semop 引發的資料庫 crash
--主庫
FATAL:semop(id=xxxxx) failed: Identifier removed
FATAL: semctl(xxxxxx,11,SETVAL,0) failed: Invalid argument
--備庫
FATAL: semctl(xxxxxx,11,SETVAL,0) failed: Invalid argument
LOG: server process (ThreadId xxxxxx) was terminated by signal 1: Hangup
LOG: terminating any other active server processess
LOG: server process (THREADId xxxx) exited with exit code 0
LOG: the server process exits
--原因
在centos7.2中,systemd-logind 服務引入了一個新特性,該新特性是:當一個user 完全退出os之後,remove掉所有的IPC objects。該特性由/etc/systemd/logind.conf,引數檔案中RemoveIPC選項來控制。在centos7.2中,RemoveIPC的預設值為yes,因此,當最後一個MogDB/openGauss使用者退出時,作業系統會remove 掉這個user的shared memory segments and semaphores
解決方法
echo "RemoveIPC=no" >> /etc/systemd/logind.conf
systemctl restart systemd-logind