aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2019-11-07 16:31:36 +0900
committerFujii Masao <fujii@postgresql.org>2019-11-07 16:33:58 +0900
commit1accf997482122d69493f942a6aa89cf34b3fd75 (patch)
tree676c6f3c0f49d5440dbe7cbe56e520132980b41c
parent15d90a02a0cefbc89d9533287f904f2aea7034ed (diff)
downloadpostgresql-1accf997482122d69493f942a6aa89cf34b3fd75.tar.gz
postgresql-1accf997482122d69493f942a6aa89cf34b3fd75.zip
Fix assertion failure when running pgbench -s.
If there is the WAL page that the continuation WAL record just fits within (i.e., the continuation record ends just at the end of the page) and the LSN in such page is specified with -s option, previously pg_waldump caused an assertion failure. The cause of this assertion failure was that XLogFindNextRecord() that pg_waldump -s calls mistakenly handled such special WAL page. This commit changes XLogFindNextRecord() so that it can handle such WAL page correctly. Back-patch to all supported versions. Author: Andrey Lepikhov Reviewed-by: Fujii Masao, Michael Paquier Discussion: https://postgr.es/m/99303554-5dd5-06e6-f943-b3005ccd6edd@postgrespro.ru
-rw-r--r--src/backend/access/transam/xlogreader.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/access/transam/xlogreader.c b/src/backend/access/transam/xlogreader.c
index 4c28ea64e3b..5c5e92cbd6e 100644
--- a/src/backend/access/transam/xlogreader.c
+++ b/src/backend/access/transam/xlogreader.c
@@ -976,7 +976,7 @@ XLogFindNextRecord(XLogReaderState *state, XLogRecPtr RecPtr)
*
* Note that record headers are MAXALIGN'ed
*/
- if (MAXALIGN(header->xlp_rem_len) > (XLOG_BLCKSZ - pageHeaderSize))
+ if (MAXALIGN(header->xlp_rem_len) >= (XLOG_BLCKSZ - pageHeaderSize))
tmpRecPtr = targetPagePtr + XLOG_BLCKSZ;
else
{