diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index e22bdacbba..d8523f37b2 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -1168,7 +1168,8 @@ RecordTransactionCommit(void) * Note that at this stage we have marked clog, but still show as running * in the procarray and continue to hold locks. */ - SyncRepWaitForLSN(XactLastRecEnd); + if (wrote_xlog) + SyncRepWaitForLSN(XactLastRecEnd); /* Reset XactLastRecEnd until the next transaction writes something */ XactLastRecEnd.xrecoff = 0;