Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show leader nodes in Services Tab #10951

Merged
merged 1 commit into from
Mar 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions web-console/src/views/services-view/services-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ interface ServiceQueryResultRow {
service: string;
service_type: string;
tier: string;
is_leader: number;
curr_size: number;
host: string;
max_size: number;
Expand Down Expand Up @@ -164,7 +165,7 @@ export class ServicesView extends React.PureComponent<ServicesViewProps, Service
// peon => 1

static SERVICE_SQL = `SELECT
"server" AS "service", "server_type" AS "service_type", "tier", "host", "plaintext_port", "tls_port", "curr_size", "max_size",
"server" AS "service", "server_type" AS "service_type", "tier", "host", "plaintext_port", "tls_port", "curr_size", "max_size", "is_leader",
(
CASE "server_type"
WHEN 'coordinator' THEN 8
Expand Down Expand Up @@ -484,7 +485,7 @@ ORDER BY "rank" DESC, "service" DESC`;
},
{
Header: 'Detail',
show: capabilities.hasCoordinatorAccess() && hiddenColumns.exists('Detail'),
show: hiddenColumns.exists('Detail'),
id: 'queue',
width: 400,
filterable: false,
Expand All @@ -500,6 +501,8 @@ ORDER BY "rank" DESC, "service" DESC`;
details.push(`Blacklisted until: ${row.blacklistedUntil}`);
}
return details.join(' ');
} else if (oneOf(row.service_type, 'coordinator', 'overlord')) {
return (row.is_leader || 0) === 1 ? 'leader' : '';
} else {
return (row.segmentsToLoad || 0) + (row.segmentsToDrop || 0);
}
Expand All @@ -526,6 +529,10 @@ ORDER BY "rank" DESC, "service" DESC`;
case 'middle_manager':
return row.value;

case 'coordinator':
case 'overlord':
return row.value;

default:
return '';
}
Expand Down