Skip to content

[SPARK-2147 / 2161] Show removed executors on the UI - #1102

Closed
andrewor14 wants to merge 8 commits into
apache:masterfrom
andrewor14:remember-removed-executors
Closed

andrewor14 wants to merge 8 commits into
apache:masterfrom
andrewor14:remember-removed-executors

Conversation

@andrewor14

Copy link
Copy Markdown
Contributor

This PR includes two changes

  • [SPARK-2147] When an application finishes cleanly (i.e. sc.stop() is called), all of its executors used to disappear from the Master UI. This no longer happens.
  • [SPARK-2161] This adds a "Removed Executors" table to Master UI, so the user can find out why their executors died from the logs, for instance. The equivalent table already existed in the Worker UI, but was hidden because of a bug (the comment //scalastyle:off disconnected the Seq[Node] that represents the HTML for table).

This should go into 1.0.1 if possible.

Previously executors disappear if the application exits cleanly
(i.e. if sc.stop() is called).
The table was previously hidden by a comment, which disconnected the
HTML from the rest of the content. Yay Scala DSL.
@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@AmplabJenkins

Copy link
Copy Markdown

Merged build finished.

@AmplabJenkins

Copy link
Copy Markdown

Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/15838/

@andrewor14

Copy link
Copy Markdown
Contributor Author

Tests pass locally. Jenkins, test this please.

@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@AmplabJenkins

Copy link
Copy Markdown

Merged build finished. All automated tests passed.

@AmplabJenkins

Copy link
Copy Markdown

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/15839/

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.

Maybe we can make this sortable while we're here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Isn't it already sortable?

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.

Oops, you're right. We only need to specify custom sorting keys.

@aarondav

Copy link
Copy Markdown
Contributor

LGTM, just a few minor comments. Thanks a bunch!

@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@AmplabJenkins

Copy link
Copy Markdown

Merged build finished. All automated tests passed.

@AmplabJenkins

Copy link
Copy Markdown

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/15850/

@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@AmplabJenkins

Copy link
Copy Markdown

Merged build finished. All automated tests passed.

@AmplabJenkins

Copy link
Copy Markdown

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/15852/

@aarondav

Copy link
Copy Markdown
Contributor

Alright, LGTM, merging in to master and branch-1.0. Thanks!

@asfgit asfgit closed this in a14807e Jun 17, 2014
asfgit pushed a commit that referenced this pull request Jun 17, 2014
This PR includes two changes
- **[SPARK-2147]** When an application finishes cleanly (i.e. `sc.stop()` is called), all of its executors used to disappear from the Master UI. This no longer happens.
- **[SPARK-2161]** This adds a "Removed Executors" table to Master UI, so the user can find out why their executors died from the logs, for instance. The equivalent table already existed in the Worker UI, but was hidden because of a bug (the comment `//scalastyle:off` disconnected the `Seq[Node]` that represents the HTML for table).

This should go into 1.0.1 if possible.

Author: Andrew Or <andrewor14@gmail.com>

Closes #1102 from andrewor14/remember-removed-executors and squashes the following commits:

2e2298f [Andrew Or] Add hash code method to ExecutorInfo (minor)
abd72e0 [Andrew Or] Merge branch 'master' of github.com:apache/spark into remember-removed-executors
792f992 [Andrew Or] Add missing equals method in ExecutorInfo
3390b49 [Andrew Or] Add executor state column to WorkerPage
161f8a2 [Andrew Or] Display finished executors table (fix bug)
fbb65b8 [Andrew Or] Removed unused method
c89bb6e [Andrew Or] Add table for removed executors in MasterWebUI
fe47402 [Andrew Or] Show exited executors on the Master UI

(cherry picked from commit a14807e)
Signed-off-by: Aaron Davidson <aaron@databricks.com>
@andrewor14
andrewor14 deleted the remember-removed-executors branch June 18, 2014 00:23
pdeyhim pushed a commit to pdeyhim/spark-1 that referenced this pull request Jun 25, 2014
This PR includes two changes
- **[SPARK-2147]** When an application finishes cleanly (i.e. `sc.stop()` is called), all of its executors used to disappear from the Master UI. This no longer happens.
- **[SPARK-2161]** This adds a "Removed Executors" table to Master UI, so the user can find out why their executors died from the logs, for instance. The equivalent table already existed in the Worker UI, but was hidden because of a bug (the comment `//scalastyle:off` disconnected the `Seq[Node]` that represents the HTML for table).

This should go into 1.0.1 if possible.

Author: Andrew Or <andrewor14@gmail.com>

Closes apache#1102 from andrewor14/remember-removed-executors and squashes the following commits:

2e2298f [Andrew Or] Add hash code method to ExecutorInfo (minor)
abd72e0 [Andrew Or] Merge branch 'master' of github.com:apache/spark into remember-removed-executors
792f992 [Andrew Or] Add missing equals method in ExecutorInfo
3390b49 [Andrew Or] Add executor state column to WorkerPage
161f8a2 [Andrew Or] Display finished executors table (fix bug)
fbb65b8 [Andrew Or] Removed unused method
c89bb6e [Andrew Or] Add table for removed executors in MasterWebUI
fe47402 [Andrew Or] Show exited executors on the Master UI
xiliu82 pushed a commit to xiliu82/spark that referenced this pull request Sep 4, 2014
This PR includes two changes
- **[SPARK-2147]** When an application finishes cleanly (i.e. `sc.stop()` is called), all of its executors used to disappear from the Master UI. This no longer happens.
- **[SPARK-2161]** This adds a "Removed Executors" table to Master UI, so the user can find out why their executors died from the logs, for instance. The equivalent table already existed in the Worker UI, but was hidden because of a bug (the comment `//scalastyle:off` disconnected the `Seq[Node]` that represents the HTML for table).

This should go into 1.0.1 if possible.

Author: Andrew Or <andrewor14@gmail.com>

Closes apache#1102 from andrewor14/remember-removed-executors and squashes the following commits:

2e2298f [Andrew Or] Add hash code method to ExecutorInfo (minor)
abd72e0 [Andrew Or] Merge branch 'master' of github.com:apache/spark into remember-removed-executors
792f992 [Andrew Or] Add missing equals method in ExecutorInfo
3390b49 [Andrew Or] Add executor state column to WorkerPage
161f8a2 [Andrew Or] Display finished executors table (fix bug)
fbb65b8 [Andrew Or] Removed unused method
c89bb6e [Andrew Or] Add table for removed executors in MasterWebUI
fe47402 [Andrew Or] Show exited executors on the Master UI
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants