Repository navigation
fix(tsa): keep stamping through a grace window after the last good sync - #357
Merged
Merged
Conversation
The clock gate refused every request as soon as one time-sync poll went unanswered. It now trusts the clock while the last good sync is younger than pki.tsa.max_sync_age_seconds (default 3600) and the estimated clock error, the offset at that sync plus max_drift_ppm (default 100) of the time since, stays within max_clock_error_ms (default accuracy_ms). A round the servers answered but that was not applied sets the new TimeSyncStatus.adjustment_refused flag, which still refuses until the next good sync. Config with max_clock_error_ms above the accuracy is rejected. The timeNotAvailable status string names the limit and value. Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
The TSA clock gate refused every request as soon as one time-sync poll went unanswered, because it looked only at the latest round. A single lost NTP packet took the TSA down until the next good poll.
The gate now trusts the clock for a grace window after the last good sync and refuses with
timeNotAvailableonly when one of these limits is hit:no_good_syncadjustment_refusedmax_sync_agepki.tsa.max_sync_age_secondsmax_clock_errormax_drift_ppmof the time since exceedsmax_clock_error_msaccuracy_ms(1s)max_drift_ppmdefaults to 100, at most 500 (the NTP frequency tolerance).max_clock_error_mslarger than the effectiveaccuracy_msis rejected by config validation, so a token never claims more accuracy than the clock is trusted to have.Tsa.max_sync_age_seconds(8),max_drift_ppm(9),max_clock_error_ms(10) andTimeSyncStatus.adjustment_refused(10). The time-sync engine setsadjustment_refusedon answered-but-unapplied rounds and clears it on the next good sync.the TSA time source is not available: max_sync_age=1h0m0s exceeded (1h12m3s). Server names and sync errors stay in the node log.docs/tsa.mddocuments the limits, defaults and the accuracy rule. The website companion PR covers the public docs.Testing
task cipasses locally (fmt, proto lint, generate verify, lint, vet, test, build).Closes #356