Skip to content

Commit 986e6ab

Browse files
authored
fix: dead tablets on node page (#2263)
1 parent 816a712 commit 986e6ab

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

src/containers/Node/Node.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ function NodePageContent({
234234
);
235235
}
236236
case 'tablets': {
237-
return <Tablets nodeId={nodeId} database={tenantName} />;
237+
return <Tablets nodeId={nodeId} database={tenantName} onlyActive />;
238238
}
239239

240240
case 'structure': {

src/containers/Tablets/Tablets.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,23 @@ interface TabletsProps {
1111
path?: string;
1212
database?: string;
1313
nodeId?: string | number;
14+
/**
15+
* Show/hide dead tablets: shown in pages needing complete statistics,
16+
* hidden in pages that already display multiple tablet generations to reduce visual noise.
17+
*/
18+
onlyActive?: boolean;
1419
}
1520

16-
export function Tablets({nodeId, path, database}: TabletsProps) {
21+
export function Tablets({nodeId, path, database, onlyActive}: TabletsProps) {
1722
const [autoRefreshInterval] = useAutoRefreshInterval();
1823

1924
let params: TabletsApiRequestParams = {};
25+
const filter = onlyActive ? `(State!=Dead)` : undefined;
26+
2027
if (valueIsDefined(nodeId)) {
21-
params = {nodeId, database};
28+
params = {nodeId, database, filter};
2229
} else if (path) {
23-
params = {path, database};
30+
params = {path, database, filter};
2431
}
2532
const {isLoading, error} = tabletsApi.useGetTabletsInfoQuery(
2633
Object.keys(params).length === 0 ? skipToken : params,

src/services/api/viewer.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import type {TTenantInfo, TTenants} from '../../types/api/tenant';
3131
import type {DescribeTopicResult, TopicDataRequest, TopicDataResponse} from '../../types/api/topic';
3232
import type {TEvVDiskStateResponse} from '../../types/api/vdisk';
3333
import type {TUserToken} from '../../types/api/whoami';
34+
import type {TabletsApiRequestParams} from '../../types/store/tablets';
3435
import {BINARY_DATA_IN_PLAIN_TEXT_DISPLAY} from '../../utils/constants';
3536
import type {Nullable} from '../../utils/typecheckers';
3637
import {settingsManager} from '../settings';
@@ -128,7 +129,7 @@ export class ViewerAPI extends BaseYdbAPI {
128129
}
129130

130131
getTabletsInfo(
131-
{nodeId, path, database}: {nodeId?: string | number; path?: string; database?: string},
132+
{nodeId, path, database, filter}: TabletsApiRequestParams,
132133
{concurrentId, signal}: AxiosOptions = {},
133134
) {
134135
return this.get<TEvTabletStateResponse>(
@@ -138,6 +139,7 @@ export class ViewerAPI extends BaseYdbAPI {
138139
node_id: nodeId,
139140
path,
140141
enums: true,
142+
filter,
141143
},
142144
{concurrentId, requestConfig: {signal}},
143145
);

src/types/store/tablets.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ export interface TabletsApiRequestParams {
22
nodeId?: string | number;
33
path?: string;
44
database?: string;
5+
filter?: string;
56
}

0 commit comments

Comments
 (0)