Repository navigation
test(amber): cover the coordinator WorkerStateUpdatedHandler - #7610
aglinxinyuan merged 1 commit into
Conversation
Automated Reviewer SuggestionsBased on the
|
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 446 | 0.272 | 21,636/29,700/29,700 us | 🔴 +11.5% / 🔴 +82.1% |
| 🔴 | bs=100 sw=10 sl=64 | 910 | 0.556 | 105,138/140,333/140,333 us | 🔴 -5.2% / 🔴 +29.7% |
| ⚪ | bs=1000 sw=10 sl=64 | 1,091 | 0.666 | 920,363/976,403/976,403 us | ⚪ within ±5% / 🟢 -9.2% |
Baseline details
Latest main c35bdb1 from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 446 tuples/sec | 473 tuples/sec | 775.33 tuples/sec | -5.7% | -42.5% |
| bs=10 sw=10 sl=64 | MB/s | 0.272 MB/s | 0.289 MB/s | 0.473 MB/s | -5.9% | -42.5% |
| bs=10 sw=10 sl=64 | p50 | 21,636 us | 19,398 us | 12,743 us | +11.5% | +69.8% |
| bs=10 sw=10 sl=64 | p95 | 29,700 us | 30,746 us | 16,310 us | -3.4% | +82.1% |
| bs=10 sw=10 sl=64 | p99 | 29,700 us | 30,746 us | 18,926 us | -3.4% | +56.9% |
| bs=100 sw=10 sl=64 | throughput | 910 tuples/sec | 960 tuples/sec | 1,001 tuples/sec | -5.2% | -9.1% |
| bs=100 sw=10 sl=64 | MB/s | 0.556 MB/s | 0.586 MB/s | 0.611 MB/s | -5.1% | -9.0% |
| bs=100 sw=10 sl=64 | p50 | 105,138 us | 102,956 us | 101,399 us | +2.1% | +3.7% |
| bs=100 sw=10 sl=64 | p95 | 140,333 us | 139,494 us | 108,206 us | +0.6% | +29.7% |
| bs=100 sw=10 sl=64 | p99 | 140,333 us | 139,494 us | 118,195 us | +0.6% | +18.7% |
| bs=1000 sw=10 sl=64 | throughput | 1,091 tuples/sec | 1,088 tuples/sec | 1,026 tuples/sec | +0.3% | +6.3% |
| bs=1000 sw=10 sl=64 | MB/s | 0.666 MB/s | 0.664 MB/s | 0.626 MB/s | +0.3% | +6.3% |
| bs=1000 sw=10 sl=64 | p50 | 920,363 us | 919,569 us | 996,304 us | +0.1% | -7.6% |
| bs=1000 sw=10 sl=64 | p95 | 976,403 us | 966,300 us | 1,042,531 us | +1.0% | -6.3% |
| bs=1000 sw=10 sl=64 | p99 | 976,403 us | 966,300 us | 1,074,934 us | +1.0% | -9.2% |
Raw 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,448.23,200,128000,446,0.272,21635.90,29699.95,29699.95
1,100,10,64,20,2196.78,2000,1280000,910,0.556,105138.32,140333.21,140333.21
2,1000,10,64,20,18338.25,20000,12800000,1091,0.666,920363.08,976403.05,976403.05
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7610 +/- ##
============================================
+ Coverage 87.87% 88.54% +0.67%
- Complexity 4275 4341 +66
============================================
Files 1176 1178 +2
Lines 46890 46909 +19
Branches 5228 5229 +1
============================================
+ Hits 41205 41536 +331
+ Misses 3961 3612 -349
- Partials 1724 1761 +37
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Add WorkerStateUpdatedHandlerSpec, covering the sender-scoped state update, the version ordering and terminal absorption, the silent-skip branch, and the client broadcasts.
de4c0e3 to
da61899
Compare
What changes were proposed in this PR?
This PR adds
WorkerStateUpdatedHandlerSpec, the first unit coverage foramber/src/main/scala/org/apache/texera/amber/engine/architecture/coordinator/promisehandlers/WorkerStateUpdatedHandler.scala. The handler had no references anywhere in the test tree. The version-ordered state model it feeds was fixed and tested in #6011, which gaveWorkerExecutiona spec, but the handler wiring itself was unpinned.No production code is changed; this is a test-only PR.
The spec drives a real
CoordinatorProcessorwith no ActorSystem and captures the dispatched client events through the coordinator's output handler. The 20 tests pin the handler's lookup, the update it applies, and the broadcasts it emits:ctx.sender, and the update lands on that worker alone rather than on the operator's other workers or on another operator;stateVersion, so a stale or re-delivered version is ignored while a strictly newer one applies, and the version each worker carries is its own rather than shared across the operator;ExecutionStatsUpdateandRuntimeStatisticsPersiststill fire and the reply is still an empty success;lastStateVersionstarts at-1and the comparison is strictly-greater: a first report at-1is dropped as if stale, and a report atLong.MaxValuefreezes a worker even when its state is not terminal.Two of these record current behavior that a reader may find surprising, and each says so in a comment rather than implying endorsement. An unknown worker of a known operator throws a
NullPointerException, becausegetWorkerExecutionis aConcurrentHashMap.getwhosenullis dereferenced immediately, and on that path both client broadcasts are lost, which is the opposite of how an unknown operator is handled one branch away. A report carrying the proto defaultUNINITIALIZEDat version 0 is applied invisibly and consumes the first real version, so the worker's genuine first transition is then dropped without a trace. If either is later changed deliberately, the corresponding test turns red and forces that decision to be explicit.Any related issues, documentation, discussions?
Closes #7607
Related: #6011 introduced the version-ordered state model this handler feeds.
How was this PR tested?
The 20 new tests were run locally, together with the six pre-existing specs in the same package and the wider coordinator package:
Both positive and negative directions are covered, along with the empty and boundary cases: an applied update and a skipped one, a workflow execution with no region execution at all, the
-1version sentinel, and theLong.MaxValueceiling.The assertions were mutation-checked rather than assumed to be meaningful. Mutations were applied one at a time to
WorkerStateUpdatedHandler.scala,WorkerExecution.scalaandOperatorExecution.scala, and each turned the spec red: dropping eithersendToClientcall, swapping their order, guarding them behind a non-empty statistics map, replacinggetRunningRegionExecutionswith all region executions, wideningfindtofilter, deriving the operator fromctx.receiverinstead ofctx.sender, computing the statistics snapshot before applying the update, forwarding a constant version toupdateState, moving the sentinel off-1, changing the version comparison to<=or!=, adding a state-equality condition to the guard, removingTERMINATEDfrom the terminal check, and returning one sharedWorkerExecutionfor every worker. The production files were restored and verified byte-identical toHEADafterwards.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5)