Repository navigation
[SPARK-2147] Show exited executors on the Master UI - #1101
Closed
andrewor14 wants to merge 1 commit into
Closed
andrewor14 wants to merge 1 commit into
andrewor14 wants to merge 1 commit into
Conversation
Previously executors disappear if the application exits cleanly (i.e. if sc.stop() is called).
|
Merged build triggered. |
|
Merged build started. |
|
Merged build finished. All automated tests passed. |
|
All automated tests passed. |
Contributor
Author
|
This is superseded by #1102. Closing. |
mapr-devops
pushed a commit
to mapr/spark
that referenced
this pull request
May 8, 2025
Co-authored-by: Egor Krivokon <>
MaxGekk
added a commit
to MaxGekk/spark
that referenced
this pull request
Oct 29, 2026
…#1101) ### What changes were proposed in this pull request? A harness that checks Varka's kernel answers against Spark's with no `SparkSession`, and a first suite on it covering every row of Varka's published coverage table. This is step 1 of the design in `sql/varka/plans/m8/VARKA-509.md`. - **`VarkaHarnessPlans`** builds the expression a session would hand Varka. It parses the SQL and resolves it with Spark's analyzer. It then optimizes it with `SparkOptimizer`, the optimizer sessions run, built over an in-memory catalog. The query sits over `VarkaHarnessScan`, an opaque leaf with the fixture's columns: over a local relation the optimizer would fold the query into its results. A fixture, by contrast, is folded on purpose into the rows the check runs on. - **`VarkaCacheBatches`** writes those rows into Arrow batches and reads them back with the cache serializer's own two iterators. The evaluators therefore see exactly the vectors the cache would give them. - **`VarkaExpressionHarness`** runs the production evaluators through `serveBatch`, the way the exec nodes do: `VarkaKernelEvaluator.project` for a projection, `VarkaFilterEvaluator.filterCompact` for a filter. Each batch the kernel answers is compared row by row with Spark's own projection of the same expression, both interpreted and generated. - A batch the kernel declines goes down the row path, which is Spark's own evaluation, so it's counted rather than compared. - A batch it answers that holds a row Spark raises on is a finding. - Floating values are compared by their raw bits. - A row where Spark's two projections disagree is reported as Spark's disagreement, not blamed on the kernel. - **`VarkaCoverageHarnessSuite`** runs each row of `sql/varka/coverage.json` on the end-to-end suite's three answer fixtures, now shared from its companion object. - Each row is a dynamic test of its own, so the option matrix's per-test skipping and skip lines keep a row's granularity. - A test fails if the kernel answered no batch of its row. - The matrix's batch size is laid over the harness's conf, so the `arrowBatchSize` configurations exercise it with several batches. - A planted test shows the harness can fail. With `checkIntOverflow=false` the kernel answers `Int.MaxValue + 1` where Spark raises `ARITHMETIC_OVERFLOW`, and the harness must report that row. - **`VarkaHarnessParitySuite`** plans every row in a real session over the cached fixtures, executing nothing. It checks that the harness's optimized expression equals the session's. The matrix leaves it out, since it checks the harness rather than an answer. - **`VarkaSuiteExtension`**, the shared JUnit harness for Varka suites, now wraps a `@TestFactory`'s dynamic tests as it wraps a plain `@Test`: skip list, `PinsDefaults`, the matrix outcome and the watchdog all apply. Their names are skip-list keys, so they're checked for uniqueness as they run. Three things are still refused: - parameterized and repeated tests, since JUnit runs them through another hook and names them by position; - dynamic tests in an `ownJvm` class, because its child JVM answers by method. `VarkaSuiteHarnessSuite` covers each case. ### Why are the changes needed? Profiles showed the coverage differential suite spending most of its time in Spark's query machinery rather than in Varka: Varka's compile and emit was 2.9% of its CPU samples. This harness checks the same answers, against the same oracle, without that machinery. For now the answer form runs in both suites, which adds about 10 s per configuration. A later step moves the coverage suite's remaining forms onto the harness and trims the end-to-end suite to one test per path. ### Does this PR introduce _any_ user-facing change? No. Tests only. ### How was this patch tested? On the laptop (`sql/varka/plans/m8/results/VARKA-509-step1-local.txt`): - `VarkaCoverageHarnessSuite`: 339 tests pass in 8 to 10 s, at the defaults and under `arrowBatchSize=1`. - `VarkaHarnessParitySuite`: all 1,011 expressions (337 rows on 3 fixtures) equal the session's. - `VarkaSuiteHarnessSuite`: 18 tests pass. - `VarkaCoverageDifferentialSuite`, with its fixtures moved to the companion object: 1,066 tests pass. - The linters pass. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 5.5)
MaxGekk
added a commit
to MaxGekk/spark
that referenced
this pull request
Oct 29, 2026
…session (apache#1102) ### What changes were proposed in this pull request? The coverage differential suite currently checks every row of Varka's coverage table through two Spark sessions, which spends most of its time in Spark's query machinery. This PR moves two of its forms onto the session-free harness from apache#1101, and cuts the session-based suite to a sample of rows for those forms. **This PR sits on apache#1101**, whose two commits it includes. Its own commit is the last one. - **The answer form, under both consumers.** `VarkaCoverageHarnessSuite` already ran each row through the columnar node's `project`. It now also runs each projection through the row node's `projectFused`, which is what a direct query's plan uses. - **The partition oracle,** in the new `VarkaPartitionOracle`. For each predicate row it checks: - `WHERE p`, `NOT (p)`, `(p) IS NULL` and `(p) IS NOT NULL` through Varka's filter evaluator, which must keep Spark's rows; - that Spark's own three sets share no row and leave none out; - that the known rows are exactly the true and the false ones. Each check runs under the default optimizer, with the three rewriting rules excluded, and for null-safe rows with `NullPropagation` excluded too. The first two filters must be served whole by a kernel. - **The null tests as CASE conditions,** and the boolean column read at both lanes. - **Supporting harness changes:** - `VarkaHarnessPlans.query` plans a whole query over a fixture, whether a projection, a filter or a filter the optimizer folded to a constant. - A filter check records Spark's true rows. - A projection that leaves an output to the row path no longer counts as served, as the session suite required. - A second planted test shows the filter path can fail: under `checkIntOverflow=false` the kernel answers an overflowing row Spark raises on. - **Test names and skip lines.** Every moved test keeps its old name, so its skip-list lines move by suite name alone: 16 partition and CASE-condition lines, plus the 10 answer lines from apache#1101 under that shared name. - **`VarkaCoverageDifferentialSuite`** keeps the answer form for the first row of each family: 27 rows, covering what only a session shows (the columnar rule's plan, the cache and the two nodes). It drops the forms the harness now holds. The ANSI form and the domains stay for now and move in later changes. Old tests to new, each kept under its name: | Test | Before | Harness | Kept in session | |---|---:|---:|---:| | `<row> matches the row engine under both consumers` | 337 | 337 | 27 | | `<row> splits every fixture into true, false and unknown rows` | 164 | 164 | 0 | | `<row> under IS NULL and IS NOT NULL fuses as a CASE condition` | 164 | 164 | 0 | | the boolean column at both lanes, the planted partition oracle | 2 | 2 | 0 | ### Why are the changes needed? These checks need only an expression, its fixture rows and Spark's own evaluation, not a session. Measured on the laptop (`sql/varka/plans/m8/results/VARKA-509-step2a-local.txt`): | Suite | Before | After | |---|---|---| | `VarkaCoverageDifferentialSuite` (session-based) | 1,066 tests, about 315 s | 426 tests, 96 s | | `VarkaCoverageHarnessSuite` | (new in apache#1101) | 670 tests, 16 s | The coverage differential suite is the option matrix's largest cost, and this saving applies under every configuration. ### Does this PR introduce _any_ user-facing change? No. Tests only. ### How was this patch tested? - Both suites pass at the defaults. - Under `validityByWidth=false` both suites pass in one JVM, with the 31 listed tests cancelled and no stale line. - Under `guardUnderArm=false` all 1,095 tests pass. - The linters pass. This PR, apache#1101 and apache#1093 all touch `sql/varka/matrix/skips.tsv` or `dev/varka_matrix.sh`. Whichever merges later needs master merged in and a fresh matrix. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 5.5)
MaxGekk
added a commit
to MaxGekk/spark
that referenced
this pull request
Oct 29, 2026
…ache#1103) ### What changes were proposed in this pull request? The coverage differential suite's ANSI form moves from two Spark sessions onto the session-free harness. **This PR sits on apache#1102, which sits on apache#1101.** Its own commit is the last one. - **`VarkaAnsiForm`** runs each coverage row on the extremes fixture under ANSI mode. That fixture holds the types' bounds, so a row that can overflow or leave its range raises. Each row runs in five positions: - alone, where Spark evaluates it; - in the untaken arm of a CASE; - after a column in a COALESCE; - on the right side of a false AND; - on the right side of a true OR. In the last four, Spark skips the expression on both rows. The harness's rule applies: a batch the kernel answers must hold Spark's values and no row Spark raises on, and a declined batch is Spark's own row path, which raises Spark's own error. - **The reach check** runs at the defaults only, as before. A skipped position must be served whole by a kernel, or the check would only compare Spark with itself. The declined list says where a position can't be served and why; a listed position that is served fails as stale. A projection that leaves an output to the row path counts as not served. - **Test names and skip lines.** `VarkaCoverageHarnessSuite` runs this form under the session suite's test names, so its 39 skip lines move by suite name alone. - **What stays in `VarkaCoverageDifferentialSuite`:** the two tests of the error comparison a user actually meets: the condition, SQLSTATE, parameters, message and exception class, compared through `VarkaMaybeThrows` over a session. Old tests to new: | Test | Before | Harness | Kept in session | |---|---:|---:|---:| | `<row> raises under ANSI only where the row engine does` | 337 | 337 | 0 | | the declined list names only positions its reach check reads | 1 | 1 | 0 | | the error comparison: a raise where Spark skips, and a planted kernel | 2 | 0 | 2 | ### Why are the changes needed? The ANSI form needs an expression, its fixture rows and Spark's own evaluation, not a session. The session-based suite drops from 426 tests in 96 s to 88 tests in 74 s on the laptop. The harness suite grows to 1,008 tests in 25 s. Results are in `sql/varka/plans/m8/results/VARKA-509-step2c-local.txt`. ### Does this PR introduce _any_ user-facing change? No. Tests only. ### How was this patch tested? - Both suites pass at the defaults. - Under `checkIntOverflow=false`, 38 tests cancel across both suites as listed, with no stale line. - Under `guardUnderArm=false`, all tests pass. - The linters pass. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 5.5)
MaxGekk
added a commit
to MaxGekk/spark
that referenced
this pull request
Oct 29, 2026
…he#1104) ### What changes were proposed in this pull request? The coverage differential suite's domain tests move from two Spark sessions onto the session-free harness. **This PR sits on apache#1103, which sits on apache#1102 and apache#1101.** Its own commit is the last one. A coverage row whose kernel can decline a batch names its domain: the predicate inside which the kernel answers. Each such row is checked on the edges fixture, which holds every guard's bound and the values one past it. - **`VarkaDomains`** splits the edges fixture by Spark's value of the domain into three parts: true, false and unknown. It runs each part as a projection and as a filter, comparing against a column of the same type. Then: - inside the domain and where it is unknown, a kernel serves every batch whole; - outside, every batch declines; - each batch's status must be the one `VarkaGuardSpecs`' verdict on that batch's rows calls for, exact under `exactRefusalStatus`; - every answer is Spark's, by the harness's comparison. - **Statuses per batch.** The harness hands the evaluator each batch through `serveBatch`, and the decline the kernel throws passes through the harness's own callback first. It now records each batch's status beside its rows. The session suite read JFR fallback events instead and matched them to the batches in order, so it could not see the batches after a row path that raised. - **The edges fixture** is ported to Java with the same 51 rows. - **The total-domain list and the `date_add(d, i)` test** move too, under their old names. All 20 skip lines move by suite name alone. - **A filter whose condition keeps a residual conjunct** is refused, as the session suite refused a plan holding a row `FilterExec`. Old tests to new: | Test | Before | Harness | |---|---:|---:| | `<row> is answered inside its domain and where it is unknown, and declined outside with the verdict's status, in a projection and a filter` | 56 | 56 | | the total domains are the guarded rows the fixture cannot take outside, and no other | 1 | 1 | | `date_add(d, i)` carries no guard | 1 | 1 | The results file maps each of the old test's checks to its new form. The one check dropped is that the three parts cover the fixture: each row's part is now its single value of the domain, so that holds by construction. ### Why are the changes needed? The domain check needs an expression, the fixture's rows, Spark's evaluation and the kernel's per-batch status, not a session. On the laptop, the session suite drops from 88 tests to 30. The harness suite grows to 1,066 tests in 37 s. Results are in `sql/varka/plans/m8/results/VARKA-509-step2d-local.txt`. ### Does this PR introduce _any_ user-facing change? No. Tests only. ### How was this patch tested? - Both suites pass at the defaults. - Under `checkIntOverflow=false`, 38 tests cancel as listed; under `validityByWidth=false`, 31 do. Neither configuration leaves a stale line. - The linters pass. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 5.5)
MaxGekk
added a commit
to MaxGekk/spark
that referenced
this pull request
Oct 29, 2026
…sion (apache#1105) ### What changes were proposed in this pull request? Each error condition a coverage row raises now runs through a Spark session once, compared against what Spark itself raises. This also completes the record of where every old coverage test's check now lives. **This PR sits on apache#1104, which sits on apache#1103, apache#1102 and apache#1101.** Its own commit is the last one. - **`VarkaAnsiForm.RAISES`** lists each error condition the coverage rows raise on the extremes fixture under ANSI mode, with the first row that raises it. There are five: | Condition | Row | |---|---| | `ARITHMETIC_OVERFLOW` | `add_months(d, i)` | | `BINARY_ARITHMETIC_OVERFLOW` | `y1 + y2` | | `CAST_OVERFLOW` | `d + CAST(i AS INTERVAL DAY)` | | `DATETIME_FIELD_OUT_OF_BOUNDS.WITHOUT_SUGGESTION` | `make_date(2021, i, 1)` | | `INTERVAL_ARITHMETIC_OVERFLOW.WITH_SUGGESTION` | `ym - ymm` | A harness test holds the list to the table both ways. A condition the rows raise but the list doesn't name fails. So does an entry whose row no longer raises it. - **`VarkaCoverageDifferentialSuite`** runs one test per entry through both sessions: - the plan must hold a Varka node, so the row engine alone can't pass it; - the error must be Spark's: the condition, SQLSTATE, parameters, message and exception class. These five tests are in Scala. The error comparison they need (`VarkaMaybeThrows`) and the session plumbing (`VarkaSharedSessions`) are both Scala. - **The partition test** now also checks that excluding the partition rewrites actually takes effect: under that setting, `WHERE NOT (p)` must reach Varka as the `Not` it was written as. Before, a rule left on by mistake would have let the oracle check the very rewrite it means to bypass. - **The results file** maps all 1,066 tests the coverage suite had before this work to the tests that now hold their checks. It also names, for each path the end-to-end layer keeps, the session test that holds it. | Path | Test | |---|---| | Each consumer over a sample | the 27 sample rows | | The rule fusing and declining | the sample rows' fused-plan check; `VarkaEndToEndSuite` | | A SQL configuration reaching the emitter | `VarkaFamilySwitchQuerySuite`; `VarkaProjectExecSuite` | | The fallback's accounting | `VarkaFallbackReasonSuite`; `VarkaProjectExecSuite` | | An ANSI error as the user sees it | the five new tests | The design's section 3 now says the layer is these session suites, not one new suite. - **A count correction:** the step 2a results file said 165 predicate rows. The table has 164. ### Why are the changes needed? With the coverage checks moved below the session, no test ran a real row of each error condition through a session. The two ANSI tests left there plant faults in the comparison itself. On the laptop, the harness suite runs 1,067 tests in 30 s and the session suite 35 tests. Results are in `sql/varka/plans/m8/results/VARKA-509-step2e-local.txt`. ### Does this PR introduce _any_ user-facing change? No. Tests only. ### How was this patch tested? - Both suites pass at the defaults. - I ran two configurations locally; the CI matrix covers the rest: - `checkIntOverflow=false`: 40 tests cancel as listed. That is the earlier 38 plus two new skip lines: `y1 + y2` and `ym - ymm` wrap under that configuration by its design. - `validityByWidth=false`: 31 tests cancel, unchanged. - The linters pass. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 5.5)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If an application exits cleanly (i.e.
sc.stop()is called), then the executors disappear from the applications page on the Master UI. This PR keeps the information associated with the exited executors around to display them on the UI.