Skip to content

Server time synchronization and MUID creation #1

@JonasKunze

Description

@JonasKunze

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions