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

Grouping/Tagging support for 1:n PoST #5847

Open
tgarm opened this issue Apr 15, 2024 · 2 comments
Open

Grouping/Tagging support for 1:n PoST #5847

tgarm opened this issue Apr 15, 2024 · 2 comments
Assignees

Comments

@tgarm
Copy link

tgarm commented Apr 15, 2024

Description

The requirement: Sequence control of PoST service

A typical storage server may contain 8 to 12 HDD, each HDD contains several PoST data directories.
To be optimal, all PoST data can be stored sequentially.

When running PoST with this storage server, the optimal way is to request PoST data sequentially in every single disk, and in parallel for all disks.

Like the following code:

    disks := map[string][]string{
        "disk1": {"dir1", "dir2", "dir3"},
        "disk2": {"dir1", "dir2"},
        "disk3": {"dir1", "dir2", "dir3", "dir4"},
    }
   
    for disk, directories := range disks {
        go func(disk string, directories []string) {
            for _, directory := range directories {
                checkDirectory(directory) 
            }
        }(disk, directories)
    }

Currently, I didn't find any way to control the PoST service request sequence in a go-spacemesh node.
If a grouping feature can be added, it would be greatly useful for farmers to optimize/tune their disk reading performance.

How would it look like

Each service can be tagged with a group name or a tag name, this can be specified in the service CLI arguments.
In the node side, we can have sequential control parameters in config file, to specify if the node should request each group of PoST service in sequence or in parallel.

Anyway, the main feature is to control the PoST service request sequence.

@pigmej
Copy link
Member

pigmej commented Apr 15, 2024

Hey,

We do have some basic demo here: https://github.com/spacemeshos/multiple_post_services_demo that demo is using DAGU to achieve it BUT you could use any other DAG mechanism to define them. There are also other no code tools also like https://github.com/open-rust-initiative/dagrs

We deliberately did not put the orchestration into the go-spacemesh as it really depends on the exact use case.

In the demo that I linked above you can see pretty much the same scenario as you described. Please let me know if it's enough for you.

The key to understanding it is that you DO NOT need to run all post services at any given time. It is completely safe to run it only when needed.

@pigmej pigmej self-assigned this Apr 15, 2024
@tgarm
Copy link
Author

tgarm commented Apr 18, 2024

Thank you. I'll try it.

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

No branches or pull requests

2 participants