Skip to content

Commit a453d0a

Browse files
fix(Overview): disable column tables stats request (#1024)
1 parent 7f283a0 commit a453d0a

File tree

3 files changed

+39
-31
lines changed

3 files changed

+39
-31
lines changed

src/containers/Tenant/Diagnostics/Overview/Overview.tsx

+19-15
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {shallowEqual} from 'react-redux';
66
import {ResponseError} from '../../../../components/Errors/ResponseError';
77
import {TableIndexInfo} from '../../../../components/InfoViewer/schemaInfo';
88
import {Loader} from '../../../../components/Loader';
9-
import {olapApi} from '../../../../store/reducers/olapStats';
109
import {overviewApi} from '../../../../store/reducers/overview/overview';
1110
import {
1211
selectSchemaMergedChildrenPaths,
@@ -17,11 +16,7 @@ import {useAutoRefreshInterval, useTypedSelector} from '../../../../utils/hooks'
1716
import {ExternalDataSourceInfo} from '../../Info/ExternalDataSource/ExternalDataSource';
1817
import {ExternalTableInfo} from '../../Info/ExternalTable/ExternalTable';
1918
import {ViewInfo} from '../../Info/View/View';
20-
import {
21-
isColumnEntityType,
22-
isEntityWithMergedImplementation,
23-
isTableType,
24-
} from '../../utils/schema';
19+
import {isEntityWithMergedImplementation} from '../../utils/schema';
2520

2621
import {AsyncReplicationInfo} from './AsyncReplicationInfo';
2722
import {ChangefeedInfo} from './ChangefeedInfo';
@@ -36,13 +31,17 @@ interface OverviewProps {
3631
function Overview({type, path}: OverviewProps) {
3732
const [autoRefreshInterval] = useAutoRefreshInterval();
3833

39-
const olapParams = isTableType(type) && isColumnEntityType(type) ? {path} : skipToken;
40-
const {currentData: olapData, isFetching: olapIsFetching} = olapApi.useGetOlapStatsQuery(
41-
olapParams,
42-
{pollingInterval: autoRefreshInterval},
43-
);
44-
const olapStatsLoading = olapIsFetching && olapData === undefined;
45-
const {result: olapStats} = olapData || {result: undefined};
34+
// FIXME: The request is too heavy, stats table may have millions of items
35+
// Disabled until fixed
36+
// https://github.com/ydb-platform/ydb-embedded-ui/issues/907
37+
// https://github.com/ydb-platform/ydb-embedded-ui/issues/908
38+
// const olapParams = isTableType(type) && isColumnEntityType(type) ? {path} : skipToken;
39+
// const {currentData: olapData, isFetching: olapIsFetching} = olapApi.useGetOlapStatsQuery(
40+
// olapParams,
41+
// {pollingInterval: autoRefreshInterval},
42+
// );
43+
// const olapStatsLoading = olapIsFetching && olapData === undefined;
44+
// const {result: olapStats} = olapData || {result: undefined};
4645

4746
const isEntityWithMergedImpl = isEntityWithMergedImplementation(type);
4847

@@ -71,7 +70,8 @@ function Overview({type, path}: OverviewProps) {
7170

7271
const {error: schemaError} = useGetSchemaQuery({path});
7372

74-
const entityLoading = overviewLoading || olapStatsLoading;
73+
// overviewLoading || olapStatsLoading
74+
const entityLoading = overviewLoading;
7575
const entityNotReady = isEntityWithMergedImpl && !mergedChildrenPaths;
7676

7777
const renderContent = () => {
@@ -99,7 +99,11 @@ function Overview({type, path}: OverviewProps) {
9999

100100
return (
101101
(type && pathTypeToComponent[type]?.()) || (
102-
<TableInfo data={data} type={type} olapStats={olapStats} />
102+
<TableInfo
103+
data={data}
104+
type={type}
105+
// olapStats={olapStats}
106+
/>
103107
)
104108
);
105109
};

src/containers/Tenant/Diagnostics/Overview/TableInfo/TableInfo.tsx

+15-13
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export const TableInfo = ({data, type, olapStats}: TableInfoProps) => {
2323
const title = <EntityTitle data={data?.PathDescription} />;
2424

2525
const {
26-
generalInfo = [],
27-
tableStatsInfo = [],
26+
generalInfo,
27+
tableStatsInfo,
2828
tabletMetricsInfo = [],
2929
partitionConfigInfo = [],
3030
} = React.useMemo(() => prepareTableInfo(data, type, olapStats), [data, type, olapStats]);
@@ -38,17 +38,19 @@ export const TableInfo = ({data, type, olapStats}: TableInfoProps) => {
3838
renderEmptyState={() => <div className={b('title')}>{title}</div>}
3939
/>
4040
<div className={b('row')}>
41-
<div className={b('col')}>
42-
{tableStatsInfo.map((info, index) => (
43-
<InfoViewer
44-
key={index}
45-
info={info}
46-
title={index === 0 ? i18n('tableStats') : undefined}
47-
className={b('info-block')}
48-
renderEmptyState={() => null}
49-
/>
50-
))}
51-
</div>
41+
{tableStatsInfo ? (
42+
<div className={b('col')}>
43+
{tableStatsInfo.map((info, index) => (
44+
<InfoViewer
45+
key={index}
46+
info={info}
47+
title={index === 0 ? i18n('tableStats') : undefined}
48+
className={b('info-block')}
49+
renderEmptyState={() => null}
50+
/>
51+
))}
52+
</div>
53+
) : null}
5254
{tabletMetricsInfo.length > 0 || partitionConfigInfo.length > 0 ? (
5355
<div className={b('col')}>
5456
<InfoViewer

src/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const isInStoreColumnTable = (table: TColumnTableDescription) => {
2424
return table.SchemaPresetName && table.SchemaPresetId !== undefined;
2525
};
2626

27-
const prepareOlapStats = (olapStats?: KeyValueRow[]) => {
27+
const prepareOlapStats = (olapStats: KeyValueRow[]) => {
2828
const Bytes = olapStats?.reduce((acc, el) => {
2929
const value = isNumeric(el.Bytes) ? Number(el.Bytes) : 0;
3030
return acc + value;
@@ -199,12 +199,14 @@ export const prepareTableInfo = (
199199
}
200200
}
201201

202-
let tableStatsInfo: InfoViewerItem[][];
202+
let tableStatsInfo: InfoViewerItem[][] | undefined;
203203

204204
// There is no TableStats and TabletMetrics for ColumnTables inside ColumnStore
205205
// Therefore we parse olapStats
206206
if (type === EPathType.EPathTypeColumnTable && isInStoreColumnTable(ColumnTableDescription)) {
207-
tableStatsInfo = [prepareOlapStats(olapStats)];
207+
if (olapStats) {
208+
tableStatsInfo = [prepareOlapStats(olapStats)];
209+
}
208210
} else {
209211
tableStatsInfo = [
210212
formatObject(formatTableStatsItem, {

0 commit comments

Comments
 (0)