mirror: Don't start migrating until the allocation map is built

There is a fun race that can happen if we begin migrating while the
allocation map is still building. We call bitset_enable_stream()
when the migration begins, which causes the builder to start putting
events into the stream. This is bad all by itself, as it slows the
migration down for no reason, but the stream is a limited-size queue
and there are situations (migration fails and is restarted) where we
can end up with the queue full and nobody able to empty it, freezing
the whole thing.
This commit is contained in:
nick
2013-10-23 15:58:47 +01:00
parent 335261869d
commit 97a923afdf
3 changed files with 49 additions and 6 deletions

View File

@@ -686,6 +686,7 @@ void* build_allocation_map_thread(void* serve_uncast)
* the future, we'll need to wait for the allocation map to finish or
* fail before we can complete the migration.
*/
serve->allocation_map_not_built = 1;
warn( "Didn't build allocation map for %s", serve->filename );
}