diff --git a/src/backend/catalog/storage.c b/src/backend/catalog/storage.c
index c06e414a38f..b814339a620 100644
--- a/src/backend/catalog/storage.c
+++ b/src/backend/catalog/storage.c
@@ -360,6 +360,8 @@ RelationTruncate(Relation rel, BlockNumber nblocks)
* failure to truncate, that might spell trouble at WAL replay, into a
* certain PANIC.
*/
+ START_CRIT_SECTION();
+
if (RelationNeedsWAL(rel))
{
/*
@@ -396,6 +398,8 @@ RelationTruncate(Relation rel, BlockNumber nblocks)
*/
smgrtruncate(RelationGetSmgr(rel), forks, nforks, blocks);
+ END_CRIT_SECTION();
+
/* We've done all the critical work, so checkpoints are OK now. */
MyProc->delayChkptFlags &= ~DELAY_CHKPT_COMPLETE;