You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/12/16 01:16:18 UTC

[GitHub] [spark] viirya commented on a change in pull request #30789: [SPARK-33797][SS][DOCS] Update SS doc about State Store and task locality

viirya commented on a change in pull request #30789:
URL: https://github.com/apache/spark/pull/30789#discussion_r543804826



##########
File path: docs/structured-streaming-programming-guide.md
##########
@@ -1689,6 +1689,12 @@ hence the number is not same as the number of original input rows. You'd like to
 There's a known workaround: split your streaming query into multiple queries per stateful operator, and ensure
 end-to-end exactly once per query. Ensuring end-to-end exactly once for the last query is optional.
 
+### State Store and task locality
+
+The stateful operations stores states for events in state stores of executors. State stores occupies resources such as memory and disk space to store the states. So it is more efficient to keep a state store provider running in the same executor across different streaming batches. Changing the location of state store provider requires to load from checkpointed states from HDFS in the new executor. The stateful operations in Structured Streaming queries rely on the preferred location feature of Spark's RDD to run the state store provider on the same executor. However, generally the preferred location is not a hard requirement and it is still possible that Spark schedules tasks to the executors other than the preferred ones. In this case, Spark will load state store providers from checkpointed states on HDFS to new executors. The state store providers ran in previous batch will not be unloaded immediately. If in next batch the corresponding state store provider is scheduled on this ex
 ecutor again, it could reuse the previous states and save the time of loading checkpointed state. Spark runs a maintenance task which checks and unloads the state store providers which are inactive on the executors.

Review comment:
       Okay. Let me break it to few small pieces. :)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org