This MR adds Docker registry sync to a secondary node. The basic principle is that same as for files and git repositories. When we push a new image to the docker registry the notification event is created in the primary database and it will be propagated to the secondary. We intentionally don't track every pushed tag, instead, a secondary node makes a request to the primary's Registry API to get the list of available tags (with their digests) in this particular docker registry repository and with that information, the secondary pulls new images or removes outdated ones.
Because it creates some problems on the primary node, it will be needed to track all those tags and it will be also needed to actualize that information periodically because the docker registry notification system is not reliable at all. Also, that would require to maintain a huge database table and make SQL against it often so it’s unpractical.
https://gitlab.com/gitlab-org/gitlab-ee/issues/2870
lib/api/container_registry_event.rb