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

Server time synchronization and MUID creation #1

Open
JonasKunze opened this issue Mar 19, 2014 · 0 comments
Open

Server time synchronization and MUID creation #1

JonasKunze opened this issue Mar 19, 2014 · 0 comments
Assignees
Milestone

Comments

@JonasKunze
Copy link
Member

The MUID contains the timestamp and an ID. If two MUIDs of the same type should be created by the same server (sourceID) within the same second the ID will be used to distinguish between those MUIDs.

Now if a server is moved to another machine which has a slow clock, it might happen that a MUID is created with a timestamp and ID that already exists.
Therefore the MUID creating servers should do following:

  1. The current unix time should be persistently saved to a file about every 10 seconds
  2. During runtime the maximum ID MAX_ID will be stored at the same file. This will only trigger a disk I/O if more MUIDs have been created within one second than ever before.
  3. After bootup MUIDs will be created normally if the current time is later than the time read in the persistent file at bootup
  4. If the current unix time is before the read time in the file, every created MUID will get an ID = MAX_ID+1 read from the persistent file at startup
@JonasKunze JonasKunze modified the milestone: 0.1.1 Mar 19, 2014
@JonasKunze JonasKunze self-assigned this Mar 27, 2014
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

No branches or pull requests

1 participant