This is an automated email from the ASF dual-hosted git repository.
gian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push:
new f9f0759c5e4 Console: Report workers active with any interesting
activity. (#19183)
f9f0759c5e4 is described below
commit f9f0759c5e4fdcce646ec719a7602a17436a54ad
Author: Gian Merlino <[email protected]>
AuthorDate: Fri Mar 20 08:30:39 2026 -0700
Console: Report workers active with any interesting activity. (#19183)
Currently workers are reported as active in the web console if they
report nonzero rows for any channel. However, because segment input
rows are typically reported when the segment is done processing,
workers that just started can be active even when they have not yet
reported rows.
This patch adjusts the logic such that any nonzero rows, files, bytes,
frames, or wall time is enough to consider a worker active.
---
web-console/src/druid-models/stages/stages.spec.ts | 57 ++++++++++++++++++++++
web-console/src/druid-models/stages/stages.ts | 26 +++++++---
.../execution-stages-pane.tsx | 2 +-
3 files changed, 77 insertions(+), 8 deletions(-)
diff --git a/web-console/src/druid-models/stages/stages.spec.ts
b/web-console/src/druid-models/stages/stages.spec.ts
index b0564e67b5e..d0054d7fe0d 100644
--- a/web-console/src/druid-models/stages/stages.spec.ts
+++ b/web-console/src/druid-models/stages/stages.spec.ts
@@ -422,6 +422,63 @@ describe('Stages', () => {
// Worker 1 has output/shuffle data, so it's active even though input is
zero
expect(inactiveCount).toBe(1);
});
+
+ it('counts worker as active if it has wall time but no channel activity
yet', () => {
+ const customStages = new Stages(
+ [
+ {
+ stageNumber: 0,
+ definition: {
+ id: 'test-stage',
+ input: [
+ {
+ type: 'external',
+ inputSource: { type: 'http', uris: [] },
+ inputFormat: { type: 'json' },
+ signature: [],
+ },
+ ],
+ processor: { type: 'scan' },
+ signature: [],
+ maxWorkerCount: 2,
+ },
+ phase: 'READING_INPUT',
+ workerCount: 2,
+ partitionCount: 1,
+ },
+ ],
+ {
+ '0': {
+ '0': {
+ // Worker 0 has wall time but no channel activity yet
+ input0: {
+ type: 'channel',
+ rows: [0],
+ },
+ cpu: {
+ type: 'cpus',
+ main: {
+ type: 'cpu',
+ cpu: 500000,
+ wall: 1000000,
+ },
+ },
+ },
+ '1': {
+ // Worker 1 is truly inactive - no wall time, no channel activity
+ input0: {
+ type: 'channel',
+ rows: [0],
+ },
+ },
+ },
+ },
+ );
+
+ const inactiveCount =
customStages.getInactiveWorkerCount(customStages.stages[0]);
+ // Worker 0 has wall time, so only worker 1 is inactive
+ expect(inactiveCount).toBe(1);
+ });
});
describe('#getByPartitionCountersForStage', () => {
diff --git a/web-console/src/druid-models/stages/stages.ts
b/web-console/src/druid-models/stages/stages.ts
index 6831891a8b0..46c8387b362 100644
--- a/web-console/src/druid-models/stages/stages.ts
+++ b/web-console/src/druid-models/stages/stages.ts
@@ -644,18 +644,30 @@ export class Stages {
const channelCounters = this.getChannelCounterNamesForStage(stage);
- // Calculate and return the number of workers that have zero count across
all inputChannelCounters
+ // Calculate and return the number of workers that have zero interesting
counters
return sum(
- Object.values(forStageCounters).map(stageCounters =>
- Number(
+ Object.values(forStageCounters).map(stageCounters => {
+ // Check if the worker has any wall time recorded
+ const { cpu } = stageCounters;
+ if (cpu) {
+ const totalWall = sum(CPUS_COUNTER_FIELDS, field => cpu[field]?.wall
|| 0);
+ if (totalWall > 0) return 0;
+ }
+
+ // Check if the worker has any channel activity
+ return Number(
channelCounters.every(channel => {
const c = stageCounters[channel];
if (!c) return true;
- const totalRows = sum(c.rows || []);
- return totalRows === 0;
+ return (
+ sum(c.rows || []) === 0 &&
+ sum(c.files || []) === 0 &&
+ sum(c.bytes || []) === 0 &&
+ sum(c.frames || []) === 0
+ );
}),
- ),
- ),
+ );
+ }),
);
}
diff --git
a/web-console/src/views/workbench-view/execution-stages-pane/execution-stages-pane.tsx
b/web-console/src/views/workbench-view/execution-stages-pane/execution-stages-pane.tsx
index 74bff4380da..197b0aba8a2 100644
---
a/web-console/src/views/workbench-view/execution-stages-pane/execution-stages-pane.tsx
+++
b/web-console/src/views/workbench-view/execution-stages-pane/execution-stages-pane.tsx
@@ -985,7 +985,7 @@ ${title} uncompressed size: ${formatBytesCompact(
<div>{formatInteger(value)}</div>
<div
className="detail-line"
- data-tooltip="Workers are counted as inactive until they
report starting to read rows from their input."
+ data-tooltip="Workers are counted as active once they
report any activity."
>{`${formatInteger(inactiveWorkers)} inactive`}</div>
</div>
);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]