You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "Xiao-zhen-Liu (via GitHub)" <gi...@apache.org> on 2026/07/22 00:56:49 UTC
[PR] feat(amber): add cache-reused operator state and cached-region statistics handling [texera]
Xiao-zhen-Liu opened a new pull request, #6729:
URL: https://github.com/apache/texera/pull/6729
### What changes were proposed in this PR?
This adds the `CACHE_REUSED` workflow-aggregated state and the statistics handling for a cached region. It is the state-and-stats slice of the operator output port result cache (MVP). It lands dormant and does not change behavior on an empty cache.
- Add `CACHE_REUSED = 11` to the `WorkflowAggregatedState` enum, mapped in `Utils` to a display string (`CacheReused`), a parse case, and DB status code `6`.
- `ExecutionUtils.aggregateStates` takes an optional `cachedState`; when every state in the group equals it, the group rolls up to `CACHE_REUSED`. It defaults to `None`, so every existing caller is unchanged. Only the operator-level `aggregateMetrics` passes it.
- `ExecutionUtils.aggregatePortMetrics` treats a negative count/size as an unknown value and keeps the aggregated port metrics unknown; `ExecutionUtils.sumNonNegative` skips those sentinels when `ExecutionStatsService` sums operator totals. A cached input port has no live tuple count, so it carries this unknown marker.
Empty-cache safety: with an empty cache nothing produces `CACHE_REUSED` or a negative tuple count, so `cachedState` stays `None` (the new branch is unreachable) and every count is non-negative (both sentinel paths are identity). The enum value is appended with no renumber, and the only code that matches on the enum (`Utils`) has catch-alls. The engine behaves identically to today until a later PR marks operators as reused from cache.
### Any related issues, documentation, discussions?
Closes #5883. Part of #5881 (operator output port result cache, MVP). Design discussion: #5880.
### How was this PR tested?
Added unit tests. `ExecutionUtilsSpec` covers the `cachedState` branch (all-cached rolls up to `CACHE_REUSED`, branch precedence over completed/terminated/running, and the empty-cache regression that the optional argument is byte-identical to the existing overload when no cached state is present), the `-1` unknown-port sentinel in `aggregatePortMetrics`, its propagation through `aggregateMetrics`, and `sumNonNegative`. `UtilsSpec` covers the display and parse round-trip, the status code `6`, and that it is distinct from `COMPLETED`. The two specs pass (63 cases), and `scalafmtCheckAll` is clean.
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 4.8 (Claude Code)
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(amber): add cache-reused operator state and cached-region statistics handling [texera]
Posted by "Ma77Ball (via GitHub)" <gi...@apache.org>.
Ma77Ball commented on code in PR #6729:
URL: https://github.com/apache/texera/pull/6729#discussion_r3633850683
##########
amber/src/main/scala/org/apache/texera/amber/engine/common/Utils.scala:
##########
@@ -141,6 +143,7 @@ object Utils extends LazyLogging {
case WorkflowAggregatedState.COMPLETED => 3
case WorkflowAggregatedState.FAILED => 4
case WorkflowAggregatedState.KILLED => 5
+ case WorkflowAggregatedState.CACHE_REUSED => 6
Review Comment:
New status code 6 is not mirrored to the frontend in `ngbd-modal-workflow-executions.component.ts` (mentioned in the doc comments above)
> /**
* @param state indicates the workflow state
* @return code indicates the status of the execution in the DB it is 0 by default for any unused states.
* This code is stored in the DB and read in the frontend.
* If these codes are changed, they also have to be changed in the frontend `ngbd-modal-workflow-executions.component.ts`
*/
Please add the `CacheReused` case there too.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(amber): add cache-reused operator state and cached-region statistics handling [texera]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6729:
URL: https://github.com/apache/texera/pull/6729#issuecomment-5040626648
<!-- texera-reviewer-suggestion -->
### Automated Reviewer Suggestions
Based on the `git blame` history of the changed files, we recommend the following reviewers:
- **Contributors with relevant context:** `@Yicong-Huang`, `@carloea2`, `@aglinxinyuan`
You can notify them by mentioning `@Yicong-Huang`, `@carloea2`, `@aglinxinyuan` in a comment.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(amber): add cache-reused operator state and cached-region statistics handling [texera]
Posted by "Yicong-Huang (via GitHub)" <gi...@apache.org>.
Yicong-Huang commented on code in PR #6729:
URL: https://github.com/apache/texera/pull/6729#discussion_r3718794245
##########
frontend/src/app/workspace/types/execute-workflow.interface.ts:
##########
@@ -159,6 +159,7 @@ export enum ExecutionState {
Terminated = "Terminated",
Failed = "Failed",
Killed = "Killed",
+ CacheReused = "CacheReused",
Review Comment:
This breaks the frontend build. `ExecutionStateInfo` just below (lines 165-186) enumerates its members explicitly, so `handleExecutionEvent`'s `default: return { state: newState };` (execute-workflow.service.ts:156) now assigns a union containing `CacheReused` to a type that excludes it — TS2322, failing on ubuntu, macos and windows.
`Terminated` is the precedent: it lives in the terminal variant at line 180. Adding `CacheReused` there compiles, and matches what the state means.
##########
amber/src/main/protobuf/org/apache/texera/amber/engine/architecture/rpc/controlreturns.proto:
##########
@@ -126,6 +126,7 @@ enum WorkflowAggregatedState {
UNKNOWN = 8;
KILLED = 9;
TERMINATED = 10;
+ CACHE_REUSED = 11;
Review Comment:
Before the mirrors and the status code — does this value need to exist at all?
A cached region already reports COMPLETED at both the region and the workflow level, by construction. `RegionExecution.getState` (RegionExecution.scala:122-134) is a pure function of port completion and returns only COMPLETED or RUNNING. `WorkflowExecution.getState` (:161) is `regionStates.forall(_ == COMPLETED)`. #5884's plan already says the skip path "records a completed-from-cache result with no workers" and that "a skipped region completes at once with no workers" — so marking the ports completed is enough for both layers. The only level where a distinct value is observable is the operator badge, which is #5886's scope, and cached-ness there can ride the `Region.cached` flag #5884 adds anyway.
I went looking for where reusing COMPLETED was weighed and could not find it. #5880 carries it as a single merge-plan bullet ("a 'completed from cache' operator state and the matching statistics handling"); the token COMPLETED appears nowhere in that discussion, nor in #4346. #5881, #5883, #5884, this description, and the code comments all take the state as given.
The cost is concrete in this diff. Eight surfaces have to stay in sync — this enum, the three `Utils` maps, the DB status byte, `ExecutionState`, `ExecutionStateInfo`, `OperatorState`, and `EXECUTION_STATUS_CODE` plus the modal's icon and search maps — and today two mirrors sit on a path that cannot receive the value, one is missing on the path that can, and one breaks the build. `ComputingUnitMaster.scala:189` is a further hazard: it rewrites any stored status other than COMPLETED to FAILED when it sweeps expired executions after a restart, so a successful cache reuse would eventually display as Failed.
The same question applies to the statistics half. A cached port's counts have three candidate answers — zero, an unknown marker, or the result's real row count — and only the middle one is implemented. The real count looks the most useful (a re-run shows the same numbers as a real run) and it would delete the sentinel machinery entirely. Does #5882 record the row count next to the result location? If it does, I would drop both the new state and the sentinel, and let a cached region be COMPLETED with its real numbers.
I am not asking you to redo the slice on my word — but this deserves an answer in #5880 before the mirrors get finished, because the four findings below all dissolve if the answer is "reuse COMPLETED".
##########
amber/src/main/scala/org/apache/texera/amber/engine/common/Utils.scala:
##########
@@ -166,6 +168,7 @@ object Utils extends LazyLogging {
case WorkflowAggregatedState.COMPLETED => 3
case WorkflowAggregatedState.FAILED => 4
case WorkflowAggregatedState.KILLED => 5
+ case WorkflowAggregatedState.CACHE_REUSED => 6
Review Comment:
Nothing can write this byte. `execution.setStatus(maptoStatusCode(state))` (ExecutionStateStore.scala:44) is the only writer, and its `state` comes only from `WorkflowExecution.getState` (WorkflowExecution.scala:156-181) or `StartWorkflowHandler.scala:49,52`. That `getState` is a hand-rolled parallel copy of `aggregateStates` which this PR does not extend, so it can only return UNINITIALIZED, COMPLETED, RUNNING, PAUSED, READY or UNKNOWN.
So the three dashboard mirrors — `EXECUTION_STATUS_CODE[6]`, `getExecutionStatus(6)`, and the `statusMapping` entry — are unreachable. This confirms @Ma77Ball's instinct that this code path needed attention, just not in the direction it went.
`TERMINATED` shows what to do instead: it gets no status code at all, precisely because it is not a workflow-level state. I would follow that — drop this case and the three frontend mirrors, and put the mirror on `OperatorState`. Making `WorkflowExecution.getState` delegate to `aggregateStates` so the workflow level can report the state too is the better long-term shape, but it is a bigger change than this slice and it runs into the restart-sweep problem noted on the proto line.
##########
amber/src/main/scala/org/apache/texera/amber/engine/architecture/coordinator/execution/ExecutionUtils.scala:
##########
@@ -81,26 +82,50 @@ object ExecutionUtils {
)
}
+ /**
+ * Rolls a group of execution states up into one workflow-level state.
+ *
+ * When `cachedState` is provided and every state equals it, the group is
+ * reported as CACHE_REUSED. A cached state is otherwise terminal, like
+ * completed and terminated: it counts toward the all-terminal case and is
+ * dropped before the remaining states are classified. `cachedState`
+ * defaults to None, so an empty cache leaves this method byte-identical
+ * to before. When given, it must differ from the other six states.
+ */
def aggregateStates[T](
states: Iterable[T],
completedState: T,
terminatedState: T,
runningState: T,
uninitializedState: T,
pausedState: T,
- readyState: T
+ readyState: T,
+ cachedState: Option[T] = None
Review Comment:
This signature is now eight parameters of the same type, and the scaladoc above carries a precondition the compiler cannot check ("it must differ from the other six states"). A caller that swaps two arguments compiles silently.
Bundling the vocabulary into one case class would turn that into a compile error. Not blocking, but this is the point where the next parameter should not be positional.
##########
amber/src/main/scala/org/apache/texera/web/service/ExecutionStatsService.scala:
##########
@@ -115,11 +116,19 @@ class ExecutionStatsService(
val res = OperatorAggregatedMetrics(
Utils.aggregatedStateToString(metrics.operatorState),
- metrics.operatorStatistics.inputMetrics.map(_.tupleMetrics.count).sum,
- metrics.operatorStatistics.inputMetrics.map(_.tupleMetrics.size).sum,
+ ExecutionUtils.sumNonNegative(
+ metrics.operatorStatistics.inputMetrics.map(_.tupleMetrics.count)
Review Comment:
The guard stops two lines short of where it matters. `inMap`/`outMap` (lines 110-115) still map `pm.tupleMetrics.count` straight through, so this one event carries guarded totals next to an unguarded per-port `-1`.
On the frontend, `inputMetrics[numericSuffix] ?? 0` (joint-ui.service.ts:399, and :409 for outputs) only substitutes for null and undefined, so `-1` survives to `toLocaleString()` and shows up as a literal `-1` on the operator's port label. Unreachable today, but guaranteed once #5884 marks operators as reused — and the port label is exactly the surface "cached-region statistics handling" covers.
Of the two places to fix it, I would teach the TS render to treat a negative count as unknown rather than filter the port out of the map here: dropping the entry makes a cached port indistinguishable from an operator that has no such port.
##########
amber/src/main/scala/org/apache/texera/amber/engine/architecture/coordinator/execution/ExecutionUtils.scala:
##########
@@ -81,26 +82,50 @@ object ExecutionUtils {
)
}
+ /**
+ * Rolls a group of execution states up into one workflow-level state.
+ *
+ * When `cachedState` is provided and every state equals it, the group is
+ * reported as CACHE_REUSED. A cached state is otherwise terminal, like
+ * completed and terminated: it counts toward the all-terminal case and is
+ * dropped before the remaining states are classified. `cachedState`
+ * defaults to None, so an empty cache leaves this method byte-identical
+ * to before. When given, it must differ from the other six states.
Review Comment:
"byte-identical" claims the source is unchanged, but the source did change — what is preserved is behaviour. Same wording in the PR description.
```suggestion
* defaults to None, so an empty cache leaves this method behaviorally
* identical to before. When given, it must differ from the other six states.
```
##########
amber/src/main/scala/org/apache/texera/amber/engine/architecture/coordinator/execution/ExecutionUtils.scala:
##########
@@ -121,10 +146,20 @@ object ExecutionUtils {
.view
.map {
case (portId, mappings) =>
- val totalCount = mappings.map(_.tupleMetrics.count).sum
- val totalSize = mappings.map(_.tupleMetrics.size).sum
+ // A negative count/size marks an unknown value (e.g. a cached input
+ // port), so any unknown keeps the aggregated port metrics unknown.
+ val hasUnknown =
+ mappings.exists(m => m.tupleMetrics.count < 0 || m.tupleMetrics.size < 0)
+ val totalCount = if (hasUnknown) -1L else mappings.map(_.tupleMetrics.count).sum
Review Comment:
If the sentinel survives the direction question, give it a name. `-1` is a bare literal here and on the next line, and it sits inside the legal range of `TupleMetrics.count` (`int64`) — so the sentinel overlaps values a producer could legitimately report. A named constant in this object, used by `sumNonNegative`'s predicate too, makes the contract greppable from the call sites that have to honour it.
##########
frontend/src/app/workspace/types/execute-workflow.interface.ts:
##########
@@ -159,6 +159,7 @@ export enum ExecutionState {
Terminated = "Terminated",
Failed = "Failed",
Killed = "Killed",
+ CacheReused = "CacheReused",
Review Comment:
Separately: this mirror is on the workflow-level enum, but the state is operator-level — `aggregateMetrics` (ExecutionUtils.scala:54) is the only caller passing `Some(CACHE_REUSED)`.
`OperatorState` (lines 69-79) has no `CacheReused`, and `changeOperatorState` (joint-ui.service.ts:443-459) has no case for it, so a cache-reused operator renders in the gray unknown colour with the raw text "CacheReused". `Terminated` is also absent from `OperatorState`, but harmlessly — `OperatorExecution.getState` can never return it. Here the omission is load-bearing, so please add the member plus a `case OperatorState.CacheReused` alongside `Completed`.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(amber): add cache-reused operator state and cached-region statistics handling [texera]
Posted by "Yicong-Huang (via GitHub)" <gi...@apache.org>.
Yicong-Huang commented on code in PR #6729:
URL: https://github.com/apache/texera/pull/6729#discussion_r3742252015
##########
frontend/src/app/workspace/types/execute-workflow.interface.ts:
##########
@@ -159,6 +159,7 @@ export enum ExecutionState {
Terminated = "Terminated",
Failed = "Failed",
Killed = "Killed",
+ CacheReused = "CacheReused",
Review Comment:
Correcting my earlier comment: adding `CacheReused` to the `ExecutionStateInfo` terminal variant at :180 does not compile on its own.
`updateWorkflowActionLock` (execute-workflow.service.ts:385-404) ends in `return exhaustiveGuard(stateInfo)`, and `exhaustiveGuard` takes `never` (common/util/switch.ts:20). A new `ExecutionStateInfo` member leaves the default branch narrowed to that member instead of `never`, so the call fails TS2345 — one build error replacing the other.
The guard is doing exactly its job here: it is asking where a cache-reused workflow belongs. Add `case ExecutionState.CacheReused:` beside `Completed`/`Terminated` at :387 in the same change.
##########
amber/src/main/scala/org/apache/texera/amber/engine/common/Utils.scala:
##########
@@ -166,6 +168,7 @@ object Utils extends LazyLogging {
case WorkflowAggregatedState.COMPLETED => 3
case WorkflowAggregatedState.FAILED => 4
case WorkflowAggregatedState.KILLED => 5
+ case WorkflowAggregatedState.CACHE_REUSED => 6
Review Comment:
Correcting my earlier comment: keep this case even if the three dashboard mirrors go.
`maptoStatusCode` has a second caller I missed. `ExecutionStatsService.scala:294` writes `maptoStatusCode(stat.operatorState)` into the runtime-statistics `status` column (ResultSchema.scala:36). That surface is operator-level, so it does receive `CACHE_REUSED` once the state has a producer; remove the case and it silently persists `-1`.
The three TS mirrors read `workflow_executions.status` and stay dead. #5883 also puts UI out of scope (#5886) — a second reason to drop just those three.
##########
amber/src/main/scala/org/apache/texera/amber/engine/architecture/coordinator/execution/ExecutionUtils.scala:
##########
@@ -50,7 +50,8 @@ object ExecutionUtils {
WorkflowAggregatedState.RUNNING,
WorkflowAggregatedState.UNINITIALIZED,
WorkflowAggregatedState.PAUSED,
- WorkflowAggregatedState.READY
+ WorkflowAggregatedState.READY,
+ Some(WorkflowAggregatedState.CACHE_REUSED)
Review Comment:
Nothing can put `CACHE_REUSED` into this input, and #5884 won't be able to either without changing the layer below.
`aggregateMetrics` reads states produced by `OperatorExecution.getState` (OperatorExecution.scala:73-84). That call passes no `cachedState`, and `WorkerState` (statistics.proto:32-40) has no cached member to pass. A cached region has zero workers — #5883 says so directly — so `workerStates` is empty and `aggregateStates` returns `UNINITIALIZED` from its `states.isEmpty` branch.
The sentinel half fails the same way: `getStats` on a zero-worker operator emits no port mappings, so nothing can carry a `-1`.
Both branches sit one layer above where the cached shape arrives. If #5884 has to synthesize `OperatorMetrics` for a skipped region anyway, that is where this logic belongs.
##########
amber/src/test/scala/org/apache/texera/amber/engine/architecture/coordinator/execution/ExecutionUtilsSpec.scala:
##########
@@ -181,6 +274,61 @@ class ExecutionUtilsSpec extends AnyFlatSpec {
assert(ExecutionUtils.aggregatePortMetrics(List(mapping)) == Seq(mapping))
}
+ it should "mark a port unknown (-1 count and size) when a mapping has a negative size" in {
+ // A negative in either field marks the whole port unknown, discarding a
+ // valid count. Size-only exercises the right operand of the check.
Review Comment:
"Size-only" is left without a noun to modify.
```suggestion
// valid count. A size-only negative exercises the right operand of the check.
```
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(amber): carry cache-reuse status as a metrics flag [texera]
Posted by "Xiao-zhen-Liu (via GitHub)" <gi...@apache.org>.
Xiao-zhen-Liu merged PR #6729:
URL: https://github.com/apache/texera/pull/6729
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(amber): carry cache-reuse status as a metrics flag [texera]
Posted by "Xiao-zhen-Liu (via GitHub)" <gi...@apache.org>.
Xiao-zhen-Liu commented on code in PR #6729:
URL: https://github.com/apache/texera/pull/6729#discussion_r3771184668
##########
amber/src/main/scala/org/apache/texera/web/service/ExecutionStatsService.scala:
##########
@@ -124,7 +124,8 @@ class ExecutionStatsService(
metrics.operatorStatistics.numWorkers,
metrics.operatorStatistics.dataProcessingTime,
metrics.operatorStatistics.controlProcessingTime,
- metrics.operatorStatistics.idleTime
+ metrics.operatorStatistics.idleTime,
+ reusedFromCache = metrics.reusedFromCache
Review Comment:
Deleted the rebuild; computeStatsDiff now returns the combined map as is, so the flag survives to the #5884 decision.
##########
amber/src/test/scala/org/apache/texera/amber/engine/architecture/coordinator/execution/ExecutionUtilsSpec.scala:
##########
@@ -337,4 +339,27 @@ class ExecutionUtilsSpec extends AnyFlatSpec {
assert(result.operatorStatistics.numWorkers == 3)
assert(result.operatorStatistics.dataProcessingTime == 12)
}
+
+ // -- aggregateMetrics: reused-from-cache provenance ----------------------
+
+ it should "report reusedFromCache only when every physical operator is reused" in {
+ val reusedA = metricsWith(WorkflowAggregatedState.COMPLETED, reused = true)
+ val reusedB = metricsWith(WorkflowAggregatedState.COMPLETED, reused = true)
+ val computed = metricsWith(WorkflowAggregatedState.COMPLETED)
+
+ assert(ExecutionUtils.aggregateMetrics(List(reusedA, reusedB)).reusedFromCache)
+ assert(!ExecutionUtils.aggregateMetrics(List(reusedA, computed)).reusedFromCache)
+ assert(!ExecutionUtils.aggregateMetrics(List(computed)).reusedFromCache)
+ }
+
+ it should "default reusedFromCache to false for empty input and untouched metrics" in {
+ // Empty input takes the early-return path, whose default is false. This is
+ // the empty-cache property for the flag: nothing sets it until a producer does.
Review Comment:
Applied your wording, and dropped the duplicate assertion.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(amber): carry cache-reuse status as a metrics flag [texera]
Posted by "Yicong-Huang (via GitHub)" <gi...@apache.org>.
Yicong-Huang commented on code in PR #6729:
URL: https://github.com/apache/texera/pull/6729#discussion_r3764523354
##########
amber/src/main/scala/org/apache/texera/web/service/ExecutionStatsService.scala:
##########
@@ -124,7 +124,8 @@ class ExecutionStatsService(
metrics.operatorStatistics.numWorkers,
metrics.operatorStatistics.dataProcessingTime,
metrics.operatorStatistics.controlProcessingTime,
- metrics.operatorStatistics.idleTime
+ metrics.operatorStatistics.idleTime,
+ reusedFromCache = metrics.reusedFromCache
Review Comment:
`computeStatsDiff` below (`:243-256`) rebuilds `OperatorMetrics` from `operatorState` plus the six `OperatorStatistics` fields — an identity transform before this PR, hence its "consistent structure" comment. With field 3 it silently resets `reusedFromCache` to `false`.
Nothing observes that today, since `runtimeStatisticsSchema` has no such column. But whether that row carries the flag is a #5884 decision you name in the description, and this block would feed it `false`. The rebuild is a no-op, so deleting it is the cleanest fix.
##########
amber/src/test/scala/org/apache/texera/amber/engine/architecture/coordinator/execution/ExecutionUtilsSpec.scala:
##########
@@ -337,4 +339,27 @@ class ExecutionUtilsSpec extends AnyFlatSpec {
assert(result.operatorStatistics.numWorkers == 3)
assert(result.operatorStatistics.dataProcessingTime == 12)
}
+
+ // -- aggregateMetrics: reused-from-cache provenance ----------------------
+
+ it should "report reusedFromCache only when every physical operator is reused" in {
+ val reusedA = metricsWith(WorkflowAggregatedState.COMPLETED, reused = true)
+ val reusedB = metricsWith(WorkflowAggregatedState.COMPLETED, reused = true)
+ val computed = metricsWith(WorkflowAggregatedState.COMPLETED)
+
+ assert(ExecutionUtils.aggregateMetrics(List(reusedA, reusedB)).reusedFromCache)
+ assert(!ExecutionUtils.aggregateMetrics(List(reusedA, computed)).reusedFromCache)
+ assert(!ExecutionUtils.aggregateMetrics(List(computed)).reusedFromCache)
+ }
+
+ it should "default reusedFromCache to false for empty input and untouched metrics" in {
+ // Empty input takes the early-return path, whose default is false. This is
+ // the empty-cache property for the flag: nothing sets it until a producer does.
Review Comment:
"the empty-cache property for the flag" is PR-history vocabulary — it reads only to someone holding this PR's discussion, and stops meaning anything once this merges.
```suggestion
// Empty input takes the early-return path, whose default is false; metrics
// that no producer has marked keep that default too.
```
While you are here: the second assertion (`:359-363`) repeats `:352`. Both are `forall` over a single `reused = false` element, and the differing state does not affect the flag.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(amber): carry cache-reuse status as a metrics flag [texera]
Posted by "Yicong-Huang (via GitHub)" <gi...@apache.org>.
Yicong-Huang commented on code in PR #6729:
URL: https://github.com/apache/texera/pull/6729#discussion_r3771672957
##########
amber/src/main/scala/org/apache/texera/amber/engine/architecture/coordinator/execution/ExecutionUtils.scala:
##########
@@ -77,7 +77,11 @@ object ExecutionUtils {
dataProcessingTimeSum,
controlProcessingTimeSum,
idleTimeSum
- )
+ ),
+ // A logical operator is reused from cache only when every one of its
+ // physical operators is. `metrics` is non-empty here, so this cannot
+ // hold vacuously.
+ reusedFromCache = metrics.forall(_.reusedFromCache)
Review Comment:
The comment promises more than the input set delivers. The only caller (`WorkflowExecution.scala:94-110`) flattens `getAllRegionExecutions` and groups by `logicalOpId`, so `metrics` holds the physical operators that currently *have* a region execution. For a HashJoin, the probe operator contributes nothing until its region is created, so `forall` can return true with a later operator still to come. `SyncExecutionResource.scala:189-200` documents that same window for the sibling state field, so this is the function's existing shape rather than something you introduced.
Can a logical operator ever be *partially* reused under #5884? If reuse is all-or-nothing, only the comment needs narrowing to "the physical operators reporting so far". If it can be partial, the flag wants the same late-region guard the state field got.
##########
amber/src/main/scala/org/apache/texera/web/model/websocket/event/OperatorStatisticsUpdateEvent.scala:
##########
@@ -30,7 +30,9 @@ case class OperatorAggregatedMetrics(
numWorkers: Long,
aggregatedDataProcessingTime: Long,
aggregatedControlProcessingTime: Long,
- aggregatedIdleTime: Long
+ aggregatedIdleTime: Long,
+ // Provenance: the operator completed by reusing cached results (no workers ran).
+ reusedFromCache: Boolean = false
Review Comment:
This is the only one of the twelve fields with a default, and neither construction site takes it — `ExecutionStatsService.scala:128` and `TexeraWebSocketEventSpec.scala:129` both pass it explicitly. Its only live effect is on the *next* construction site, where it turns a forgotten flag into a silent `false` rather than a compile error. That is the shape of the `computeStatsDiff` rebuild we just deleted, so it seems worth closing off while it is free.
```suggestion
reusedFromCache: Boolean
```
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(amber): add cache-reused operator state and cached-region statistics handling [texera]
Posted by "Yicong-Huang (via GitHub)" <gi...@apache.org>.
Yicong-Huang commented on PR #6729:
URL: https://github.com/apache/texera/pull/6729#issuecomment-5062963985
I will have to check in on weekend.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(amber): add cache-reused operator state and cached-region statistics handling [texera]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6729:
URL: https://github.com/apache/texera/pull/6729#issuecomment-5040655899
<!-- texera-benchmarks-comment -->
## ⚠️ Benchmark changes need a look
🟢 2 better · 🔴 5 worse · ⚪ 8 noise (<±5%) · 0 without baseline
> Compared against main `d444fe0` benchmarked on **this same runner**, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.
[Dashboard](https://apache.github.io/texera/dev/bench/) · [Run](https://github.com/apache/texera/actions/runs/29881706954)
| | config | throughput | MB/s | latency | max Δ latest / 7d |
|---|---|---:|---:|---:|---:|
| 🟢 | bs=10 sw=10 sl=64 | 565 | 0.345 | 17,269/22,200/22,200 us | 🟢 -35.8% / 🔴 +40.4% |
| 🔴 | bs=100 sw=10 sl=64 | 1,192 | 0.727 | 83,405/114,541/114,541 us | 🔴 +30.3% / 🟢 +18.1% |
| ⚪ | bs=1000 sw=10 sl=64 | 1,440 | 0.879 | 699,297/733,031/733,031 us | ⚪ within ±5% / 🟢 +37.9% |
<details><summary>Baseline details</summary>
Latest main `d444fe0` from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---:|---:|---:|---:|---:|
| bs=10 sw=10 sl=64 | throughput | 565 tuples/sec | 556 tuples/sec | 769.76 tuples/sec | +1.6% | -26.6% |
| bs=10 sw=10 sl=64 | MB/s | 0.345 MB/s | 0.339 MB/s | 0.47 MB/s | +1.8% | -26.6% |
| bs=10 sw=10 sl=64 | p50 | 17,269 us | 16,738 us | 12,663 us | +3.2% | +36.4% |
| bs=10 sw=10 sl=64 | p95 | 22,200 us | 34,590 us | 15,813 us | -35.8% | +40.4% |
| bs=10 sw=10 sl=64 | p99 | 22,200 us | 34,590 us | 19,001 us | -35.8% | +16.8% |
| bs=100 sw=10 sl=64 | throughput | 1,192 tuples/sec | 1,288 tuples/sec | 1,009 tuples/sec | -7.5% | +18.1% |
| bs=100 sw=10 sl=64 | MB/s | 0.727 MB/s | 0.786 MB/s | 0.616 MB/s | -7.5% | +18.0% |
| bs=100 sw=10 sl=64 | p50 | 83,405 us | 77,894 us | 99,444 us | +7.1% | -16.1% |
| bs=100 sw=10 sl=64 | p95 | 114,541 us | 87,904 us | 105,012 us | +30.3% | +9.1% |
| bs=100 sw=10 sl=64 | p99 | 114,541 us | 87,904 us | 116,467 us | +30.3% | -1.7% |
| bs=1000 sw=10 sl=64 | throughput | 1,440 tuples/sec | 1,434 tuples/sec | 1,044 tuples/sec | +0.4% | +37.9% |
| bs=1000 sw=10 sl=64 | MB/s | 0.879 MB/s | 0.875 MB/s | 0.637 MB/s | +0.5% | +37.9% |
| bs=1000 sw=10 sl=64 | p50 | 699,297 us | 698,595 us | 964,034 us | +0.1% | -27.5% |
| bs=1000 sw=10 sl=64 | p95 | 733,031 us | 730,914 us | 1,007,497 us | +0.3% | -27.2% |
| bs=1000 sw=10 sl=64 | p99 | 733,031 us | 730,914 us | 1,040,936 us | +0.3% | -29.6% |
</details>
<details><summary>Raw CSV</summary>
```csv
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,354.15,200,128000,565,0.345,17268.55,22199.82,22199.82
1,100,10,64,20,1677.99,2000,1280000,1192,0.727,83405.42,114541.37,114541.37
2,1000,10,64,20,13891.83,20000,12800000,1440,0.879,699297.10,733031.39,733031.39
```
</details>
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(amber): add cache-reused operator state and cached-region statistics handling [texera]
Posted by "Xiao-zhen-Liu (via GitHub)" <gi...@apache.org>.
Xiao-zhen-Liu commented on code in PR #6729:
URL: https://github.com/apache/texera/pull/6729#discussion_r3648782697
##########
amber/src/main/scala/org/apache/texera/amber/engine/common/Utils.scala:
##########
@@ -141,6 +143,7 @@ object Utils extends LazyLogging {
case WorkflowAggregatedState.COMPLETED => 3
case WorkflowAggregatedState.FAILED => 4
case WorkflowAggregatedState.KILLED => 5
+ case WorkflowAggregatedState.CACHE_REUSED => 6
Review Comment:
Good catch, thanks. Mirrored code 6 in the frontend: added `CacheReused` to the `ExecutionState` enum and `EXECUTION_STATUS_CODE`, plus the `statusMapping` and the `getExecutionStatus` icon in the execution-history modal (a `database` icon in cyan `#13c2c2`), with a spec assertion. Happy to change the icon/color if you would prefer something else.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(amber): carry cache-reuse status as a metrics flag [texera]
Posted by "Xiao-zhen-Liu (via GitHub)" <gi...@apache.org>.
Xiao-zhen-Liu commented on code in PR #6729:
URL: https://github.com/apache/texera/pull/6729#discussion_r3755724674
##########
frontend/src/app/workspace/types/execute-workflow.interface.ts:
##########
@@ -159,6 +159,7 @@ export enum ExecutionState {
Terminated = "Terminated",
Failed = "Failed",
Killed = "Killed",
+ CacheReused = "CacheReused",
Review Comment:
Gone with the rework: the enum member no longer exists, so neither does this build break. The frontend production build passes on the new head.
##########
frontend/src/app/workspace/types/execute-workflow.interface.ts:
##########
@@ -159,6 +159,7 @@ export enum ExecutionState {
Terminated = "Terminated",
Failed = "Failed",
Killed = "Killed",
+ CacheReused = "CacheReused",
Review Comment:
Confirmed, and it went moot the same way: with the enum member gone there is no ExecutionStateInfo change and no guard case to add.
##########
frontend/src/app/workspace/types/execute-workflow.interface.ts:
##########
@@ -159,6 +159,7 @@ export enum ExecutionState {
Terminated = "Terminated",
Failed = "Failed",
Killed = "Killed",
+ CacheReused = "CacheReused",
Review Comment:
Agreed the operator level is where this information belongs. Per #5880 it now travels as reused_from_cache on OperatorStatistics rather than a state value, so OperatorState stays untouched. The badge rendering comes with #5886.
##########
amber/src/main/scala/org/apache/texera/amber/engine/common/Utils.scala:
##########
@@ -166,6 +168,7 @@ object Utils extends LazyLogging {
case WorkflowAggregatedState.COMPLETED => 3
case WorkflowAggregatedState.FAILED => 4
case WorkflowAggregatedState.KILLED => 5
+ case WorkflowAggregatedState.CACHE_REUSED => 6
Review Comment:
Gone with the state (#5880): this case and the three dashboard mirrors. A reused operator's runtime statistics row now records COMPLETED.
##########
amber/src/main/scala/org/apache/texera/amber/engine/architecture/coordinator/execution/ExecutionUtils.scala:
##########
@@ -81,26 +82,50 @@ object ExecutionUtils {
)
}
+ /**
+ * Rolls a group of execution states up into one workflow-level state.
+ *
+ * When `cachedState` is provided and every state equals it, the group is
+ * reported as CACHE_REUSED. A cached state is otherwise terminal, like
+ * completed and terminated: it counts toward the all-terminal case and is
+ * dropped before the remaining states are classified. `cachedState`
+ * defaults to None, so an empty cache leaves this method byte-identical
+ * to before. When given, it must differ from the other six states.
+ */
def aggregateStates[T](
states: Iterable[T],
completedState: T,
terminatedState: T,
runningState: T,
uninitializedState: T,
pausedState: T,
- readyState: T
+ readyState: T,
+ cachedState: Option[T] = None
Review Comment:
The rework drops the cachedState parameter, so the signature is back to main's seven. Agreed the next parameter added here should be bundled rather than positional.
##########
amber/src/main/scala/org/apache/texera/amber/engine/architecture/coordinator/execution/ExecutionUtils.scala:
##########
@@ -81,26 +82,50 @@ object ExecutionUtils {
)
}
+ /**
+ * Rolls a group of execution states up into one workflow-level state.
+ *
+ * When `cachedState` is provided and every state equals it, the group is
+ * reported as CACHE_REUSED. A cached state is otherwise terminal, like
+ * completed and terminated: it counts toward the all-terminal case and is
+ * dropped before the remaining states are classified. `cachedState`
+ * defaults to None, so an empty cache leaves this method byte-identical
+ * to before. When given, it must differ from the other six states.
Review Comment:
That scaladoc is gone with the rework, since aggregateStates is untouched now. Point taken on the wording.
##########
amber/src/test/scala/org/apache/texera/amber/engine/architecture/coordinator/execution/ExecutionUtilsSpec.scala:
##########
@@ -181,6 +274,61 @@ class ExecutionUtilsSpec extends AnyFlatSpec {
assert(ExecutionUtils.aggregatePortMetrics(List(mapping)) == Seq(mapping))
}
+ it should "mark a port unknown (-1 count and size) when a mapping has a negative size" in {
+ // A negative in either field marks the whole port unknown, discarding a
+ // valid count. Size-only exercises the right operand of the check.
Review Comment:
That test went with the sentinel in the rework.
##########
amber/src/main/scala/org/apache/texera/amber/engine/architecture/coordinator/execution/ExecutionUtils.scala:
##########
@@ -81,20 +82,30 @@ object ExecutionUtils {
)
}
+ /**
+ * Rolls a group of execution states up into one workflow-level state.
+ *
+ * When `cachedState` is provided and every state equals it, the group is
+ * reported as CACHE_REUSED. `cachedState` defaults to None, so an
+ * empty cache leaves this method byte-identical to before.
+ */
def aggregateStates[T](
states: Iterable[T],
completedState: T,
terminatedState: T,
runningState: T,
uninitializedState: T,
pausedState: T,
- readyState: T
+ readyState: T,
+ cachedState: Option[T] = None
): WorkflowAggregatedState = {
states match {
case _ if states.isEmpty => WorkflowAggregatedState.UNINITIALIZED
case _ if states.forall(_ == completedState) => WorkflowAggregatedState.COMPLETED
case _ if states.forall(_ == terminatedState) => WorkflowAggregatedState.COMPLETED
- case _ if states.exists(_ == runningState) => WorkflowAggregatedState.RUNNING
+ case _ if cachedState.isDefined && states.forall(_ == cachedState.get) =>
Review Comment:
Following up: per #5880 the state is dropped entirely, so the terminal-state handling we settled here went with it. Reuse now travels as a reused_from_cache boolean on OperatorMetrics, and a reused operator reports COMPLETED.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(amber): carry cache-reuse status as a metrics flag [texera]
Posted by "Xiao-zhen-Liu (via GitHub)" <gi...@apache.org>.
Xiao-zhen-Liu commented on code in PR #6729:
URL: https://github.com/apache/texera/pull/6729#discussion_r3755700707
##########
amber/src/main/protobuf/org/apache/texera/amber/engine/architecture/rpc/controlreturns.proto:
##########
@@ -126,6 +126,7 @@ enum WorkflowAggregatedState {
UNKNOWN = 8;
KILLED = 9;
TERMINATED = 10;
+ CACHE_REUSED = 11;
Review Comment:
Answered in #5880: agreed, and the state should not exist at the operator level either, since three operator-level consumers compare against COMPLETED. The PR is reworked: the state, its mirrors, and the aggregateStates changes are all gone. What remains is a reused_from_cache boolean on OperatorMetrics, carried to the stats event. Thanks for the two corrections, both confirmed.
##########
amber/src/main/scala/org/apache/texera/amber/engine/architecture/coordinator/execution/ExecutionUtils.scala:
##########
@@ -50,7 +50,8 @@ object ExecutionUtils {
WorkflowAggregatedState.RUNNING,
WorkflowAggregatedState.UNINITIALIZED,
WorkflowAggregatedState.PAUSED,
- WorkflowAggregatedState.READY
+ WorkflowAggregatedState.READY,
+ Some(WorkflowAggregatedState.CACHE_REUSED)
Review Comment:
Right. The rework removes those branches. What remains is the proto field, which #5884's producer (OperatorExecution.cachedMetrics) fills at exactly the layer you pointed at.
##########
amber/src/main/scala/org/apache/texera/web/service/ExecutionStatsService.scala:
##########
@@ -115,11 +116,19 @@ class ExecutionStatsService(
val res = OperatorAggregatedMetrics(
Utils.aggregatedStateToString(metrics.operatorState),
- metrics.operatorStatistics.inputMetrics.map(_.tupleMetrics.count).sum,
- metrics.operatorStatistics.inputMetrics.map(_.tupleMetrics.size).sum,
+ ExecutionUtils.sumNonNegative(
+ metrics.operatorStatistics.inputMetrics.map(_.tupleMetrics.count)
Review Comment:
The sentinel is out of this PR. If an unknown marker comes back with the producer in #5884, we will fix it on the render side as you suggest, so an unknown port shows as unknown.
##########
amber/src/main/scala/org/apache/texera/amber/engine/architecture/coordinator/execution/ExecutionUtils.scala:
##########
@@ -121,10 +146,20 @@ object ExecutionUtils {
.view
.map {
case (portId, mappings) =>
- val totalCount = mappings.map(_.tupleMetrics.count).sum
- val totalSize = mappings.map(_.tupleMetrics.size).sum
+ // A negative count/size marks an unknown value (e.g. a cached input
+ // port), so any unknown keeps the aggregated port metrics unknown.
+ val hasUnknown =
+ mappings.exists(m => m.tupleMetrics.count < 0 || m.tupleMetrics.size < 0)
+ val totalCount = if (hasUnknown) -1L else mappings.map(_.tupleMetrics.count).sum
Review Comment:
Moved to #5884 with the rest of the unknown-count handling, if the marker survives at all.
##########
amber/src/main/scala/org/apache/texera/amber/engine/common/Utils.scala:
##########
@@ -166,6 +168,7 @@ object Utils extends LazyLogging {
case WorkflowAggregatedState.COMPLETED => 3
case WorkflowAggregatedState.FAILED => 4
case WorkflowAggregatedState.KILLED => 5
+ case WorkflowAggregatedState.CACHE_REUSED => 6
Review Comment:
Confirmed the second writer, thanks. With the state gone this case goes too, and a reused operator's runtime statistics row records COMPLETED. Whether that row also carries the reused flag is a #5884 decision.
##########
amber/src/main/scala/org/apache/texera/amber/engine/common/Utils.scala:
##########
@@ -141,6 +143,7 @@ object Utils extends LazyLogging {
case WorkflowAggregatedState.COMPLETED => 3
case WorkflowAggregatedState.FAILED => 4
case WorkflowAggregatedState.KILLED => 5
+ case WorkflowAggregatedState.CACHE_REUSED => 6
Review Comment:
Per #5880 the status code and its mirrors are dropped together with the state. Your comment here is what started that finding, thanks.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(amber): add cache-reused operator state and cached-region statistics handling [texera]
Posted by "Xiao-zhen-Liu (via GitHub)" <gi...@apache.org>.
Xiao-zhen-Liu commented on PR #6729:
URL: https://github.com/apache/texera/pull/6729#issuecomment-5153640241
> I will have to check in on weekend.
@Yicong-Huang Can you review this PR? Thanks.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(amber): carry cache-reuse status as a metrics flag [texera]
Posted by "Xiao-zhen-Liu (via GitHub)" <gi...@apache.org>.
Xiao-zhen-Liu commented on code in PR #6729:
URL: https://github.com/apache/texera/pull/6729#discussion_r3801607189
##########
amber/src/main/scala/org/apache/texera/amber/engine/architecture/coordinator/execution/ExecutionUtils.scala:
##########
@@ -77,7 +77,11 @@ object ExecutionUtils {
dataProcessingTimeSum,
controlProcessingTimeSum,
idleTimeSum
- )
+ ),
+ // A logical operator is reused from cache only when every one of its
+ // physical operators is. `metrics` is non-empty here, so this cannot
+ // hold vacuously.
+ reusedFromCache = metrics.forall(_.reusedFromCache)
Review Comment:
Partial reuse is possible: reuse is decided per region, and a logical operator's physical operators can sit in different regions (HashJoin's build and probe). So the forall is a deliberate choice of fully-reused semantics: a partially reused operator reports false at the operator level, and the per-port marks in #5886 carry the partial detail from the cache entries. That also makes the window you describe real, so the flag should get the same late-region handling as the state field; that rides with the producer in #5884. The comment now states both.
##########
amber/src/main/scala/org/apache/texera/web/model/websocket/event/OperatorStatisticsUpdateEvent.scala:
##########
@@ -30,7 +30,9 @@ case class OperatorAggregatedMetrics(
numWorkers: Long,
aggregatedDataProcessingTime: Long,
aggregatedControlProcessingTime: Long,
- aggregatedIdleTime: Long
+ aggregatedIdleTime: Long,
+ // Provenance: the operator completed by reusing cached results (no workers ran).
+ reusedFromCache: Boolean = false
Review Comment:
Dropped the default; both sites pass it explicitly, so the next construction site fails to compile instead of silently sending false.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(amber): add cache-reused operator state and cached-region statistics handling [texera]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #6729:
URL: https://github.com/apache/texera/pull/6729#issuecomment-5075681824
### :warning: JUnit XML file not found
The CLI was unable to find any JUnit XML files to upload.
For more help, visit our [troubleshooting guide](https://docs.codecov.com/docs/test-analytics#troubleshooting).
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(amber): add cache-reused operator state and cached-region statistics handling [texera]
Posted by "carloea2 (via GitHub)" <gi...@apache.org>.
carloea2 commented on code in PR #6729:
URL: https://github.com/apache/texera/pull/6729#discussion_r3662869211
##########
amber/src/main/scala/org/apache/texera/amber/engine/architecture/coordinator/execution/ExecutionUtils.scala:
##########
@@ -81,20 +82,30 @@ object ExecutionUtils {
)
}
+ /**
+ * Rolls a group of execution states up into one workflow-level state.
+ *
+ * When `cachedState` is provided and every state equals it, the group is
+ * reported as CACHE_REUSED. `cachedState` defaults to None, so an
+ * empty cache leaves this method byte-identical to before.
+ */
def aggregateStates[T](
states: Iterable[T],
completedState: T,
terminatedState: T,
runningState: T,
uninitializedState: T,
pausedState: T,
- readyState: T
+ readyState: T,
+ cachedState: Option[T] = None
): WorkflowAggregatedState = {
states match {
case _ if states.isEmpty => WorkflowAggregatedState.UNINITIALIZED
case _ if states.forall(_ == completedState) => WorkflowAggregatedState.COMPLETED
case _ if states.forall(_ == terminatedState) => WorkflowAggregatedState.COMPLETED
- case _ if states.exists(_ == runningState) => WorkflowAggregatedState.RUNNING
+ case _ if cachedState.isDefined && states.forall(_ == cachedState.get) =>
Review Comment:
Could you help confirm the intended behavior for mixed cached states? My reading of #5883 is that CACHE_REUSED should behave as a terminal state. With the current fallback, combinations such as COMPLETED + CACHE_REUSED appear to become UNKNOWN, and cached plus paused/ready may also fall through to UNKNOWN. Would it make sense to preserve the all-cached CACHE_REUSED case, then exclude completed, terminated, and cached states before classifying the remainder? This may also matter when resolving the conflict with #6011.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(amber): add cache-reused operator state and cached-region statistics handling [texera]
Posted by "Xiao-zhen-Liu (via GitHub)" <gi...@apache.org>.
Xiao-zhen-Liu commented on code in PR #6729:
URL: https://github.com/apache/texera/pull/6729#discussion_r3696748190
##########
amber/src/main/scala/org/apache/texera/amber/engine/architecture/coordinator/execution/ExecutionUtils.scala:
##########
@@ -81,20 +82,30 @@ object ExecutionUtils {
)
}
+ /**
+ * Rolls a group of execution states up into one workflow-level state.
+ *
+ * When `cachedState` is provided and every state equals it, the group is
+ * reported as CACHE_REUSED. `cachedState` defaults to None, so an
+ * empty cache leaves this method byte-identical to before.
+ */
def aggregateStates[T](
states: Iterable[T],
completedState: T,
terminatedState: T,
runningState: T,
uninitializedState: T,
pausedState: T,
- readyState: T
+ readyState: T,
+ cachedState: Option[T] = None
): WorkflowAggregatedState = {
states match {
case _ if states.isEmpty => WorkflowAggregatedState.UNINITIALIZED
case _ if states.forall(_ == completedState) => WorkflowAggregatedState.COMPLETED
case _ if states.forall(_ == terminatedState) => WorkflowAggregatedState.COMPLETED
- case _ if states.exists(_ == runningState) => WorkflowAggregatedState.RUNNING
+ case _ if cachedState.isDefined && states.forall(_ == cachedState.get) =>
Review Comment:
Adopted, thanks. Rebased onto #6011's merged terminal branch and treated cached as terminal there:
- all cached returns CACHE_REUSED, checked first
- completed plus cached returns COMPLETED
- cached plus paused or ready returns PAUSED or RUNNING
One deviation: the remainder step drops completed and cached but not terminated. Dropping terminated would change results with no cache involved, for example terminated plus paused is UNKNOWN on main today and would become PAUSED. There is a comment and a test for it.
Empty cache is unchanged: with `cachedState = None` each branch reduces to main's. I ran both versions over every input up to length 4, no differences.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(amber): add cache-reused operator state and cached-region statistics handling [texera]
Posted by "Xiao-zhen-Liu (via GitHub)" <gi...@apache.org>.
Xiao-zhen-Liu commented on PR #6729:
URL: https://github.com/apache/texera/pull/6729#issuecomment-5040630469
@Yicong-Huang would you be able to review this one? (I couldn't add you via the reviewer field from a fork PR.) It's the cache state + stats slice of the operator output port result cache (#5883, under #5881), lands dormant with the empty-cache == main safety property.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(amber): add cache-reused operator state and cached-region statistics handling [texera]
Posted by "Xiao-zhen-Liu (via GitHub)" <gi...@apache.org>.
Xiao-zhen-Liu commented on PR #6729:
URL: https://github.com/apache/texera/pull/6729#issuecomment-5040628367
@carloea2 this is PR 2 of the operator output port result cache (MVP): the completed-from-cache operator state (`CACHE_REUSED`) plus cached-region statistics handling (#5883). Would appreciate your eyes on it. It lands dormant, with the empty-cache == main safety property held.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org