diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index a05b6a07ad0..6698262e202 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -6108,6 +6108,7 @@ heap_prepare_freeze_tuple(HeapTupleHeader tuple,
 
 	/* Process xmin */
 	xid = HeapTupleHeaderGetXmin(tuple);
+	if (xid == FrozenTransactionId)
 	xmin_frozen = ((xid == FrozenTransactionId) ||
 				   HeapTupleHeaderXminFrozen(tuple));
 	if (TransactionIdIsNormal(xid))
diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index ce024101fc9..98f26e13627 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -3344,6 +3344,8 @@ reindex_index(Oid indexId, bool skip_constraint_checks, char persistence,
 		/* Suppress use of the target index while rebuilding it */
 		SetReindexProcessing(heapId, indexId);
 
+		CommandCounterIncrement();
+
 		/* Initialize the index and rebuild */
 		/* Note: we do not need to re-establish pkey setting */
 		index_build(heapRelation, iRel, indexInfo, true, true);
diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c
index e9add1b9873..f0a4bac75f6 100644
--- a/src/backend/commands/sequence.c
+++ b/src/backend/commands/sequence.c
@@ -315,6 +315,7 @@ ResetSequence(Oid seq_relid)
 	 * Create a new storage file for the sequence.
 	 */
 	RelationSetNewRelfilenode(seq_rel, seq_rel->rd_rel->relpersistence);
+	CommandCounterIncrement();
 
 	/*
 	 * Ensure sequence's relfrozenxid is at 0, since it won't contain any
@@ -490,6 +491,7 @@ AlterSequence(ParseState *pstate, AlterSeqStmt *stmt)
 		 * changes transactional.
 		 */
 		RelationSetNewRelfilenode(seqrel, seqrel->rd_rel->relpersistence);
+		CommandCounterIncrement();
 
 		/*
 		 * Ensure sequence's relfrozenxid is at 0, since it won't contain any
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index f6c9cf3b0ec..eef922d8718 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -1791,6 +1791,8 @@ ExecuteTruncateGuts(List *explicit_rels, List *relids, List *relids_logged,
 				table_close(toastrel, NoLock);
 			}
 
+			CommandCounterIncrement();
+
 			/*
 			 * Reconstruct the indexes to match, and we're done.
 			 */
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index 90ff8ccf54f..2bdfb2d5a9c 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -3541,7 +3541,7 @@ RelationSetNewRelfilenode(Relation relation, char persistence)
 	 * Make the pg_class row change visible, as well as the relation map
 	 * change if any.  This will cause the relcache entry to get updated, too.
 	 */
-	CommandCounterIncrement();
+	//CommandCounterIncrement();
 
 	/*
 	 * Mark the rel as having been given a new relfilenode in the current
