Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
Disallow ZK windowing by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDrogalis committed Nov 8, 2017
1 parent f64e251 commit c8e17e0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
7 changes: 7 additions & 0 deletions src/onyx/information_model.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,12 @@ may be added by the user as the context is associated to throughout the task pip
:optional? false
:added "0.8.0"}

:onyx.peer/storage.zk.insanely-allow-windowing?
{:doc "Allows window contents to be checkpointed with Zookeeper. This is highly unadvised for anything but testing."
:type :boolean
:default false
:optional? true
:added "0.12.0"}

:onyx.peer.metrics/lifecycles
{:doc "Onyx can provide metrics for all lifecycle stages. Simply provide the lifecycle stages to monitor them. Note that tracking all lifecycles may cause a performance hit depending on your workload."
Expand Down Expand Up @@ -1978,6 +1984,7 @@ may be added by the user as the context is associated to throughout the task pip
:onyx.peer/outbox-capacity
:onyx.peer/storage
:onyx.peer/storage.timeout
:onyx.peer/storage.zk.insanely-allow-windowing?
:onyx.peer/storage.s3.auth-type
:onyx.peer/storage.s3.auth.access-key
:onyx.peer/storage.s3.auth.secret-key
Expand Down
8 changes: 6 additions & 2 deletions src/onyx/log/zookeeper.clj
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
(zk/create conn (resume-point-path onyx-id) :persistent? true)

(initialize-origin! conn config onyx-id)
(assoc component :server server :conn conn :prefix onyx-id :kill-ch kill-ch)))
(assoc component :server server :conn conn :prefix onyx-id :kill-ch kill-ch :peer-config config)))

(stop [component]
(taoensso.timbre/info "Stopping ZooKeeper" (if (:zookeeper/server? config) "server" "client connection"))
Expand Down Expand Up @@ -654,8 +654,12 @@
:checkpoint-type (keyword checkpoint-type)}))

(defmethod checkpoint/write-checkpoint ZooKeeper
[{:keys [conn opts monitoring]} tenancy-id job-id replica-version epoch
[{:keys [conn peer-config monitoring]} tenancy-id job-id replica-version epoch
task-id slot-id checkpoint-type checkpoint-bytes]
(when (and (= checkpoint-type :windows)
(not (:onyx.peer/storage.zk.insanely-allow-windowing? peer-config)))
(throw (ex-info "Windows cannot be checkpointed with ZooKeeper unless :onyx.peer/storage.zk.insanely-allow-windowing? is set to true in the peer config. This should only be turned on as a development convenience." {})))

(measure-latency
#(clean-up-broken-connections
(fn []
Expand Down
5 changes: 1 addition & 4 deletions test-resources/test-config.edn
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@
{:zookeeper/address "127.0.0.1:2188"
:onyx.peer/job-scheduler :onyx.job-scheduler/greedy
:onyx.peer/storage :zookeeper
:onyx.peer/storage.zk.insanely-allow-windowing? true
:onyx.peer/state-store-impl :memory
:onyx.peer/storage.s3.bucket "onyx-s3-testing"
:onyx.peer/storage.s3.region "us-west-2"
;:onyx.peer/storage.s3.bucket "onyx-test-us-east-1"
;:onyx.peer/storage.s3.bucket "onyx-test-us-east-1"
; :onyx.peer/storage.s3.multipart-copy-part-size 1000
; :onyx.peer/storage.s3.multipart-upload-threshold 1000
; :onyx.peer/storage.s3.accelerate? false
;; Increase timeouts for circle ci
; :onyx.peer/coordinator-barrier-period-ms 40000
:onyx.peer/coordinator-barrier-period-ms 1000
:onyx.peer/subscriber-liveness-timeout-ms 10000
:onyx.peer/publisher-liveness-timeout-ms 10000
Expand Down

0 comments on commit c8e17e0

Please sign in to comment.