Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers/zfs: Handle missing layers during image deletion in ZFS file system #2123

Conversation

kimminss0
Copy link
Contributor

This commit fixes the following issue:

Issue Summary: An error occurs when attempting to delete images with non-existing ZFS layers, resulting in unintended behavior during image removal in Podman.

Steps to reproduce:

Preconditions:

  • A system running ZFS file system (tested on a FreeBSD machine).
  • ZFS dataset zroot/containers is mounted on /var/db/containers
  • [optional] No existing images and containers (recommended for easier identification of the pulled image in the following steps)

Steps:

# Replace <image> with any other images, such as docker.io/dougrabson/hello
$ podman pull <image>

# Check the dataset name created under `zroot/containers`
$ zfs list -d 1 zroot/containers

# Manually destroy dataset
$ zfs destroy zroot/containers/<dataset_name>

# Error may occur; this might be expected
$ podman images <image>

# Manually remove the corrupted image
$ podman rmi <image> --force

# Error reproduces here - not intended
$ podman images <image>

Note: For recovery, you can recreate the dataset with the same name, and then remove the image with Podman.

@kimminss0 kimminss0 force-pushed the zfs-tolerate-already-removed-layer-deletion branch 3 times, most recently from c41479c to 7f9cd5a Compare October 4, 2024 08:42
@rhatdan
Copy link
Member

rhatdan commented Oct 4, 2024

/approve
LGTM
@nalind @saschagrunert @dfr @giuseppe @mheon PTAL

Copy link
Contributor

openshift-ci bot commented Oct 4, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kimminss0, rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Oct 4, 2024
@kimminss0 kimminss0 force-pushed the zfs-tolerate-already-removed-layer-deletion branch from 7f9cd5a to 2bb4a8c Compare October 7, 2024 12:54
@dfr
Copy link
Contributor

dfr commented Oct 7, 2024

LGTM

@kimminss0
Copy link
Contributor Author

rebased

drivers/zfs/zfs.go Outdated Show resolved Hide resolved
@kimminss0 kimminss0 force-pushed the zfs-tolerate-already-removed-layer-deletion branch from 2bb4a8c to 9601c29 Compare October 7, 2024 15:51
@kimminss0 kimminss0 force-pushed the zfs-tolerate-already-removed-layer-deletion branch from 9601c29 to d9e4f1e Compare October 7, 2024 15:52
@rhatdan
Copy link
Member

rhatdan commented Oct 8, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Oct 8, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit a397602 into containers:main Oct 8, 2024
19 checks passed
@kimminss0 kimminss0 deleted the zfs-tolerate-already-removed-layer-deletion branch October 8, 2024 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants