-
Notifications
You must be signed in to change notification settings - Fork 531
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
base: main
Are you sure you want to change the base?
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? |
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
-commit=False
was set, preventing a repo writeprev_busy
- skipped due to previous sync still runningfail
- an exception was raisedFor
fail
, an error message is retained in theerror
field.The logs are made available via the following views:
/sync/log
- latest sync status and start time for each project/sync/log/<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
fail
for all that were "skipped".Some questions for potential futher changes: