Add event log for Geo
For Geo, we are moving away from relying on system hooks and adding an event log for the secondary to figure out what has changed:
To do this, we need a Geo event log. In gitlab-org/gitlab-ee#2336, we are improving audit logging for EE. For Geo, we have slightly more requirements than just storing simple events. See https://docs.google.com/spreadsheets/d/1wZty3O6Z1CqfWPtnQxJriob1aftsGBUQKx_0KjXD9fs/edit#gid=0 for a list of events.
For example, let's take the case where we have these projects under a namespace foo
:
- foo
- subgroup1
- project1
- project2
- subgroup2
- project3
- subgroup1
Now let's consider namespace deletion. It's not enough to log "foo was deleted" in our audit log because the secondary still has to apply filesystem changes; the database changes come with PostgreSQL.
That means we need to log all details about the project before it was actually removed from the database, including the relevant paths (e.g. repository path, Wiki path, upload path, GitLab pages path, etc.). For example, we might need to record:
- foo/subgroup1/project1 was deleted
- Paths removed: foo/subgroup1/project1.git, foo/subgroup1/project1.wiki.git, shared/uploads/foo/subgroup1
- Cache was invalidated
- Repeat for all other projects
Geo Design doc: https://docs.google.com/document/d/1EMZ7C2wyKfaciNxNbiI4er2IOfHFtzFqW0nY54yAQSA/edit#heading=h.111gjq5uokmz