Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #551, when rebalance ,remove out of date assignment #681

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions storm-core/src/clj/backtype/storm/cluster.clj
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
(update-storm! [this storm-id new-elems])
(remove-storm-base! [this storm-id])
(set-assignment! [this storm-id info])
(remove-assignment! [this storm-id])
(remove-storm! [this storm-id])
(report-error [this storm-id task-id error])
(errors [this storm-id task-id])
Expand Down Expand Up @@ -327,6 +328,9 @@
(set-data cluster-state (assignment-path storm-id) (Utils/serialize info))
)

(remove-assignment! [this storm-id]
(delete-node cluster-state (assignment-path storm-id)))

(remove-storm! [this storm-id]
(delete-node cluster-state (assignment-path storm-id))
(remove-storm-base! this storm-id))
Expand Down
3 changes: 2 additions & 1 deletion storm-core/src/clj/backtype/storm/daemon/nimbus.clj
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,8 @@
;; for the topology which wants rebalance (specified by the scratch-topology-id)
;; we exclude its assignment, meaning that all the slots occupied by its assignment
;; will be treated as free slot in the scheduler code.
(when (or (nil? scratch-topology-id) (not= tid scratch-topology-id))
(if (and (not-nil? scratch-topology-id) (= tid scratch-topology-id))
(.remove-assignment! storm-cluster-state tid)
{tid (.assignment-info storm-cluster-state tid nil)})))
;; make the new assignments for topologies
topology->executor->node+port (compute-new-topology->executor->node+port
Expand Down