You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2024/09/10 22:33:00 UTC

[jira] [Updated] (SPARK-49592) OperatorStateMetadataV2 can return incorrect metadata for the given batchId

     [ https://issues.apache.org/jira/browse/SPARK-49592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated SPARK-49592:
-----------------------------------
    Labels: pull-request-available  (was: )

> OperatorStateMetadataV2 can return incorrect metadata for the given batchId
> ---------------------------------------------------------------------------
>
>                 Key: SPARK-49592
>                 URL: https://issues.apache.org/jira/browse/SPARK-49592
>             Project: Spark
>          Issue Type: Improvement
>          Components: Structured Streaming
>    Affects Versions: 4.0.0
>            Reporter: Neil Ramaswamy
>            Priority: Major
>              Labels: pull-request-available
>
> Currently, the `OperatorStateMetadataV2Reader` has an off-by-one error when reading metadata for a given batchId. The issue is on [this line|https://github.com/apache/spark/blob/ea4b82e97d944717b32aaaec986a8238e59b8acf/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/OperatorStateMetadata.scala#L349].
> Suppose the batches in the checkpoint location is just `0`, and the desired `batchId` is 1. The logic lists all of the batches, filters for less than `batchId`, and takes the last element. This can return the metadata for `0`, when really we want the metadata for `1`. The reason we didn't catch this before was because [this check|https://github.com/apache/spark/blob/ea4b82e97d944717b32aaaec986a8238e59b8acf/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/OperatorStateMetadata.scala#L316-L318] prevented us from getting to the point where we attempted to read metadata for a batch whose offset didn't yet exist.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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