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

Improving consistency between SessionServer and DataServer #57

Closed
atellwu opened this issue Sep 23, 2019 · 1 comment
Closed

Improving consistency between SessionServer and DataServer #57

atellwu opened this issue Sep 23, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@atellwu
Copy link
Contributor

atellwu commented Sep 23, 2019

The background

The reasons for the inconsistency between SessionServerServer and DataServer:

  • SessionServer sending clientOff is not absolutely reliable
  • SessionServer disconnection DataServer over 30 seconds triggers SessionServer Off, causing DataServer to be erased incorrectly
  • DataServer outage may cause datum loss in memory queues
  • DataServer outage exceeds N (N is the number of copies), and some datum will be permanently missible.
  • Disadvantage of consistency hash: When DataServer list changes frequently, SessionServers may send datum to incorrect DataServer at certain times, resulting in dirty datum and missing datum

How to ensure consistency?

  • Consistency between client and SessionServer:
    • Pub / unpub sent by client: Write directly to SessionServer memory, which is 100% successful. Success means that client and SessionServer are identical.
    • Client disconnection: SessionServer is connected aware and executes clientOff to delete pub datum in memory. Because of the bolt heartbeat, the reliability of the perception of connection survival can be guaranteed.
  • Eventual consistency between SessionServer and DataServer
    • SessionServer asynchronous threads are responsible for sending specific pub/unpub/clientOff datum to DataServer, retry if failed, and drop and log if retry fails a certain number of times.
      • Special scenario: If the client disconnects/SessionServer downtime, the client will reconnect to other SessionServers and send all datum again, and the old datum will be deleted because of the client off/SessionServer off/expired.
    • SessionServer regularly sends renew (including heartbeat and checksum) to ensure that the wrong datum can be corrected; Use expired mechanism to regularly clean up expired datum.

Design for SessionServer

WX20190923-145811@2x

Design for DataServer

WX20190923-145844@2x

@atellwu atellwu added the enhancement New feature or request label Sep 23, 2019
@dzdx
Copy link
Member

dzdx commented Mar 16, 2022

support by SlotDiffSyncer

@dzdx dzdx closed this as completed Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants