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

fix: use both BSC and Whiteboard for disks #1564

Merged
merged 2 commits into from
Nov 5, 2024

Conversation

artemmufazalov
Copy link
Member

@artemmufazalov artemmufazalov commented Oct 31, 2024

Closes #1457, closes #1428, closes #1429

UI should work as before, PR covers cases of DC shutdown

Stand: https://nda.ya.ru/t/dvb-Acis79L6xg

CI Results

Test Status: ❌ FAILED

πŸ“Š Full Report

Total Passed Failed Flaky Skipped
134 129 2 3 0

Bundle Size: πŸ”Ί

Current: 79.21 MB | Main: 79.20 MB
Diff: +0.01 MB (0.01%)

⚠️ Bundle size increased. Please review.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • πŸ“Š indicates links to detailed reports.
  • πŸ”Ί indicates increase, πŸ”½ decrease, and βœ… no change in bundle size.

@artemmufazalov artemmufazalov force-pushed the 1457-bsc-whiteboard-disks branch 2 times, most recently from d867fc7 to 6012e33 Compare October 31, 2024 14:55
Comment on lines -12 to -14
if (!isFullVDiskData(vDisk)) {
return NOT_AVAILABLE_SEVERITY;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't needed, in this case function will return NOT_AVAILABLE_SEVERITY because disk lacks VDiskState

@artemmufazalov artemmufazalov force-pushed the 1457-bsc-whiteboard-disks branch from 6012e33 to 4f08ff4 Compare November 1, 2024 09:28
label: 'Available',
value: `${bytesToGB(AvailableSize)} of ${bytesToGB(TotalSize)}`,
});
if (!isNaN(Number(TotalSize))) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isNumeric ?

@@ -29,14 +29,13 @@ export const selectNodeStructure = createSelector(
const groups = pool.Groups;
groups?.forEach((group) => {
const vDisks = group.VDisks?.filter((el) => el.NodeId === nodeId).map(
prepareVDiskData,
prepareWhiteboardVDiskData,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we use only whiteboard data here (without bsc) ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's data received from viewer/storage endpoint, it has only whiteboard data (TVDiskStateInfo)

@@ -192,13 +196,13 @@ const prepareStorageNodeData = (node: TNodeInfo): PreparedStorageNode => {

const pDisks = node.PDisks?.map((pDisk) => {
return {
...preparePDiskData(pDisk),
...prepareWhiteboardPDiskData(pDisk),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we use only whiteboard data and don't use bsc data here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In prepareStorageNodeData we prepare data that is received from viewer/nodes, it has only whiteboard data (TPDiskStateInfo )

: undefined;

const PDiskId = vdiskState.PDiskId ?? PDisk?.PDiskId;
const actualPDiskId = PDiskId ?? PDisk?.PDiskId;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect that preparedPDisk contains actial Id

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There might be no PDisk inside VDisk in some cases. For example, for viewer/nodes endpoint VDisks and PDisks are located in separate fields

const Donors = vdiskState.Donors?.map((donor) => {
return prepareVDiskData({...donor, DonorMode: true});
const preparedDonors = Donors?.map((donor) => {
return prepareWhiteboardVDiskData({...donor, DonorMode: true});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we use only whiteboard data here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prepareWhiteboardVDiskData is used to prepare TVDiskStateInfo, donors inside TVDiskStateInfo have TVDiskStateInfo type, so the same function is used.

The same is for storage/groups response, vdisks there have type TStorageVDisk, donors have type TStorageVDisk as well, the same prepareGroupsVDisk function is used for both vdisk and its donors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants