diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index a25d539..885049d 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -7183,7 +7183,7 @@ log_heap_clean(Relation reln, Buffer buffer,
 	XLogRecPtr	recptr;
 
 	/* Caller should not call me on a non-WAL-logged relation */
-	Assert(RelationNeedsWAL(reln));
+	Assert(RelationNeedsWALKnownProblem(reln));
 
 	xlrec.latestRemovedXid = latestRemovedXid;
 	xlrec.nredirected = nredirected;
diff --git a/src/backend/access/heap/pruneheap.c b/src/backend/access/heap/pruneheap.c
index 1794cfd..5be469d 100644
--- a/src/backend/access/heap/pruneheap.c
+++ b/src/backend/access/heap/pruneheap.c
@@ -258,7 +258,7 @@ heap_page_prune(Relation relation, Buffer buffer, TransactionId OldestXmin,
 		/*
 		 * Emit a WAL XLOG_HEAP2_CLEAN record showing what we did
 		 */
-		if (RelationNeedsWAL(relation))
+		if (RelationNeedsWALKnownProblem(relation))
 		{
 			XLogRecPtr	recptr;
 
diff --git a/src/backend/access/nbtree/nbtsearch.c b/src/backend/access/nbtree/nbtsearch.c
index 8ff49ce..cfa72ce 100644
--- a/src/backend/access/nbtree/nbtsearch.c
+++ b/src/backend/access/nbtree/nbtsearch.c
@@ -67,7 +67,7 @@ _bt_drop_lock_and_maybe_pin(IndexScanDesc scan, BTScanPos sp)
 	LockBuffer(sp->buf, BUFFER_LOCK_UNLOCK);
 
 	if (IsMVCCSnapshot(scan->xs_snapshot) &&
-		RelationNeedsWAL(scan->indexRelation) &&
+		RelationNeedsWALKnownProblem(scan->indexRelation) &&
 		!scan->xs_want_itup)
 	{
 		ReleaseBuffer(sp->buf);
diff --git a/src/backend/catalog/storage.c b/src/backend/catalog/storage.c
index 0ed7c64..14fb36f 100644
--- a/src/backend/catalog/storage.c
+++ b/src/backend/catalog/storage.c
@@ -93,6 +93,8 @@ RelationCreateStorage(RelFileNode rnode, char relpersistence)
 	BackendId	backend;
 	bool		needs_wal;
 
+	PreventParallelWorker(); /* can't update pendingSyncHash */
+
 	switch (relpersistence)
 	{
 		case RELPERSISTENCE_TEMP:
@@ -376,6 +378,8 @@ RelationPreTruncate(Relation rel)
 {
 	pendingSync *pending;
 
+	PreventParallelWorker(); /* can't update pendingSyncHash */
+
 	if (!pendingSyncHash)
 		return;
 	RelationOpenSmgr(rel);
@@ -483,6 +487,8 @@ RelationCopyStorage(SMgrRelation src, SMgrRelation dst,
 bool
 RelFileNodeSkippingWAL(RelFileNode rnode)
 {
+	PreventParallelWorker(); /* can't read pendingSyncHash */
+
 	if (XLogIsNeeded())
 		return false;			/* no permanent relfilenode skips WAL */
 
diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c
index d82fc5a..ce43df7 100644
--- a/src/backend/optimizer/util/plancat.c
+++ b/src/backend/optimizer/util/plancat.c
@@ -126,7 +126,7 @@ get_relation_info(PlannerInfo *root, Oid relationObjectId, bool inhparent,
 	relation = table_open(relationObjectId, NoLock);
 
 	/* Temporary and unlogged relations are inaccessible during recovery. */
-	if (!RelationNeedsWAL(relation) && RecoveryInProgress())
+	if (!RelationNeedsWALKnownProblem(relation) && RecoveryInProgress())
 		ereport(ERROR,
 				(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
 				 errmsg("cannot access temporary or unlogged relations during recovery")));
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index 4f60979..ddda381 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -33,6 +33,7 @@
 #include <sys/file.h>
 #include <unistd.h>
 
+#include "access/parallel.h"
 #include "access/tableam.h"
 #include "access/xlog.h"
 #include "catalog/catalog.h"
@@ -3560,6 +3561,7 @@ MarkBufferDirtyHint(Buffer buffer, bool buffer_std)
 			 * See src/backend/storage/page/README for longer discussion.
 			 */
 			if (RecoveryInProgress() ||
+				IsParallelWorker() ||
 				RelFileNodeSkippingWAL(bufHdr->tag.rnode))
 				return;
 
diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h
index 461f64e..5aff26f 100644
--- a/src/include/utils/rel.h
+++ b/src/include/utils/rel.h
@@ -548,6 +548,20 @@ typedef struct ViewOptions
 		(relation)->rd_smgr->smgr_targblock = (targblock); \
 	} while (0)
 
+extern PGDLLIMPORT int ParallelWorkerNumber; /* can't include parallel.h */
+static inline int
+PreventParallelWorker(void)
+{
+	if (ParallelWorkerNumber >= 0)
+	{
+		ereport(LOG,
+				(errmsg_internal("nm0 invalid in parallel worker"),
+				 errbacktrace()));
+		return 0;
+	}
+	return 1;
+}
+
 /*
  * RelationNeedsWAL
  *		True if relation needs WAL.
@@ -557,6 +571,18 @@ typedef struct ViewOptions
  * RelFileNode" in src/backend/access/transam/README.
  */
 #define RelationNeedsWAL(relation)										\
+	(PreventParallelWorker(),											\
+	 (relation)->rd_rel->relpersistence == RELPERSISTENCE_PERMANENT &&	\
+	 (XLogIsNeeded() ||													\
+	  (relation->rd_createSubid == InvalidSubTransactionId &&			\
+	   relation->rd_firstRelfilenodeSubid == InvalidSubTransactionId)))
+
+/*
+ * Version that doesn't call PreventParallelWorker().  This is a temporary
+ * measure to avoid spamming logs about problem call sites that we already
+ * know about.
+ */
+#define RelationNeedsWALKnownProblem(relation)							\
 	((relation)->rd_rel->relpersistence == RELPERSISTENCE_PERMANENT &&	\
 	 (XLogIsNeeded() ||													\
 	  (relation->rd_createSubid == InvalidSubTransactionId &&			\
