Skip to content

fix(VDisk): do not show vdisk as not replicated if no data #1921

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

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/components/VDiskPopup/VDiskPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const prepareVDiskData = (data: PreparedVDisk, withDeveloperUILink?: boolean) =>
vdiskData.push({label: 'FrontQueues', value: FrontQueues});
}

if (!Replicated) {
if (Replicated === false) {
vdiskData.push({label: 'Replicated', value: 'NO'});
}

Expand Down
6 changes: 5 additions & 1 deletion src/store/reducers/storage/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ const prepareStorageGroupData = (
AvailableSize: PDiskAvailableSize,
} = prepareWhiteboardPDiskData(PDisk);

if (!Replicated || PDiskState !== TPDiskState.Normal || VDiskState !== EVDiskState.OK) {
if (
Replicated === false ||
PDiskState !== TPDiskState.Normal ||
VDiskState !== EVDiskState.OK
) {
missing += 1;
}

Expand Down
9 changes: 9 additions & 0 deletions src/utils/disks/__test__/calculateVDiskSeverity.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ describe('VDisk state', () => {
expect(severity2).not.toEqual(DISK_COLOR_STATE_TO_NUMERIC_SEVERITY.Blue);
});

it('Should not display VDisk as replicating if Replicated is undefined', () => {
const severity = calculateVDiskSeverity({
VDiskState: EVDiskState.OK, // severity 1, green
Replicated: undefined,
});

expect(severity).not.toEqual(DISK_COLOR_STATE_TO_NUMERIC_SEVERITY.Blue);
});

it('Should display replicating VDisks in a not-OK state with a regular color', () => {
const severity1 = calculateVDiskSeverity({
VDiskState: EVDiskState.Initial, // severity 3, yellow
Expand Down
2 changes: 1 addition & 1 deletion src/utils/disks/calculateVDiskSeverity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function calculateVDiskSeverity<
let severity = Math.max(DiskSpaceSeverity, VDiskSpaceSeverity, FrontQueuesSeverity);

// donors are always in the not replicated state since they are leftovers
if (!Replicated && severity === DISK_COLOR_STATE_TO_NUMERIC_SEVERITY.Green) {
if (Replicated === false && severity === DISK_COLOR_STATE_TO_NUMERIC_SEVERITY.Green) {
severity = DISK_COLOR_STATE_TO_NUMERIC_SEVERITY.Blue;
}

Expand Down
Loading