                                               :do-rebalance))
                  :kill (kill-transition nimbus storm-id)
                  :do-rebalance (fn []
-                                 ;; TODO: reassign from scratch
+                                 (mk-assignments nimbus storm-id :scratch? true)
                                  (:old-status status))
                  }})
 

        existing-assignment (.assignment-info storm-cluster-state storm-id nil)
        task->node+port (compute-new-task->node+port conf storm-id existing-assignment
                                                     storm-cluster-state callback
                                                     (:task-heartbeats-cache nimbus))
        
        all-node->host (merge (:node->host existing-assignment) node->host)
        reassign-ids (changed-ids (:task->node+port existing-assignment) task->node+port)

;; TODO: slots that have dead task should be reused as long as supervisor is active

;; public so it can be mocked out
(defn compute-new-task->node+port [conf storm-id existing-assignment storm-cluster-state callback task-heartbeats-cache scratch?]
  ;; TODO: implement scratch?
  (let [available-slots (available-slots conf storm-cluster-state callback)
        existing-assigned (reverse-map (:task->node+port existing-assignment))
        storm-conf (read-storm-conf conf storm-id)

        ;; if scratch?, slots = existing slots + available-slots
        ;; otherwise, do timeout stuff
        
        all-task-ids (set (.task-ids storm-cluster-state storm-id))
        alive-ids (set (alive-tasks conf storm-id storm-cluster-state
                                    all-task-ids (:task->start-time-secs existing-assignment) task-heartbeats-cache))
