Ensure SQL is flushed before sync_phase