frostfs-cli: Add EC support to object nodes #1120

Merged
fyrchik merged 1 commit from dstepanov-yadro/frostfs-node:feat/ec_object_nodes into master 2024-09-04 19:51:08 +00:00
  • Added support for EC objects for frostfs-cli object nodes command
  • Fixed EC object put: now objects use object ID for placement nodes computation, also now no extra chunk copies save
  • Now frostfs-cli object nodes command doesn't use linking object for complex objects: linking objects store on all container nodes and are not required, so using linking object is useless
  • Edited frostfs-cli object nodes command output to print detailed information about object nodes
  • Added --json flag to output result to JSON

Output example:

  • complex REP object:
Object EC6Uvf7qgrusTeMVy7mHgf47x3mUvAMgHosfgrVJkPnv stores payload in 2 data objects:
- Fi8X18b8uSiZwC1q3y3wAqjWGw3qgNq1zXiiLfbMREus
        Required nodes:
                - 02ac920cd7df0b61b289072e6b946e2da4e1a31b9ab1c621bb475e30fa4ab102c3
                - 03ff65b6ae79134a4dce9d0d39d3851e9bab4ee97abf86e81e1c5bbc50cd2826ae
        Actual nodes:
                - 02ac920cd7df0b61b289072e6b946e2da4e1a31b9ab1c621bb475e30fa4ab102c3
                - 03ff65b6ae79134a4dce9d0d39d3851e9bab4ee97abf86e81e1c5bbc50cd2826ae
- GYjh8FtLH2UuFLTxTowgHPN4CNZTtcQrUVTpR6aeQMp
        Required nodes:
                - 022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131
                - 02ac920cd7df0b61b289072e6b946e2da4e1a31b9ab1c621bb475e30fa4ab102c3
        Actual nodes:
                - 02ac920cd7df0b61b289072e6b946e2da4e1a31b9ab1c621bb475e30fa4ab102c3
                - 022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131
{
    "object_id": "EC6Uvf7qgrusTeMVy7mHgf47x3mUvAMgHosfgrVJkPnv",
    "data_objects": [
        {
            "object_id": "Fi8X18b8uSiZwC1q3y3wAqjWGw3qgNq1zXiiLfbMREus",
            "required_nodes": [
                "02ac920cd7df0b61b289072e6b946e2da4e1a31b9ab1c621bb475e30fa4ab102c3",
                "03ff65b6ae79134a4dce9d0d39d3851e9bab4ee97abf86e81e1c5bbc50cd2826ae"
            ],
            "confirmed_nodes": [
                "02ac920cd7df0b61b289072e6b946e2da4e1a31b9ab1c621bb475e30fa4ab102c3",
                "03ff65b6ae79134a4dce9d0d39d3851e9bab4ee97abf86e81e1c5bbc50cd2826ae"
            ]
        },
        {
            "object_id": "GYjh8FtLH2UuFLTxTowgHPN4CNZTtcQrUVTpR6aeQMp",
            "required_nodes": [
                "022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131",
                "02ac920cd7df0b61b289072e6b946e2da4e1a31b9ab1c621bb475e30fa4ab102c3"
            ],
            "confirmed_nodes": [
                "02ac920cd7df0b61b289072e6b946e2da4e1a31b9ab1c621bb475e30fa4ab102c3",
                "022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131"
            ]
        }
    ]
}
  • complex EC object:
Object SvJLHMzMPz3DzWTEXQ1CrkkmC2LvbG3XRzHwHRp1uhe stores payload in 4 data objects:
- AEHyHcE5QGqpBmdFt2E4KxWWZ9xQVHk9kfZiWuxX2nzV
        EC index: 0
        EC parent: 5sqcGTegyHap6nzEyrxrL5GP3GFKGxEUsdjR1BSSygn2
        Required nodes:
                - 038c862959e56b43e20f79187c4fe9e0bc7c8c66c1603e6cf0ec7f87ab6b08dc35
        Actual nodes:
                - 038c862959e56b43e20f79187c4fe9e0bc7c8c66c1603e6cf0ec7f87ab6b08dc35
- 9UnwdAxhEXzyAWsAjMm4DY5b6MsJYLdv6unFvCaPn7v2
        EC index: 1
        EC parent: 5sqcGTegyHap6nzEyrxrL5GP3GFKGxEUsdjR1BSSygn2
        Required nodes:
                - 022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131
        Actual nodes:
                - 022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131
- HM7qhEtWRvWgaAYpkQ3e6mz5eNAPT4NzhsMkfFaeEoR4
        EC index: 1
        EC parent: DkXfZDZ4GbZx3mUd37Zjua9GQFm8tFfzmy586WY2jict
        Required nodes:
                - 038c862959e56b43e20f79187c4fe9e0bc7c8c66c1603e6cf0ec7f87ab6b08dc35
        Actual nodes:
                - 038c862959e56b43e20f79187c4fe9e0bc7c8c66c1603e6cf0ec7f87ab6b08dc35
- 7NC1pvikxWqL7b62DHcBdXdneeJEALmhMDQT1MsiWPRQ
        EC index: 0
        EC parent: DkXfZDZ4GbZx3mUd37Zjua9GQFm8tFfzmy586WY2jict
        Required nodes:
                - 03ff65b6ae79134a4dce9d0d39d3851e9bab4ee97abf86e81e1c5bbc50cd2826ae
        Actual nodes:
                - 03ff65b6ae79134a4dce9d0d39d3851e9bab4ee97abf86e81e1c5bbc50cd2826ae
{
    "object_id": "SvJLHMzMPz3DzWTEXQ1CrkkmC2LvbG3XRzHwHRp1uhe",
    "data_objects": [
        {
            "object_id": "AEHyHcE5QGqpBmdFt2E4KxWWZ9xQVHk9kfZiWuxX2nzV",
            "required_nodes": [
                "038c862959e56b43e20f79187c4fe9e0bc7c8c66c1603e6cf0ec7f87ab6b08dc35"
            ],
            "confirmed_nodes": [
                "038c862959e56b43e20f79187c4fe9e0bc7c8c66c1603e6cf0ec7f87ab6b08dc35"
            ],
            "ec_parent_object_id": "5sqcGTegyHap6nzEyrxrL5GP3GFKGxEUsdjR1BSSygn2",
            "ec_index": 0
        },
        {
            "object_id": "9UnwdAxhEXzyAWsAjMm4DY5b6MsJYLdv6unFvCaPn7v2",
            "required_nodes": [
                "022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131"
            ],
            "confirmed_nodes": [
                "022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131"
            ],
            "ec_parent_object_id": "5sqcGTegyHap6nzEyrxrL5GP3GFKGxEUsdjR1BSSygn2",
            "ec_index": 1
        },
        {
            "object_id": "HM7qhEtWRvWgaAYpkQ3e6mz5eNAPT4NzhsMkfFaeEoR4",
            "required_nodes": [
                "038c862959e56b43e20f79187c4fe9e0bc7c8c66c1603e6cf0ec7f87ab6b08dc35"
            ],
            "confirmed_nodes": [
                "038c862959e56b43e20f79187c4fe9e0bc7c8c66c1603e6cf0ec7f87ab6b08dc35"
            ],
            "ec_parent_object_id": "DkXfZDZ4GbZx3mUd37Zjua9GQFm8tFfzmy586WY2jict",
            "ec_index": 1
        },
        {
            "object_id": "7NC1pvikxWqL7b62DHcBdXdneeJEALmhMDQT1MsiWPRQ",
            "required_nodes": [
                "03ff65b6ae79134a4dce9d0d39d3851e9bab4ee97abf86e81e1c5bbc50cd2826ae"
            ],
            "confirmed_nodes": [
                "03ff65b6ae79134a4dce9d0d39d3851e9bab4ee97abf86e81e1c5bbc50cd2826ae"
            ],
            "ec_parent_object_id": "DkXfZDZ4GbZx3mUd37Zjua9GQFm8tFfzmy586WY2jict",
            "ec_index": 0
        }
    ]
}
- Added support for EC objects for `frostfs-cli object nodes` command - Fixed EC object put: now objects use object ID for placement nodes computation, also now no extra chunk copies save - Now `frostfs-cli object nodes` command doesn't use linking object for complex objects: linking objects store on all container nodes and are not required, so using linking object is useless - Edited `frostfs-cli object nodes` command output to print detailed information about object nodes - Added `--json` flag to output result to JSON Output example: - complex REP object: ``` Object EC6Uvf7qgrusTeMVy7mHgf47x3mUvAMgHosfgrVJkPnv stores payload in 2 data objects: - Fi8X18b8uSiZwC1q3y3wAqjWGw3qgNq1zXiiLfbMREus Required nodes: - 02ac920cd7df0b61b289072e6b946e2da4e1a31b9ab1c621bb475e30fa4ab102c3 - 03ff65b6ae79134a4dce9d0d39d3851e9bab4ee97abf86e81e1c5bbc50cd2826ae Actual nodes: - 02ac920cd7df0b61b289072e6b946e2da4e1a31b9ab1c621bb475e30fa4ab102c3 - 03ff65b6ae79134a4dce9d0d39d3851e9bab4ee97abf86e81e1c5bbc50cd2826ae - GYjh8FtLH2UuFLTxTowgHPN4CNZTtcQrUVTpR6aeQMp Required nodes: - 022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131 - 02ac920cd7df0b61b289072e6b946e2da4e1a31b9ab1c621bb475e30fa4ab102c3 Actual nodes: - 02ac920cd7df0b61b289072e6b946e2da4e1a31b9ab1c621bb475e30fa4ab102c3 - 022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131 ``` ```json { "object_id": "EC6Uvf7qgrusTeMVy7mHgf47x3mUvAMgHosfgrVJkPnv", "data_objects": [ { "object_id": "Fi8X18b8uSiZwC1q3y3wAqjWGw3qgNq1zXiiLfbMREus", "required_nodes": [ "02ac920cd7df0b61b289072e6b946e2da4e1a31b9ab1c621bb475e30fa4ab102c3", "03ff65b6ae79134a4dce9d0d39d3851e9bab4ee97abf86e81e1c5bbc50cd2826ae" ], "confirmed_nodes": [ "02ac920cd7df0b61b289072e6b946e2da4e1a31b9ab1c621bb475e30fa4ab102c3", "03ff65b6ae79134a4dce9d0d39d3851e9bab4ee97abf86e81e1c5bbc50cd2826ae" ] }, { "object_id": "GYjh8FtLH2UuFLTxTowgHPN4CNZTtcQrUVTpR6aeQMp", "required_nodes": [ "022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131", "02ac920cd7df0b61b289072e6b946e2da4e1a31b9ab1c621bb475e30fa4ab102c3" ], "confirmed_nodes": [ "02ac920cd7df0b61b289072e6b946e2da4e1a31b9ab1c621bb475e30fa4ab102c3", "022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131" ] } ] } ``` - complex EC object: ``` Object SvJLHMzMPz3DzWTEXQ1CrkkmC2LvbG3XRzHwHRp1uhe stores payload in 4 data objects: - AEHyHcE5QGqpBmdFt2E4KxWWZ9xQVHk9kfZiWuxX2nzV EC index: 0 EC parent: 5sqcGTegyHap6nzEyrxrL5GP3GFKGxEUsdjR1BSSygn2 Required nodes: - 038c862959e56b43e20f79187c4fe9e0bc7c8c66c1603e6cf0ec7f87ab6b08dc35 Actual nodes: - 038c862959e56b43e20f79187c4fe9e0bc7c8c66c1603e6cf0ec7f87ab6b08dc35 - 9UnwdAxhEXzyAWsAjMm4DY5b6MsJYLdv6unFvCaPn7v2 EC index: 1 EC parent: 5sqcGTegyHap6nzEyrxrL5GP3GFKGxEUsdjR1BSSygn2 Required nodes: - 022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131 Actual nodes: - 022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131 - HM7qhEtWRvWgaAYpkQ3e6mz5eNAPT4NzhsMkfFaeEoR4 EC index: 1 EC parent: DkXfZDZ4GbZx3mUd37Zjua9GQFm8tFfzmy586WY2jict Required nodes: - 038c862959e56b43e20f79187c4fe9e0bc7c8c66c1603e6cf0ec7f87ab6b08dc35 Actual nodes: - 038c862959e56b43e20f79187c4fe9e0bc7c8c66c1603e6cf0ec7f87ab6b08dc35 - 7NC1pvikxWqL7b62DHcBdXdneeJEALmhMDQT1MsiWPRQ EC index: 0 EC parent: DkXfZDZ4GbZx3mUd37Zjua9GQFm8tFfzmy586WY2jict Required nodes: - 03ff65b6ae79134a4dce9d0d39d3851e9bab4ee97abf86e81e1c5bbc50cd2826ae Actual nodes: - 03ff65b6ae79134a4dce9d0d39d3851e9bab4ee97abf86e81e1c5bbc50cd2826ae ``` ```json { "object_id": "SvJLHMzMPz3DzWTEXQ1CrkkmC2LvbG3XRzHwHRp1uhe", "data_objects": [ { "object_id": "AEHyHcE5QGqpBmdFt2E4KxWWZ9xQVHk9kfZiWuxX2nzV", "required_nodes": [ "038c862959e56b43e20f79187c4fe9e0bc7c8c66c1603e6cf0ec7f87ab6b08dc35" ], "confirmed_nodes": [ "038c862959e56b43e20f79187c4fe9e0bc7c8c66c1603e6cf0ec7f87ab6b08dc35" ], "ec_parent_object_id": "5sqcGTegyHap6nzEyrxrL5GP3GFKGxEUsdjR1BSSygn2", "ec_index": 0 }, { "object_id": "9UnwdAxhEXzyAWsAjMm4DY5b6MsJYLdv6unFvCaPn7v2", "required_nodes": [ "022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131" ], "confirmed_nodes": [ "022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131" ], "ec_parent_object_id": "5sqcGTegyHap6nzEyrxrL5GP3GFKGxEUsdjR1BSSygn2", "ec_index": 1 }, { "object_id": "HM7qhEtWRvWgaAYpkQ3e6mz5eNAPT4NzhsMkfFaeEoR4", "required_nodes": [ "038c862959e56b43e20f79187c4fe9e0bc7c8c66c1603e6cf0ec7f87ab6b08dc35" ], "confirmed_nodes": [ "038c862959e56b43e20f79187c4fe9e0bc7c8c66c1603e6cf0ec7f87ab6b08dc35" ], "ec_parent_object_id": "DkXfZDZ4GbZx3mUd37Zjua9GQFm8tFfzmy586WY2jict", "ec_index": 1 }, { "object_id": "7NC1pvikxWqL7b62DHcBdXdneeJEALmhMDQT1MsiWPRQ", "required_nodes": [ "03ff65b6ae79134a4dce9d0d39d3851e9bab4ee97abf86e81e1c5bbc50cd2826ae" ], "confirmed_nodes": [ "03ff65b6ae79134a4dce9d0d39d3851e9bab4ee97abf86e81e1c5bbc50cd2826ae" ], "ec_parent_object_id": "DkXfZDZ4GbZx3mUd37Zjua9GQFm8tFfzmy586WY2jict", "ec_index": 0 } ] } ```
dstepanov-yadro force-pushed feat/ec_object_nodes from b3a9364679 to 0e81828105 2024-05-06 13:11:48 +00:00 Compare
dstepanov-yadro force-pushed feat/ec_object_nodes from 0e81828105 to 5742f8e59e 2024-05-06 13:15:31 +00:00 Compare
Owner

Could you also attach output for EC objects to the description?

Could you also attach output for EC objects to the description?
Author
Member

Could you also attach output for EC objects to the description?

Done

> Could you also attach output for EC objects to the description? Done
dstepanov-yadro requested review from storage-core-committers 2024-05-06 15:02:02 +00:00
dstepanov-yadro requested review from storage-core-developers 2024-05-06 15:02:03 +00:00
Owner

So we must use --explain for this command to be useful on EC containers?

So we must use `--explain` for this command to be useful on EC containers?
Author
Member

So we must use --explain for this command to be useful on EC containers?

Yes. It is also useful for complex objects and complex EC objects.
I think QA testcases could have some parsers of output, so I decided to print this detailed info only with flag for backward compatibility.

> So we must use `--explain` for this command to be useful on EC containers? Yes. It is also useful for complex objects and complex EC objects. I think QA testcases could have some parsers of output, so I decided to print this detailed info only with flag for backward compatibility.
Owner

I think QA testcases could have some parsers of output.

That is ok, because for EC table output is somewhat useless.

I was thinking about some table representation, like this:

Chunk | Node expected to store | Actual node | 
1     | 038c                   | 038c        |
2     | ...                    | ...         |

or this:

Node | Expected chunks | Actual chunks |
aaaa | 0               | 0             |
bbbb | 1               | 1,2           |
ccc  | 2               |               |

Don't have anything against the current implementation if everyone else is happy, though.

>I think QA testcases could have some parsers of output. That is ok, because for EC table output is somewhat useless. I was thinking about some table representation, like this: ``` Chunk | Node expected to store | Actual node | 1 | 038c | 038c | 2 | ... | ... | ``` or this: ``` Node | Expected chunks | Actual chunks | aaaa | 0 | 0 | bbbb | 1 | 1,2 | ccc | 2 | | ``` Don't have anything against the current implementation if everyone else is happy, though.
Author
Member

I think QA testcases could have some parsers of output.

That is ok, because for EC table output is somewhat useless.

I was thinking about some table representation, like this:

Chunk | Node expected to store | Actual node | 
1     | 038c                   | 038c        |
2     | ...                    | ...         |

or this:

Node | Expected chunks | Actual chunks |
aaaa | 0               | 0             |
bbbb | 1               | 1,2           |
ccc  | 2               |               |

What will it look like for compex EC objects? Complex EC objects consists of parts, but each part is EC has its own chunks.

> >I think QA testcases could have some parsers of output. > > That is ok, because for EC table output is somewhat useless. > > I was thinking about some table representation, like this: > ``` > Chunk | Node expected to store | Actual node | > 1 | 038c | 038c | > 2 | ... | ... | > ``` > or this: > ``` > Node | Expected chunks | Actual chunks | > aaaa | 0 | 0 | > bbbb | 1 | 1,2 | > ccc | 2 | | > ``` > What will it look like for compex EC objects? Complex EC objects consists of parts, but each part is EC has its own chunks.
Owner

What will it look like for compex EC objects? Complex EC objects consists of parts, but each part is EC has its own chunks.

It could look like this (part:chunk_index):

Node | Expected chunks | Actual chunks |
aaaa | 0:0, 1:2        | 0:0, 1:2      |
bbbb | 0:1, 0:2, 1:0   | 0:1, 0:2, 1:0 |

Anyway, complex objects are not supported by REP policies too (and your --explain flag handles it well)

>What will it look like for compex EC objects? Complex EC objects consists of parts, but each part is EC has its own chunks. It could look like this (`part:chunk_index`): ``` Node | Expected chunks | Actual chunks | aaaa | 0:0, 1:2 | 0:0, 1:2 | bbbb | 0:1, 0:2, 1:0 | 0:1, 0:2, 1:0 | ``` Anyway, complex objects are not supported by REP policies too (and your --explain flag handles it well)
Author
Member

What will it look like for compex EC objects? Complex EC objects consists of parts, but each part is EC has its own chunks.

It could look like this (part:chunk_index):

Node | Expected chunks | Actual chunks |
aaaa | 0:0, 1:2        | 0:0, 1:2      |
bbbb | 0:1, 0:2, 1:0   | 0:1, 0:2, 1:0 |

Anyway, complex objects are not supported by REP policies too (and your --explain flag handles it well)

I have nothing against leaving only the explain part in the output (and drop --explain flag), if QA does not mind.

> >What will it look like for compex EC objects? Complex EC objects consists of parts, but each part is EC has its own chunks. > > It could look like this (`part:chunk_index`): > ``` > Node | Expected chunks | Actual chunks | > aaaa | 0:0, 1:2 | 0:0, 1:2 | > bbbb | 0:1, 0:2, 1:0 | 0:1, 0:2, 1:0 | > ``` > Anyway, complex objects are not supported by REP policies too (and your --explain flag handles it well) I have nothing against leaving only the `explain` part in the output (and drop `--explain` flag), if QA does not mind.
aarifullin approved these changes 2024-05-07 09:04:28 +00:00
fyrchik approved these changes 2024-05-07 10:16:14 +00:00
fyrchik left a comment
Owner

Why is it Actual nodes in the text view and confirmed_nodes in JSON view?
It also could be nice to have some stable output (like sorting by part index, then by EC index).
Table view is more compact IMO, but this is not a frequently used command, and we can always support more output formats in the future.

Why is it `Actual nodes` in the text view and `confirmed_nodes` in JSON view? It also could be nice to have some stable output (like sorting by part index, then by EC index). Table view is more compact IMO, but this is not a frequently used command, and we can always support more output formats in the future.
dstepanov-yadro force-pushed feat/ec_object_nodes from a77d6ad69a to e59cac47cf 2024-05-07 10:49:25 +00:00 Compare
Author
Member

Why is it Actual nodes in the text view and confirmed_nodes in JSON view?
It also could be nice to have some stable output (like sorting by part index, then by EC index).
Table view is more compact IMO, but this is not a frequently used command, and we can always support more output formats in the future.

Agree, lazy developer detected (it's me). Fixed.

> Why is it `Actual nodes` in the text view and `confirmed_nodes` in JSON view? > It also could be nice to have some stable output (like sorting by part index, then by EC index). > Table view is more compact IMO, but this is not a frequently used command, and we can always support more output formats in the future. Agree, lazy developer detected (it's me). Fixed.
dstepanov-yadro force-pushed feat/ec_object_nodes from e59cac47cf to fb44bf51e1 2024-05-07 10:50:19 +00:00 Compare
dstepanov-yadro force-pushed feat/ec_object_nodes from fb44bf51e1 to c5194797ab 2024-05-08 08:21:58 +00:00 Compare
dstepanov-yadro force-pushed feat/ec_object_nodes from c5194797ab to 368218f0cc 2024-05-08 12:24:27 +00:00 Compare
fyrchik merged commit 368218f0cc into master 2024-05-08 13:09:43 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#1120
No description provided.