Skip to content

feat: gossip protocol#30

Merged
leiysky merged 5 commits intoscopedb:mainfrom
leiysky:feat/cluster
Apr 20, 2025
Merged

feat: gossip protocol#30
leiysky merged 5 commits intoscopedb:mainfrom
leiysky:feat/cluster

Conversation

@leiysky
Copy link
Collaborator

@leiysky leiysky commented Apr 19, 2025

Part of #31

Summary

Introduced gossip protocol to manage cluster membership and consistent hash.

GossipState is responsible for maintaining the state machine of gossip protocol. In the current design, a simplified SWIM protocol without indirect ping(i.e. the suspicion mechanism) and anti-entropy are used to detect failure and maintain cluster membership.

Every node is identified with an UUID. This may cause confliction in some edge cases which we are unable to handle for now, but in most cases it is not a problem.

With the membership information, we can build a consistent hash ring to route the requests. Since Percas is a cache system, we don't need to consider consistency and data migration. Just let it be.

TODO

To integration with Percas server, there are some further works to do:

  • Persist the node id and introduce incarnation mechanism to reduce inconsistency
  • Maybe distinguish the commands between standalone mode and cluster mode
  • Find a way to test the cluster

@leiysky leiysky mentioned this pull request Apr 19, 2025
@leiysky leiysky linked an issue Apr 19, 2025 that may be closed by this pull request
@leiysky leiysky removed a link to an issue Apr 19, 2025
Copy link
Contributor

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@leiysky leiysky enabled auto-merge (squash) April 20, 2025 04:58
@leiysky leiysky merged commit 1eeaa33 into scopedb:main Apr 20, 2025
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants

Comments