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

STORM-1976 Remove cleanup-corrupt-topologies! #1571

Closed
wants to merge 1 commit into from
Closed
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
14 changes: 0 additions & 14 deletions storm-core/src/clj/org/apache/storm/daemon/nimbus.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1166,19 +1166,6 @@
topo-history-state (:topo-history-state nimbus)]
(.filterOldTopologies ^LocalState topo-history-state cutoff-age))))

(defn cleanup-corrupt-topologies! [nimbus]
(let [storm-cluster-state (:storm-cluster-state nimbus)
blob-store (:blob-store nimbus)
code-ids (set (code-ids blob-store))
active-topologies (set (.activeStorms storm-cluster-state))
corrupt-topologies (set/difference active-topologies code-ids)]
(doseq [corrupt corrupt-topologies]
(log-message "Corrupt topology " corrupt " has state on zookeeper but doesn't have a local dir on Nimbus. Cleaning up...")
(.removeStorm storm-cluster-state corrupt)
(if (instance? LocalFsBlobStore blob-store)
(doseq [blob-key (get-key-list-from-id (:conf nimbus) corrupt)]
(.removeBlobstoreKey storm-cluster-state blob-key))))))

(defn setup-blobstore [nimbus]
"Sets up blobstore state for all current keys."
(let [storm-cluster-state (:storm-cluster-state nimbus)
Expand Down Expand Up @@ -2202,7 +2189,6 @@
STORM-VERSION))

(.addToLeaderLockQueue (:leader-elector nimbus))
(cleanup-corrupt-topologies! nimbus)
(when (instance? LocalFsBlobStore blob-store)
;register call back for blob-store
(.blobstore (:storm-cluster-state nimbus) (fn [] (blob-sync conf nimbus)))
Expand Down
31 changes: 0 additions & 31 deletions storm-core/test/clj/org/apache/storm/nimbus_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1147,37 +1147,6 @@
(getAllNimbuses [this] `(leader-address))
(close [this] true))))

(deftest test-cleans-corrupt
(with-inprocess-zookeeper zk-port
(with-local-tmp [nimbus-dir]
(with-open [_ (MockedZookeeper. (proxy [Zookeeper] []
(zkLeaderElectorImpl [conf] (mock-leader-elector))))]
(letlocals
(bind conf (merge (clojurify-structure (ConfigUtils/readStormConfig))
{STORM-ZOOKEEPER-SERVERS ["localhost"]
STORM-CLUSTER-MODE "local"
STORM-ZOOKEEPER-PORT zk-port
STORM-LOCAL-DIR nimbus-dir}))
(bind cluster-state (ClusterUtils/mkStormClusterState conf nil (ClusterStateContext.)))
(bind nimbus (nimbus/service-handler conf (nimbus/standalone-nimbus)))
(bind topology (Thrift/buildTopology
{"1" (Thrift/prepareSpoutDetails
(TestPlannerSpout. true) (Integer. 3))}
{}))
(submit-local-topology nimbus "t1" {} topology)
(submit-local-topology nimbus "t2" {} topology)
(bind storm-id1 (StormCommon/getStormId cluster-state "t1"))
(bind storm-id2 (StormCommon/getStormId cluster-state "t2"))
(.shutdown nimbus)
(let [blob-store (Utils/getNimbusBlobStore conf nil)]
(nimbus/blob-rm-topology-keys storm-id1 blob-store cluster-state)
(.shutdown blob-store))
(bind nimbus (nimbus/service-handler conf (nimbus/standalone-nimbus)))
(is ( = #{storm-id2} (set (.activeStorms cluster-state))))
(.shutdown nimbus)
(.disconnect cluster-state)
)))))

;(deftest test-no-overlapping-slots
; ;; test that same node+port never appears across 2 assignments
; )
Expand Down