Skip to content

Geo: Skip design repo update events based on selective sync

Summary

From #230505 (closed):

This is because all design update events are creating registry records for designs, without checking if they are e.g. outside of selective sync.

https://gitlab.com/gitlab-org/gitlab/blob/master/ee/lib/gitlab/geo/log_cursor/events/design_repository_updated_event.rb#L12-15

The RegistryConsistencyWorker eventually removes them, but in the meantime, they impact the counts, and if the shard is healthy, a sync job is enqueued and executed.

It looks like this may affect all the legacy update/create events. (Design repo, project repo, wiki repo, container repository)

This issue is to fix design repo update events (which are reused for creation of designs).

Steps to reproduce

  • Enable selective sync
  • Create a design outside of selective sync

What is the current bug behavior?

  • It will increase the design repo count on the secondary /admin/geo/nodes UI
  • It will sync the design

Same for updating a design.

What is the expected correct behavior?

  • It should not increase the design repo count on the secondary /admin/geo/nodes UI
  • It should not attempt to sync the design

Results of GitLab environment info

  • staging.gitlab.com

Possible fixes

Skip creating registry and enqueuing a sync job, if outside of selective sync, in these event handlers:

Edited by Michael Kozono