4 ms·
If a database is not kill -9 resistant then how can it be power-off resistant?
by IsTom 12y ago
If a database is not kill -9 resistant then how can it be power-off resistant?
- asdfaoeu 12y agoWho says it was?
- jeffdavis 12y agoThere are ways to misdesign a system such that it is power-off robust but not kill -9 robust. The reason is that power-off means everything dies. Postgres has special code to account for hard kills: it has a SYSV shared memory segment, to which every child attaches. If the parent dies, the children don't have a good way to know, so they might keep running. If you try to start a new postmaster and it sees that there are still processes attached to the shared memory segment (shm_nattch), it will fail to start. Were it not for that code, it would allow you to start a new parent process, leading to chaos as two sets of backends were accessing the same files and shared memory without knowing about eachother.