Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-33827

Unload State Store asap once it becomes inactive

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.2.0
    • 3.2.0
    • Structured Streaming
    • None

    Description

      SS maintains state stores in executors across batches. Due to the nature of Spark scheduling, a state store might be allocated on another executor in next batch. The state store in previous batch becomes inactive.

      Now we run a maintenance task periodically to unload inactive state stores. So there will be some delays between a state store becomes inactive and it is unloaded.

      Per the discussion on https://github.com/apache/spark/pull/30770 with kabhwan, I think the preference is to unload inactive state store asap.

      However, we can force Spark to always allocate a state store to same executor, by using task locality configuration. This can reduce the possibility to have inactive state store.

      Normally, I think with locality configuration, we might not able to see inactive state store generally. There is still chance an executor can be failed and reallocated, but in this case, inactive state store is also lost too. So it is not an issue.

      So unloading inactive store asap is only useful when we don't use task locality to force state store locality across batches.

      The required change to make driver-executor bi-directional for state store management looks non-trivial. If we already can reduce possibility of inactive store, is it still worth making non-trivial here?

      Attachments

        Activity

          People

            viirya L. C. Hsieh
            viirya L. C. Hsieh
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: