diff --git a/src/backend/storage/freespace/freespace.c b/src/backend/storage/freespace/freespace.c
index d3f207b..567745b 100644
--- a/src/backend/storage/freespace/freespace.c
+++ b/src/backend/storage/freespace/freespace.c
@@ -97,7 +97,18 @@ typedef struct
 /* Address of the root page. */
 static const FSMAddress FSM_ROOT_ADDRESS = {FSM_ROOT_LEVEL, 0};
 
-/* Local map of block numbers for small heaps with no FSM. */
+/*
+ * For small relations, we don't create FSM to save space, instead we use
+ * local in-memory map of pages to try.  To locate free space, we simply try
+ * pages directly without knowing ahead of time how much free space they have.
+ * To maintain good performance, we only mark every other page as available
+ * in this map.
+ *
+ * Note that this map is used to the find the block with required free space
+ * for any given relation.  We clear this map when we have found a block with
+ * enough free space, when we extend the relation, or on transaction abort.
+ * See src/backend/storage/freespace/README for further details.
+ */
 typedef struct
 {
 	BlockNumber nblocks;
@@ -1175,5 +1186,13 @@ fsm_local_search(void)
 			return target_block;
 	} while (target_block > 0);
 
+	/*
+	 * If we didn't find any available block to try in the local map, then
+	 * clear it.  This prevents us to use the map again without setting it
+	 * first which would otherwise lead to the same conclusion again and
+	 * again.
+	 */
+	FSMClearLocalMap();
+
 	return InvalidBlockNumber;
 }
