Обсуждение: Question on failure during cluster operation

Поиск
Список
Период
Сортировка

Question on failure during cluster operation

От
"Chris Hoover"
Дата:
Question,

I am wanting to run a cluster on the main table in all of our 200+ databases.  However, my manager wants to know what would happen if we suffer a major failure while the cluster is running.  If I am running a "cluster chosen_index on main_table", and the server crashes,  would the database come back up (assuming the crash did not corrupt the database drives), or would I be looking at a restore and roll forward?

I am very confident in the cluster, and have seen it improve our performance, but my boss is still a bit cautious after all the server issues we had on our old servers and I don't know for sure the correct answer.  I believe that the database would self recover like it does 99% of the time, and we would be back up running in a few minutes, but I need to know for sure.

So, what am I looking at if there is a major failure in the middle of a cluster operation?

Thanks,

Chris

RH 4.0
PG 8.1.3

Re: Question on failure during cluster operation

От
Tom Lane
Дата:
"Chris Hoover" <revoohc@gmail.com> writes:
> I am wanting to run a cluster on the main table in all of our 200+
> databases.  However, my manager wants to know what would happen if we suffer
> a major failure while the cluster is running.

Nothing.  CLUSTER is transaction-safe (at least since PG 7.1 or so)
because it writes new separate versions of the files that don't become
the "real thing" until commit.  Downside of this of course is you need
enough free disk space for 2 copies of the table and indexes.

If you did have a crash while running CLUSTER, there might be
unreferenced temporary files left laying around, which as things
currently stand would require manual cleanup if you wanted the disk
space back.  There wouldn't be any database corruption though.

            regards, tom lane