add_modbuf_flag.diff
application/octet-stream
Filename: add_modbuf_flag.diff
Type: application/octet-stream
Part: 0
Patch
Format: unified
| File | + | − |
|---|---|---|
| src/backend/access/hash/hash_xlog.c | 10 | 2 |
diff --git a/src/backend/access/hash/hash_xlog.c b/src/backend/access/hash/hash_xlog.c
index cb1a63cfee..6e9bd70c8a 100644
--- a/src/backend/access/hash/hash_xlog.c
+++ b/src/backend/access/hash/hash_xlog.c
@@ -666,6 +666,7 @@ hash_xlog_squeeze_page(XLogReaderState *record)
char *data;
Size datalen;
uint16 ninserted = 0;
+ bool mod_buf = false;
data = begin = XLogRecGetBlockData(record, 1, &datalen);
@@ -695,6 +696,8 @@ hash_xlog_squeeze_page(XLogReaderState *record)
ninserted++;
}
+
+ mod_buf = true;
}
/*
@@ -711,10 +714,15 @@ hash_xlog_squeeze_page(XLogReaderState *record)
HashPageOpaque writeopaque = HashPageGetOpaque(writepage);
writeopaque->hasho_nextblkno = xldata->nextblkno;
+ mod_buf = true;
}
- PageSetLSN(writepage, lsn);
- MarkBufferDirty(writebuf);
+ /* Set LSN and mark writebuf dirty iff it is modified */
+ if (mod_buf)
+ {
+ PageSetLSN(writepage, lsn);
+ MarkBufferDirty(writebuf);
+ }
}
/* replay the record for initializing overflow buffer */