-
Story
-
Resolution: Done
-
Major
-
None
-
None
-
5
-
False
-
-
False
-
rhel-container-tools
-
-
-
RUN 276, RUN 277, RUN 278
Summary: Rework podman pull to use a staged approach for image layer handling, minimizing lock contention and improving concurrency during image downloads.
Description:
Currently, the podman pull operation acquires and holds a global lock for the entire duration of the image download, decompression, and final placement. This behavior can lead to significant user experience issues, as it prevents most other Podman commands from running concurrently while an image pull is in progress, effectively blocking the user's workflow.
This story aims to address this concurrency bottleneck by implementing a staged approach for podman pull. Inspired by similar improvements made for image removal (as seen in https://github.com/containers/storage/pull/2325), the new process will break down the pull operation into distinct phases:
- Layer Pulling: Image layers are downloaded from the registry.
- Decompression: Downloaded layers are decompressed.
- Final Renaming/Placement: Decompressed layers are moved to their final destination in the image store.
The critical improvement is that only the final renaming/placement step will require holding a lock. The initial pulling and decompression phases will occur without holding the global lock, significantly reducing the time other Podman commands are blocked. This directly addresses the problem outlined in https://github.com/containers/podman/issues/25862.
Proposed Solution:
- Refactor podman pull Logic: Re-architect the podman pull command's internal workflow to separate the download and decompression steps from the final image store integration.
- Temporary Storage: Utilize temporary locations for downloaded and decompressed layers before they are moved to their permanent place.
- Lock Granularity: Ensure that the global storage lock is only acquired for the brief period required to atomically move the prepared layers into the image store and update metadata.
- Error Handling and Rollback: Implement robust error handling and rollback mechanisms for each stage to ensure data integrity in case of failures.
- Performance Testing: Conduct performance tests to verify the reduction in lock contention and overall improvement in concurrency.
Acceptance Criteria:
- podman pull can download and decompress image layers without holding the global storage lock.
- The global storage lock is only held for a minimal duration during the final stage of the image pull (renaming/placement).
- Other Podman commands (e.g., podman ps, podman images) can execute concurrently with podman pull during its download and decompression phases.
- Image pulls complete successfully and maintain data integrity with the new staged approach.
- No regressions are introduced in image pulling functionality or reliability.
- Documentation (if applicable) is updated to reflect the improved concurrency.
- is cloned by
-
RUN-3648 Implement Staged Image Pull in Podman
-
- Code Review
-