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

RFC: Change Salt to create JIDs as UTC time #33309

Closed
whiteinge opened this issue May 17, 2016 · 15 comments
Closed

RFC: Change Salt to create JIDs as UTC time #33309

whiteinge opened this issue May 17, 2016 · 15 comments
Labels
Bug broken, incorrect, or confusing behavior Core relates to code central or existential to Salt P1 Priority 1 severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone

Comments

@whiteinge
Copy link
Contributor

Background

JIDs in Salt are currently generated from the Salt Master's current timezone. This makes it difficult or (practically) impossible for consumers of Salt to reconcile a job timestamp with the user's relative local time -- specifically programmatic consumers like via returners or salt-api.

(Please comment with corrections if I am mistaken with anything above!)

Request for comments

What would the potential fallout be for switching Salt to store JIDs in UTC in the next major Salt release?

Initial thoughts

There would be an increased risk for JID collisions for a window of time after users upgrade to this version (I think just the offset of the user's current time and UTC). That risk is already pretty low, but something to consider anyway.

Alternate ideas

  • Leave the JID as-is and add a new field to the job cache with a UTC timestamp.

    Safer but less "single source of truth"-y.

  • Expose the Salt Master's timezone via a Runner or a salt-api endpoint and let the end-users do the math.

    Safer for Salt but a PITA for users. Also likely fraught with edge-cases and mistakes.

@saltstack/team-core @saltstack/team-riot @saltstack/team-platform @thatch45 thoughts?

@whiteinge whiteinge added Question The issue is more of a question rather than a bug or a feature request Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged labels May 17, 2016
@whiteinge whiteinge added this to the Approved milestone May 17, 2016
@cro
Copy link
Contributor

cro commented May 17, 2016

👍 from me

@cro
Copy link
Contributor

cro commented May 17, 2016

Huge benefits for external job caches as well. Also, we already have issues with companies who have masters in different timezones. If they aggregate to a single external job cache then you can't meaningfully compare JIDs to see when jobs that hit different masters occurred.

@cachedout
Copy link
Contributor

I'd want to be sold on the benefit a little more. There are maybe a few billion stored Salt jobs out there in the world. The risk of collisions is higher than I'd like to imagine. ;]

@thatch45
Copy link
Contributor

salt checks for a collision before making the jid though....

@cro
Copy link
Contributor

cro commented May 17, 2016

Aren't the collisions just going to exist for less than 24 hours after the switch to UTC is made, though? And only timezones east of UTC are affected since everyone west of UTC will see their JIDs jump forward.

@cachedout
Copy link
Contributor

Both good points.

If we have a retry mechanism (which I vaguely recall but haven't looked into) then I'm cool.

@thatch45
Copy link
Contributor

right, so it is 12 hours of collisions, which we SHOULD have a check in place for, but we should double check it, since I wrote it 5 years ago....

@whiteinge
Copy link
Contributor Author

I remember that Tom. His voice was a tad more gravelly but he had way, way fewer gray hairs.

@whiteinge
Copy link
Contributor Author

This week I noticed our event-bus _stamp fields as well as the success_stamp in the job cache for Runners are in UTC.

  • Does Salt perform date comparisons anywhere internally that this change could affect?
  • As part of this change, should we convert print the StartTime (runners) and start_time (highstate) as the user's local time or UTC?

And are there any other potential pitfalls along those lines?

@whiteinge whiteinge added Core relates to code central or existential to Salt ZRELEASED - Carbon and removed Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged Question The issue is more of a question rather than a bug or a feature request labels Jun 8, 2016
@meggiebot meggiebot added P1 Priority 1 P2 Priority 2 and removed P1 Priority 1 labels Jun 8, 2016
@meggiebot meggiebot added the Bug broken, incorrect, or confusing behavior label Dec 19, 2016
@timwhite
Copy link

timwhite commented Mar 5, 2017

This seems to have missed 2 major releases. External tools using the API have issues due to this bug, so it would be really nice to have it fixed. Any updates on which release this may end up in?

@cachedout cachedout added severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around P1 Priority 1 and removed P2 Priority 2 labels Mar 8, 2017
@whiteinge
Copy link
Contributor Author

@timwhite thanks for the bump.

General consensus is this should be an easy switchover. Main blocker is the unknowns. We talked about this today and will make the switch for Oxygen to give any potential issues time to surface.

@stale
Copy link

stale bot commented Sep 14, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

@stale stale bot added the stale label Sep 14, 2018
@whiteinge
Copy link
Contributor Author

glares at stalebot

@stale
Copy link

stale bot commented Sep 15, 2018

Thank you for updating this issue. It is no longer marked as stale.

@sagetherage
Copy link
Contributor

Closing as complete from the two PRs referenced above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Core relates to code central or existential to Salt P1 Priority 1 severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
None yet
Development

No branches or pull requests

7 participants