diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index 274426950a62a122482a43bfde2f23da822c18c5..7002b3752e8c4a8a9f056651814a8edc32a86ff6 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -405,7 +405,7 @@ class EventsStore(SQLBaseStore):
 
                 for room_id, latest_event_ids in new_forward_extremeties.iteritems():
                     self.get_latest_event_ids_in_room.prefill(
-                        (room_id,), latest_event_ids
+                        (room_id,), list(latest_event_ids)
                     )
 
     @defer.inlineCallbacks