From 0cb91ccba93038c57a7dda6388c9f6bcd5cc52c0 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 8 Dec 2006 19:50:53 +0000 Subject: Remove the logId/logSeg fields from pg_control, because they are not needed in normal operation, and we can avoid rewriting pg_control at every log segment switch if we don't insist that these values be valid. Reducing the number of pg_control updates is a good idea for both performance and reliability. It does make pg_resetxlog's life a bit harder, but that seems a good tradeoff; and anyway the change to pg_resetxlog amounts to automating something people formerly needed to do by hand, namely look at the existing pg_xlog files to make sure the new WAL start point was past them. In passing, change the wording of xlog.c's "database system was interrupted" messages: describe the pg_control timestamp as "last known up at" rather than implying it is the exact time of service interruption. With this change the timestamp will generally be the time of the last checkpoint, which could be many minutes before the failure; and we've already seen indications that people tend to misinterpret the old wording. initdb forced due to change in pg_control layout. Simon Riggs and Tom Lane --- doc/src/sgml/ref/pg_resetxlog.sgml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/pg_resetxlog.sgml b/doc/src/sgml/ref/pg_resetxlog.sgml index 11d5d1eef63..c1c9754368f 100644 --- a/doc/src/sgml/ref/pg_resetxlog.sgml +++ b/doc/src/sgml/ref/pg_resetxlog.sgml @@ -1,5 +1,5 @@ @@ -72,7 +72,7 @@ PostgreSQL documentation -f can still be used, but the recovered database must be treated with even more suspicion than usual: an immediate dump and reload is imperative. Do not - execute any data-modifying operations in the database before you dump; + execute any data-modifying operations in the database before you dump, as any such action is likely to make the corruption worse. @@ -127,7 +127,7 @@ PostgreSQL documentation The WAL starting address (-l) should be - larger than any file name currently existing in + larger than any WAL segment file name currently existing in the directory pg_xlog under the data directory. These names are also in hexadecimal and have three parts. The first part is the timeline ID and should usually be kept the same. @@ -139,6 +139,18 @@ PostgreSQL documentation 000000010000003A000000FF, choose -l 0x1,0x3B,0x0 or more. + + + + pg_resetxlog itself looks at the files in + pg_xlog and chooses a default -l setting + beyond the last existing file name. Therefore, manual adjustment of + -l should only be needed if you are aware of WAL segment + files that are not currently present in pg_xlog, such as + entries in an offline archive; or if the contents of + pg_xlog have been lost entirely. + + -- cgit v1.2.3