Spark Driver & Executor Lifecycle
Driver/executor được start, sống, fail và kết thúc như thế nào trong Spark bình thường.
Câu hỏi
Trong Spark bình thường, driver và executor sống theo lifecycle nào?
Mental model
Một Spark app thường có flow:
submit application
-> start driver
-> driver tạo SparkContext
-> cluster manager cấp executors
-> driver gửi tasks
-> executors chạy và report status
-> application xong thì driver/executors stopĐiểm quan trọng: driver là application owner. Driver chết thì application thường chết theo.
Những câu cần hiểu
- Driver được start bởi ai:
spark-submit, cluster manager, notebook/kernel, hay platform service? - Executor được cấp bởi ai: Standalone, YARN, Kubernetes, Mesos, local?
- Driver biết executor sống/chết bằng heartbeat/status nào?
- Application kết thúc khi nào?
- Driver failure khác executor failure thế nào?
Vì sao liên quan Databricks Runtime
Databricks interactive cluster cần tách một số boundary:
Spark application lifecycle
!= notebook lifecycle
!= command lifecycle
!= cluster/platform lifecycleNếu driver phải sống lâu để nhận nhiều notebook command, Databricks cần thêm supervisor, readiness, health check, warm pool và load signal quanh driver. Đây là chỗ ChauffeurDaemon, DriverDaemon, DriverCorral bắt đầu có ý nghĩa.