-
Notifications
You must be signed in to change notification settings - Fork 530
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
Refactor sync status logging #3529
Conversation
Deployed to stage: Migration 0004 is slow (took about 10 minutes).
Is this one always
Even
Not state per se, but since we treat
These would be great (taken from #2023), can be done in a follow-up:
Need to have a closer look...
Probably. To admins. Maybe all /sync pages? |
Could this be
Why not |
Early observations:
|
It was maybe a minute for me locally, and I didn't spend much time optimizing it -- the data needs to be read from the project & repo sync logs & be rewritten in the new format. Easiest way to speed it up would be to e.g. only port the last week or so of events?
It should only be written if the status would be
Yes. That's anomalous if e.g. there's a crash mid-sync and we don't get to write a
Yeah, that and the sync source (automated vs. manual CLI vs. admin UI) should be tracked.
Yeah, that should be a follow-up.
The overview should be pretty safe to keep public, yes? It doesn't include error logs.
That would conflict with a project using
Because we can't tell the difference, both are logged the same way. But I should probably set it to some other value instead.
Potentially, yes.
I shall take that under advisement. |
Made the following changes:
|
I wouldn't mix sync type (regular, no commit, no pull, force) with status.
I don't think it's obvious what this means. I suggested
I'm not sure I like that to be the default, because I regularly check https://pontoon.mozilla.org/sync/log/ before deployment to see if all sync jobs are done. 😊 But maybe we can have an overall "sync in-progress" indicator in the header? Should we also remove the DB projects from the list? |
I agree about the others, but
Eh, this is only a transition issue, and given the log cycling, only valid for a few weeks after this is merged. After that, you don't need to remember what
In-progress syncs show up in the listing as "in progress", so that functionality is there already.
I'd prefer to keep them in, as it effectively communicates the truth about them not getting sync'd. |
Fair.
That's a reason not to special case it. :) 3rd party users will practically need to look into the code to understand it.
True.
Makes sense. I would make some CSS changes before merging if you don't mind, to bring the styling closer to the lists / tables on dashboard, e.g. https://pontoon.mozilla.org/projects/. |
|
Fine, will mark them as
Very happy for you to do so; please commit directly on the branch.
Ok. Will include a
It has |
Updated as above. Also added I'll also update the PR description to match.
Gah, I'd used |
Deployed to stage. @flodolo Could you please take it for a spin? |
I can take a stab at both of these as part of the CSS changes I'll push to the branch. |
…into eemeli-refactor-sync-log
Also: Factor out Pagination as a widget
See also #2023
As is, the logging of sync status is indexed primarily by a sync "run" that touches all projects, secondarily by project, and tertiarily by repository. The status for each project is also gathered implicitly into three states: in progress, skipped, and synced. This no longer matches how sync is actually run, and is hard to handle in practice.
Here, sync status logging is collapsed into a single table of events, which is written to only from
sync_project_task()
, with the following states:IN_PROGRESS
DONE
- sync complete, with some changes to DB or repoNO_CHANGES
- sync complete, with no changed to DB or repoNO_COMMIT
- sync complete, butcommit=False
was set while a repo write should've occurredPREV_BUSY
- skipped due to previous sync still runningFAIL
- an exception was raisedINCOMPLETE
- sync never completed; set by a subsequent successful runFor
FAIL
, an error message is retained in theerror
field.The logs are made available via the following views:
/sync
- latest sync status and start time for each project/sync/projects/<project>
- sync events for each project/sync/errors
- all anomalous sync events with a status other thanDONE
orNO_CHANGES
Old sync events are ported to the new format, setting the status as
NO_CHANGES
for all that were "skipped" andINCOMPLETE
for ones with no end time set.Some questions for potential futher changes:
Edit: Updated to match the PR as of #3529 (comment).