Comment 2 for bug 2066411

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to distcloud (master)

Reviewed: https://review.opendev.org/c/starlingx/distcloud/+/920194
Committed: https://opendev.org/starlingx/distcloud/commit/a60ce81f2600dcefe988a92a1c92e450a7e0ba7f
Submitter: "Zuul (22348)"
Branch: master

commit a60ce81f2600dcefe988a92a1c92e450a7e0ba7f
Author: Kyle MacLeod <email address hidden>
Date: Wed May 22 12:13:14 2024 -0400

    Fix stale or missing ostree_repo bind mount in iso dir

    This commit addresses the odd cases where the
    /var/www/pages/iso/<rel>/ostree_repo bind mount
    becomes missing or stale.

    We add detection of missing content, and also detect a stale bind mount.

    A stale bind mount is detected by comparing the inode numbers
    of the bind-mounted /var/www/pages/iso/<rel>/ostree_repo and original
    /var/www/pages/feed/rel-<rel>/ostree_repo directory.

    NOTES:
    - The self.www_root variable is changed to self.www_iso_root to make
      it more obvious that this is the /var/www/pages/iso path, not the feed
      path.
    - Now using the 'sh' python library for the mount commands, which is
      much more convenient and straight-forward than the subprocess library

    Test Plan:
    PASS:
    - Unmount (but do not delete) the /var/www/pages/iso/<rel>/ostree_repo
      directory. When a subcloud add or deploy operation is done, the bind
      mount is recreated.
    - Stale mount:
        # Replace the original
        sudo cp -a /var/www/pages/feed/rel-24.09/ostree_repo \
          /var/www/pages/feed/rel-24.09/ostree_repo.orig
        sudo rm -rf /var/www/pages/feed/rel-24.09/ostree_repo
        sudo cp -a /var/www/pages/feed/rel-24.09/ostree_repo.orig \
          /var/www/pages/feed/rel-24.09/ostree_repo
      When a subcloud add or deploy operation is done, the stale bind
      mount is detected. The /var/www/pages/iso/24.09/ostree_repo is
      unmounted, and the directory is removed.
      When a subcloud add or deploy operation is done, the bind
      mount is recreated.

    Closes-Bug: 2066411

    Change-Id: I25911722b1e333cd352f142664526d7dfa73e9e8
    Signed-off-by: Kyle MacLeod <email address hidden>