I have a time sensitive operation that needs to be aware of clock skew among other computers, and /or guard against such a thing. How can I detect or guard against clock skew?
In my case I'm writing a compressed datetime stamp to Azure Blob. It would be disasterous if different nodes would intererpret that datetime stamp differently (as it can occur during a leap day, or leap second)
More info
I'm trying to detect clock skew in local node current time.
Each node will be writing time sensitive information to a Blob/Table. If the timestamp is older than X than certain actions will occur. If the time is not synchronized, data may be lost or corrupted.
Possible solution
Perhaps I can have each node write its current date to blob storage (32 bytes) on a regular interval, and then query that on a routine basis.
There are a few .NET NTP client APIs that will tell you the skew between a local node time and time on a NTP time server. For example:
You could use an NTP client to store both the local time and skew in your blob. When you read the blob on a different node, you could compute that node's local time and skew and compare it to the blob's stored time and skew.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With