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

Create EccNodesSync Object to Represent Table nodes_sync #672

Closed
2 tasks done
VictorCavichioli opened this issue Jun 17, 2024 · 2 comments
Closed
2 tasks done

Create EccNodesSync Object to Represent Table nodes_sync #672

VictorCavichioli opened this issue Jun 17, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request PoC/Agent Tasks related to new generation of ecchronos as an agent

Comments

@VictorCavichioli
Copy link
Contributor

VictorCavichioli commented Jun 17, 2024

Story Description:
To keep ecchronos instances on sync is proposed to create a sync table, this table is not fully designed yet and might change on the future, but for the initial PoC is proposed to follow the below CQL definition:

CREATE TABLE ecchronos.nodes_sync
(
    ecchronos_id TEXT,
    datacenter_name TEXT,
    node_id UUID,
    node_endpoint TEXT,
    node_status TEXT,
    last_connection TIMESTAMP,
    next_connection TIMESTAMP,
    PRIMARY KEY
    (
        ecchronos_id,
        datacenter_name,
        node_endpoint,
        node_status
    )
) WITH CLUSTERING ORDER BY(
    datacenter_name DESC,
    node_endpoint DESC,
    node_status DESC
);

Is proposed to create a new package called sync in the core module with the designed class, at the beginning the insertStatement function is mandatory.

Acceptance Criteria:

  • Class designed as the CQL definition;
  • Initial TestClass for EccNodesSync is mandatory.

Definition of Done:

Code designed as described and approved by the maintainers

Notes:

Use EccRepairHistory as an inspiration.

Related to #652

@paulchandler
Copy link

paulchandler commented Jun 18, 2024

I would recommend the following primary key
PRIMARY KEY
(
ecchronos_id,
datacenter_name,
node_id
)

node_status should not be in there, or else you would have to delete and re insert the record when the status changes.
node_id should be used rather rather than node_endpoint as this will not change when the echronos is restarted by k8s.

@manmagic3 manmagic3 self-assigned this Jun 19, 2024
@VictorCavichioli
Copy link
Contributor Author

Hi @paulchandler , thank you for your comment, the design for that table would be now this:

CREATE TABLE ecchronos.nodes_sync
(
    ecchronos_id TEXT,
    datacenter_name TEXT,
    node_id UUID,
    node_endpoint TEXT,
    node_status TEXT,
    last_connection TIMESTAMP,
    next_connection TIMESTAMP,
    PRIMARY KEY
    (
        ecchronos_id,
        datacenter_name,
        node_id
    )
) WITH CLUSTERING ORDER BY(
    datacenter_name DESC,
    node_id DESC
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PoC/Agent Tasks related to new generation of ecchronos as an agent
Projects
None yet
Development

No branches or pull requests

3 participants