Skip to content

[GLUTEN-12743][VL] Synchronize the aborted Delta statistics write test - #13705

Open
felipepessoto wants to merge 1 commit into
apache:mainfrom
felipepessoto:felipepessoto-delta-abort-test-investigation
Open

felipepessoto wants to merge 1 commit into
apache:mainfrom
felipepessoto:felipepessoto-delta-abort-test-investigation

Conversation

@felipepessoto

@felipepessoto felipepessoto commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

What changes are proposed in this pull request?

#13578 introduced GlutenDeltaStatsLifecycleSuite. In the Spark 3.5 nightly, the invalid partition could abort the write before the test observed the valid writer’s statistics plan.

The test now waits until the valid writer’s statistics worker accepts its first batch before triggering the NOT NULL violation. It then verifies cancellation, cleanup, and recovery. No production code changes.

Relates to #12743.

Current state:
image

How was this patch tested?

The full spark-test-spark35-smj nightly shard passed on 58fe74fb6 with no suite filter. All three GlutenDeltaStatsLifecycleSuite tests ran and passed, including the previously flaky aborted-write test. Log excerpt.

All three suite tests passed in three consecutive runs on each of Spark 3.5.5 and 4.1.1 (JDK 17).

Was this patch authored or co-authored using generative AI tooling?

Generated-by: GitHub Copilot CLI 1.0.106-8.unstable.r43566476370.g869eef3 (GPT-6.2 Astra)

@github-actions github-actions Bot added the VELOX label Nov 21, 2026
@felipepessoto
felipepessoto force-pushed the felipepessoto-delta-abort-test-investigation branch from fc16733 to 58fe74f Compare November 21, 2026 08:15
@felipepessoto

Copy link
Copy Markdown
Contributor Author

@malinjawi @philo-he @zhztheplayer, thanks for reviewing #13578. Could you take a look at #13705 as well? It fixes a flaky test introduced in that PR: the invalid partition now waits until the valid writer’s statistics worker accepts its first batch, so the test reliably exercises cancellation and cleanup. No production code changes.

@felipepessoto
felipepessoto marked this pull request as ready for review November 21, 2026 22:36
Copilot AI balanced review requested due to automatic review settings November 21, 2026 22:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The review reports no active issues for this test-only statistics lifecycle stabilization change.

No open issues 🎉

What changed in this PR

Stabilizes the Velox Delta statistics lifecycle test introduced in #13578 by delaying the NOT NULL violation until the valid writer’s statistics worker has accepted its first batch. No production code changes.

Changes:

  • Uses one-row batches and shared local-task synchronization to control when the write fails.
  • Adds bounded waits and an explicit cancellation assertion while retaining cleanup and recovery checks.
File Description
backends-velox/​src-delta33/​test/​scala/​org/​apache/​spark/​sql/​delta/​GlutenDeltaStatsLifecycleSuite.scala Coordinates the valid and invalid partitions and verifies cancellation during the aborted-write test.

Review effort: Balanced

@felipepessoto

Copy link
Copy Markdown
Contributor Author

The full spark-test-spark35-smj nightly shard passed on 58fe74fb6 (Spark 3.5.5, JDK 17, spark.gluten.sql.columnar.forceShuffledHashJoin=false, no suite filter). The JUnit report confirms all three lifecycle tests ran and passed, including the previously flaky abort test.

GlutenDeltaStatsLifecycleSuite:
- aborted Delta writes close native statistics before task runtimes
- multi-file Delta statistics close workers after a successful task
- canceled statistics workers can access task resources before cleanup

Maven finished with [INFO] BUILD SUCCESS.

Keep the valid writer active after its first native statistics batch. Release the invalid partition only then, and verify Spark canceled the valid task without weakening the cleanup and recovery checks.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@felipepessoto
felipepessoto force-pushed the felipepessoto-delta-abort-test-investigation branch from 58fe74f to c015e4a Compare November 23, 2026 18:25
Copilot AI balanced review requested due to automatic review settings November 23, 2026 18:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the test-only change coordinating aborted-write timing and checking writer cancellation.

No open issues 🎉

Review effort: Balanced

@felipepessoto

Copy link
Copy Markdown
Contributor Author

@malinjawi @philo-he @zhztheplayer, could one of you take a look at #13705? The latest nightly hit the same “The write did not exercise native Delta statistics” assertion again. This is a test-only fix, and the full nightly shard passed with it. Thanks!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants