Skip to content

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

Description

@rockett-m

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions