Geo: Deleted project events may be skipped on the secondary when selective sync is used
From gitlab-com/migration#295 (comment 70641646), I've observed that a handful of project deletion events didn't appear to be processed on the secondary.
I suspect the can_replay?
is causing issues here: https://gitlab.com/gitlab-org/gitlab-ee/blob/8ba913345b66c8f6629b645d72cb43aef12fdbad/ee/lib/gitlab/geo/log_cursor/daemon.rb#L83-87. Here's what could be happening:
- User deletes project
- This is updated in both the primary and secondary databases
- The log cursor runs and sees the deleted project event.
-
Gitlab::Geo.current_node&.projects_include?(event_log.project_id)
isfalse
, which then skips the event.
I think we should skip this check if we're dealing with a deleted project.
Edited by Stan Hu