HeartSaVioR commented on PR #60068: URL: https://github.com/apache/spark/pull/60068#issuecomment-6938825273
@siying Thanks for narrowing this to optimizer-time retention with a checkpoint-pinned setting. This is a better-contained production patch: `Join.references` remains unchanged, and the conservative eligibility checks plus legacy-fallback tests avoid pulling the range/chained cases into this fix. Reviewed `1c498ff321ae830a3f04d22b4de572ee8fb94369`. **No Blocker (P0) or Major (P1) findings within the explicitly supported scope and ordinary upgrade/restart contract.** The code comments below are nonblocking simplification/maintenance feedback, not demonstrated correctness regressions. ### Minor (P2): Remove the join-specific initial-analysis restoration unless there is an analysis consumer Location: `StreamingQueryManager.scala:293`. The new `hasStatefulJoin` branch reads checkpoint offsets and clones a session before `executePlan(...).analyzed`. However, the retention flag's semantic consumer is now `ColumnPruning`; neither `Join.references` nor analyzer/unsupported-operation-checker behavior depends on it. I do not see a retention dependency at this analysis boundary anymore. Could we remove the join-specific branch and restoration, preserving the existing streaming-EXCEPT handling? Otherwise, please identify the analysis path and a regression that require it. This would keep the point fix from unnecessarily expanding into initial-analysis/session-management behavior. ### Minor (P2): Justify the additional early runtime restoration with a specific regression Location: `MicroBatchExecution.scala:215`. Restoring the stream session before source initialization is a defensible invariant. However, `StreamingV2ScanPushDown.startupConf` and `ExternalLookupJoinStartupCheck.startupConf` already restore pinned settings into their cloned configurations, and ordinary batches restore them through `OffsetSeqMetadata.setSessionConf`. I have not identified an ordinary missing-key checkpoint case where those existing paths are insufficient. One additional behavior here is forcing legacy `false` when an existing offset entry has **no metadata at all**, whereas the shared restorers operate when metadata exists. The added tests remove the config key, not the entire metadata object. If that is the intended reason for this block, could we document the applicable supported-checkpoint scenario and add that regression? Otherwise, consider removing the duplicate restoration. ### Nit (P3): Document that eligibility is part of the checkpoint-compatibility contract Location: `Optimizer.scala:1518`. An excluded query can record the flag as `true` while retaining a legacy-shaped state row. Broadening the eligibility checks later under the same recorded value could therefore change that query's expected state schema on restart. Please add a short warning beside the gate that future scope expansion needs a compatibility-preserving migration or a separately pinned mode/version. This does not require additional compatibility machinery in this patch; it is a guardrail for follow-ups. ### Minor (P2), CI follow-up: Triage the remaining reported failure I inspected the JUnit artifacts from CI run `43793219761`: **all 44 SPARK-60850 test instances passed**, including the ten inherited V4 cases covering restart and legacy fallback with changelog checkpointing on/off. That addresses the concern about whether V4 was actually exercised. The run still reports a failure in `StateStoreInstanceMetricSuiteWithRowChecksum`, test `SPARK-51097: Verify snapshot lag metrics are updated correctly with RocksDBStateStoreProvider (with changelog checkpointing)`, timing out on the nonnegative snapshot-lag metrics assertion. The reported plan is deduplication, not a join, so it looks unrelated; I have not established that it is a pre-existing flake. Please rerun or triage it before merging. **Compatibility boundary:** This review does not establish automatic `new -> old -> new` recovery after a failed downgrade; the PR description explicitly excludes that guarantee. Ordinary legacy-checkpoint upgrades and pinned-mode restarts are a separate contract. Overall, the scoped option-2 direction looks reasonable. I would focus on simplifying the remaining startup plumbing rather than reopening the physical-projection design or requiring the excluded cases to be solved here. This was source review plus inspection of executed CI results; I did not run new local tests. --- This comment was composed and posted by an AI assistant on behalf of @HeartSaVioR. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
