[HACKERS] check for missing tablespaces?

2009-05-31 Thread Andrew Dunstan
I am in the middle of helping a customer recover from a situation where a tablespace was missing when a machine was rebooted and postgres restarted, and I'm wondering if we should not have some sort of check for this on startup. Maybe we could check for the existence of the PG_VERSION file

Re: [HACKERS] check for missing tablespaces?

2009-05-31 Thread Stephen Frost
* Andrew Dunstan (and...@dunslane.net) wrote: I am in the middle of helping a customer recover from a situation where a tablespace was missing when a machine was rebooted and postgres restarted, and I'm wondering if we should not have some sort of check for this on startup. Maybe we

Re: [HACKERS] check for missing tablespaces?

2009-05-31 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: I am in the middle of helping a customer recover from a situation where a tablespace was missing when a machine was rebooted and postgres restarted, and I'm wondering if we should not have some sort of check for this on startup. Maybe we could

Re: [HACKERS] check for missing tablespaces?

2009-05-31 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan and...@dunslane.net writes: I am in the middle of helping a customer recover from a situation where a tablespace was missing when a machine was rebooted and postgres restarted, and I'm wondering if we should not have some sort of check for this on startup.

Re: [HACKERS] check for missing tablespaces?

2009-05-31 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: Tom Lane wrote: ... and do what? In general, I think I'd probably prefer normal database startup to fail if a tablespace is missing. That way I will know about it right then and can remedy it. This is something that is much more likely to happen

Re: [HACKERS] check for missing tablespaces?

2009-05-31 Thread Andrew Dunstan
Tom Lane wrote: So what you're imagining is * iterate through each symlink in $PGDATA/pg_tblspc * check that PG_VERSION exists (and has the right contents??) in each pointed-to directory * fail if not I guess this is reasonable, since we make a similar check for the core data directory

Re: [HACKERS] check for missing tablespaces?

2009-05-31 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: I'm not sure about the initdb reference - there won't be any tablespaces to check for during initdb, will there? No, but I think pg_tblspc/ itself might not be there either. Just a case to test your patch on ... regards, tom

Re: [HACKERS] check for missing tablespaces?

2009-05-31 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan and...@dunslane.net writes: I'm not sure about the initdb reference - there won't be any tablespaces to check for during initdb, will there? No, but I think pg_tblspc/ itself might not be there either. Just a case to test your patch on ...

Re: [HACKERS] check for missing tablespaces?

2009-05-31 Thread Andrew Chernow
Andrew Dunstan wrote: I am in the middle of helping a customer recover from a situation where a tablespace was missing when a machine was rebooted and postgres restarted, Have you uncovered why the tablespace when missing? and I'm wondering if we should not have some sort of check for this

Re: [HACKERS] check for missing tablespaces?

2009-05-31 Thread Andrew Chernow
Andrew Dunstan wrote: I am in the middle of helping a customer recover from a situation where a tablespace was missing when a machine was rebooted and postgres restarted, Have you uncovered why the tablespace went missing? and I'm wondering if we should not have some sort of check for this

Re: [HACKERS] check for missing tablespaces?

2009-05-31 Thread Andrew Dunstan
Andrew Chernow wrote: Andrew Dunstan wrote: I am in the middle of helping a customer recover from a situation where a tablespace was missing when a machine was rebooted and postgres restarted, Have you uncovered why the tablespace went missing? No. It's on a SAN, and I understand our

Re: [HACKERS] check for missing tablespaces?

2009-05-31 Thread Andrew Chernow
Anyway, from this POV all we really need to know is that the device hosting this tablespace failed to mount when the machine was rebooted, and then postgres restarted. Good to know postgresql had nothing to do with the missing data. I wasn't sure if it was user error, config problem or