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

Use a number separator for parsec shard##_endpoint to prevent double-digit confusion #312

Open
3 tasks done
rockett-m opened this issue Nov 26, 2024 · 1 comment
Open
3 tasks done
Assignees
Labels
difficulty/01-good-first-issue Very approachable for new contributors enhancement/documentation Improves documentation status/in-progress Has been assigned to a contributor and is under active development

Comments

@rockett-m
Copy link
Contributor

Affected Branch

trunk

Basic Diagnostics

  • I've pulled the latest changes on the affected branch and the issue is still present.

  • The issue is reproducible in docker

Description

For endpoints in parsec, the option parsing for the following machines {agent, ticket machine, and shard} goes like this:

src/parsec/util.cpp, line 63

for(size_t i = 0; i < count; i++) {
    auto ep_key = component_name + std::to_string(i) + "_endpoint";
}
  • Agents aren't replicated, so agent0_endpoint to agent{n-1}_endpoint works.

  • The ticket machine can be replicated but there is typically just one, so a single number works.

  • We can have many shards, and shard replicas; however, so the above code should be modified for double-digit compatibility.

In the trivial case (1 shard, 0 replicas) the representation shard00_endpoint is fair enough.
For many shards; however, we should use an underscore to separate the values like 2pc does.

shard0_0_endpoint="shard0:6666"

For example, we can't tell which shard or replica shard111_endpoint refers to if we have 50 shards and 15x replication. The underscore fixes that: shard11_1_endpoint. Even if we don't plan on double-digit replication, the separation helps readability.

The potential for many shards can be seen at the bottom of the diagram.
parsec-diagram

Code of Conduct

  • I agree to follow this project's Code of Conduct
@rockett-m rockett-m added the fix/bug Fixes errant behavior label Nov 26, 2024
@rockett-m
Copy link
Contributor Author

@HalosGhost I have the code for a proposed PR. Could you assign this to me? Thx

rockett-m added a commit to rockett-m/opencbdc-tx that referenced this issue Nov 27, 2024
rockett-m added a commit to rockett-m/opencbdc-tx that referenced this issue Nov 27, 2024
@HalosGhost HalosGhost assigned rockett-m and unassigned HalosGhost Nov 27, 2024
@HalosGhost HalosGhost added difficulty/01-good-first-issue Very approachable for new contributors status/in-progress Has been assigned to a contributor and is under active development enhancement/documentation Improves documentation and removed fix/bug Fixes errant behavior labels Nov 27, 2024
rockett-m added a commit to rockett-m/opencbdc-tx that referenced this issue Nov 27, 2024
@rockett-m rockett-m changed the title Use an number separator for parsec shard##_endpoint to prevent double-digit confusion Use a number separator for parsec shard##_endpoint to prevent double-digit confusion Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/01-good-first-issue Very approachable for new contributors enhancement/documentation Improves documentation status/in-progress Has been assigned to a contributor and is under active development
Projects
None yet
Development

No branches or pull requests

2 participants