diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c new file mode 100644 index 70d2570..33d0123 *** a/src/backend/access/transam/xlog.c --- b/src/backend/access/transam/xlog.c *************** XLogSetAsyncXactLSN(XLogRecPtr asyncXact *** 2624,2634 **** */ if (!sleeping) { /* back off to last completed page boundary */ WriteRqstPtr -= WriteRqstPtr % XLOG_BLCKSZ; ! /* if we have already flushed that far, we're done */ ! if (WriteRqstPtr <= LogwrtResult.Flush) return; } --- 2624,2638 ---- */ if (!sleeping) { + int flushbytes; /* back off to last completed page boundary */ WriteRqstPtr -= WriteRqstPtr % XLOG_BLCKSZ; ! flushbytes = ! WriteRqstPtr / XLOG_BLCKSZ - LogwrtResult.Flush / XLOG_BLCKSZ; ! ! /* if we don't have enough to flush, we're done */ ! if (flushbytes < WalWriterFlushAfter) return; }