Story #3894
Updated by dkliban@redhat.com over 6 years ago
h2. Problem Lazy sync requires the plugin to create *Content, ContentArtifacts, and RemoteArtifact objects for every piece of content discovered at the remote. This kind of indexing is resource utilization prohibitive for repositories with millions of artifacts. h2. Solution h5. Data model change Make content indexing optional by enabling users to configure a Distribution with a Remote. This would be a new relation field added to "Distribution" and called "fallback_remote". h5. Integration with the Content serving app and Streamer The content app would then do the following to find an artifact to serve to the user: 1. Match path to a distribution. 2. Try to find an artifact by looking at the Publication associated with the Distribution. 3. 2. If an Artifact is found, send the content of it as a response. 4. 3. If an Artifact is not found and a RemoteArtifact is found, redirect to the streamer. 5. If neither an Artifact nor a RemoteArtifact is found, check if there is a fallback_remote associated with the Distribution. 6. 4. If a fallback_remote is not set for associated with the Distribution, return a 404. 7. 5. If a fallback_remote is associated, redirect try to the streamer. The streamer would then do the following to find the artifact to serve to the user: 1. Match path to a distribution. 2. Check if fallback_remote is set for the Distribution. 3. If fallback_remote is not set, find the RemoteArtifact an Artifact by looking at the Publication associated with the Distribution. 4. If fallback_remote is set, concatenate the Remote's URL with the relative path requested and try to find a matching using RemoteArtifact with that URL. 'url' field. 5. If a RemoteArtifact is found, check if it has an Artifact associated with it. 6. If an Artifact is associated with the RemoteArtifact, found, return the content of the Artifact as the response. 7. If a RemoteArtifact is found, but an Artifact is not found and fallback_remote is set, request found, use the artifact streamer to get the Artifact from squid using the URL. 8. If a RemoteArtifact is not found Remote and fallback_remote is NOT set, return stream it as a 404. response.