1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

Move the responsibility of writing a "unlogged WAL operation" record from

heap_sync() to the callers, because heap_sync() is sometimes called even
if the operation itself is WAL-logged. This eliminates the bogus unlogged
records from CLUSTER that Simon Riggs reported, patch by Fujii Masao.
This commit is contained in:
Heikki Linnakangas
2010-02-03 10:01:30 +00:00
parent 808969d0e7
commit 9de778b24b
5 changed files with 32 additions and 11 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.284 2010/01/29 17:10:05 sriggs Exp $
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.285 2010/02/03 10:01:29 heikki Exp $
*
*
* INTERFACE ROUTINES
@ -5074,16 +5074,10 @@ heap2_desc(StringInfo buf, uint8 xl_info, char *rec)
void
heap_sync(Relation rel)
{
char reason[NAMEDATALEN + 30];
/* temp tables never need fsync */
if (rel->rd_istemp)
return;
snprintf(reason, sizeof(reason), "heap inserts on \"%s\"",
RelationGetRelationName(rel));
XLogReportUnloggedStatement(reason);
/* main heap */
FlushRelationBuffers(rel);
/* FlushRelationBuffers will have opened rd_smgr */