{"action":"created","comment":{"url":"https://api.github.com/repos/storaged-project/blivet/pulls/comments/165934879","pull_request_review_id":93945608,"id":165934879,"diff_hunk":"@@ -605,7 +569,33 @@ def _postCreate(self):\n         for member in self.devices:\n             member.format.mdUuid = self.uuid\n \n-        self._removeStaleLVM()\n+        def removeStaleLVM():\n+            \"\"\" Remove any stale LVM metadata that pre-existed in a new array's on-disk footprint. \"\"\"\n+            log.debug(\"waiting 5s for activation of stale lvm on new md array %s\", self.path)\n+            time.sleep(5)\n+            udev.settle()\n+\n+            try:\n+                pv_info = lvm.pvinfo(device=self.path)[self.path]\n+            except errors.LVMError as e:\n+                return\n+\n+            vg_uuid = None\n+            try:\n+                vg_uuid = udev.device_get_vg_uuid(pv_info)\n+            except KeyError:\n+                return\n+\n+            if vg_uuid:\n+                log.info(\"removing stale LVM metadata found on %s\", self.name)\n+                try:\n+                    lvm.vgremove(None, vg_uuid=vg_uuid)\n+                except errors.LVMError as e:\n+                    log.error(\"Failed to remove stale volume group from newly-created md array %s: %s\",\n+                              self.path, str(e))\n+                    raise\n+\n+        removeStaleLVM()","path":"blivet/devices/md.py","position":40,"original_position":90,"commit_id":"57524f382e414a56d729e8f274fa279bebf57a6c","original_commit_id":"57524f382e414a56d729e8f274fa279bebf57a6c","user":{"login":"vpodzime","id":1044278,"avatar_url":"https://avatars1.githubusercontent.com/u/1044278?v=4","gravatar_id":"","url":"https://api.github.com/users/vpodzime","html_url":"https://github.com/vpodzime","followers_url":"https://api.github.com/users/vpodzime/followers","following_url":"https://api.github.com/users/vpodzime/following{/other_user}","gists_url":"https://api.github.com/users/vpodzime/gists{/gist_id}","starred_url":"https://api.github.com/users/vpodzime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vpodzime/subscriptions","organizations_url":"https://api.github.com/users/vpodzime/orgs","repos_url":"https://api.github.com/users/vpodzime/repos","events_url":"https://api.github.com/users/vpodzime/events{/privacy}","received_events_url":"https://api.github.com/users/vpodzime/received_events","type":"User","site_admin":false},"body":"This looks weird now that I see it. Maybe it does't have to be a separate function at all in the end? Anyway, looks good (or equally bad) to me either way.","created_at":"2018-02-05T10:39:23Z","updated_at":"2018-02-05T10:39:29Z","html_url":"https://github.com/storaged-project/blivet/pull/651#discussion_r165934879","pull_request_url":"https://api.github.com/repos/storaged-project/blivet/pulls/651","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/storaged-project/blivet/pulls/comments/165934879"},"html":{"href":"https://github.com/storaged-project/blivet/pull/651#discussion_r165934879"},"pull_request":{"href":"https://api.github.com/repos/storaged-project/blivet/pulls/651"}}},"pull_request":{"url":"https://api.github.com/repos/storaged-project/blivet/pulls/651","id":164390465,"html_url":"https://github.com/storaged-project/blivet/pull/651","diff_url":"https://github.com/storaged-project/blivet/pull/651.diff","patch_url":"https://github.com/storaged-project/blivet/pull/651.patch","issue_url":"https://api.github.com/repos/storaged-project/blivet/issues/651","number":651,"state":"open","locked":false,"title":"Remove stale lvm metadata found on new md arrays.","user":{"login":"dwlehman","id":6605451,"avatar_url":"https://avatars3.githubusercontent.com/u/6605451?v=4","gravatar_id":"","url":"https://api.github.com/users/dwlehman","html_url":"https://github.com/dwlehman","followers_url":"https://api.github.com/users/dwlehman/followers","following_url":"https://api.github.com/users/dwlehman/following{/other_user}","gists_url":"https://api.github.com/users/dwlehman/gists{/gist_id}","starred_url":"https://api.github.com/users/dwlehman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwlehman/subscriptions","organizations_url":"https://api.github.com/users/dwlehman/orgs","repos_url":"https://api.github.com/users/dwlehman/repos","events_url":"https://api.github.com/users/dwlehman/events{/privacy}","received_events_url":"https://api.github.com/users/dwlehman/received_events","type":"User","site_admin":false},"body":"Multiple subsequent installations with the same layout (lvm-on-raid1) with lazy cleanup in between can lead to a situation in which stale lvm metadata is found by udev/lvmetad/pvscan immediately after creation of a new md array. The same udev/lvmetad/pvscan machinery activates this lvm, which trips blivet since it is unaware of the newly-activated devices.\r\n\r\nThere will also be a version of this for newer branches once the fix is confirmed by reporters.","created_at":"2018-01-22T19:07:23Z","updated_at":"2018-02-05T10:39:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"94cebf33f8ba1ff89f87497a9428372d8ee6c17e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/storaged-project/blivet/pulls/651/commits","review_comments_url":"https://api.github.com/repos/storaged-project/blivet/pulls/651/comments","review_comment_url":"https://api.github.com/repos/storaged-project/blivet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/storaged-project/blivet/issues/651/comments","statuses_url":"https://api.github.com/repos/storaged-project/blivet/statuses/57524f382e414a56d729e8f274fa279bebf57a6c","head":{"label":"dwlehman:mdcreate-stale-lvm-metadata","ref":"mdcreate-stale-lvm-metadata","sha":"57524f382e414a56d729e8f274fa279bebf57a6c","user":{"login":"dwlehman","id":6605451,"avatar_url":"https://avatars3.githubusercontent.com/u/6605451?v=4","gravatar_id":"","url":"https://api.github.com/users/dwlehman","html_url":"https://github.com/dwlehman","followers_url":"https://api.github.com/users/dwlehman/followers","following_url":"https://api.github.com/users/dwlehman/following{/other_user}","gists_url":"https://api.github.com/users/dwlehman/gists{/gist_id}","starred_url":"https://api.github.com/users/dwlehman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwlehman/subscriptions","organizations_url":"https://api.github.com/users/dwlehman/orgs","repos_url":"https://api.github.com/users/dwlehman/repos","events_url":"https://api.github.com/users/dwlehman/events{/privacy}","received_events_url":"https://api.github.com/users/dwlehman/received_events","type":"User","site_admin":false},"repo":{"id":31965131,"name":"blivet","full_name":"dwlehman/blivet","owner":{"login":"dwlehman","id":6605451,"avatar_url":"https://avatars3.githubusercontent.com/u/6605451?v=4","gravatar_id":"","url":"https://api.github.com/users/dwlehman","html_url":"https://github.com/dwlehman","followers_url":"https://api.github.com/users/dwlehman/followers","following_url":"https://api.github.com/users/dwlehman/following{/other_user}","gists_url":"https://api.github.com/users/dwlehman/gists{/gist_id}","starred_url":"https://api.github.com/users/dwlehman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwlehman/subscriptions","organizations_url":"https://api.github.com/users/dwlehman/orgs","repos_url":"https://api.github.com/users/dwlehman/repos","events_url":"https://api.github.com/users/dwlehman/events{/privacy}","received_events_url":"https://api.github.com/users/dwlehman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dwlehman/blivet","description":"A python module for configuration of block devices","fork":true,"url":"https://api.github.com/repos/dwlehman/blivet","forks_url":"https://api.github.com/repos/dwlehman/blivet/forks","keys_url":"https://api.github.com/repos/dwlehman/blivet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dwlehman/blivet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dwlehman/blivet/teams","hooks_url":"https://api.github.com/repos/dwlehman/blivet/hooks","issue_events_url":"https://api.github.com/repos/dwlehman/blivet/issues/events{/number}","events_url":"https://api.github.com/repos/dwlehman/blivet/events","assignees_url":"https://api.github.com/repos/dwlehman/blivet/assignees{/user}","branches_url":"https://api.github.com/repos/dwlehman/blivet/branches{/branch}","tags_url":"https://api.github.com/repos/dwlehman/blivet/tags","blobs_url":"https://api.github.com/repos/dwlehman/blivet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dwlehman/blivet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dwlehman/blivet/git/refs{/sha}","trees_url":"https://api.github.com/repos/dwlehman/blivet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dwlehman/blivet/statuses/{sha}","languages_url":"https://api.github.com/repos/dwlehman/blivet/languages","stargazers_url":"https://api.github.com/repos/dwlehman/blivet/stargazers","contributors_url":"https://api.github.com/repos/dwlehman/blivet/contributors","subscribers_url":"https://api.github.com/repos/dwlehman/blivet/subscribers","subscription_url":"https://api.github.com/repos/dwlehman/blivet/subscription","commits_url":"https://api.github.com/repos/dwlehman/blivet/commits{/sha}","git_commits_url":"https://api.github.com/repos/dwlehman/blivet/git/commits{/sha}","comments_url":"https://api.github.com/repos/dwlehman/blivet/comments{/number}","issue_comment_url":"https://api.github.com/repos/dwlehman/blivet/issues/comments{/number}","contents_url":"https://api.github.com/repos/dwlehman/blivet/contents/{+path}","compare_url":"https://api.github.com/repos/dwlehman/blivet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dwlehman/blivet/merges","archive_url":"https://api.github.com/repos/dwlehman/blivet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dwlehman/blivet/downloads","issues_url":"https://api.github.com/repos/dwlehman/blivet/issues{/number}","pulls_url":"https://api.github.com/repos/dwlehman/blivet/pulls{/number}","milestones_url":"https://api.github.com/repos/dwlehman/blivet/milestones{/number}","notifications_url":"https://api.github.com/repos/dwlehman/blivet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dwlehman/blivet/labels{/name}","releases_url":"https://api.github.com/repos/dwlehman/blivet/releases{/id}","deployments_url":"https://api.github.com/repos/dwlehman/blivet/deployments","created_at":"2015-03-10T15:27:13Z","updated_at":"2017-07-04T06:48:28Z","pushed_at":"2018-02-02T16:41:27Z","git_url":"git://github.com/dwlehman/blivet.git","ssh_url":"git@github.com:dwlehman/blivet.git","clone_url":"https://github.com/dwlehman/blivet.git","svn_url":"https://github.com/dwlehman/blivet","homepage":null,"size":9241,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":2,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"storaged-project:rhel7-branch","ref":"rhel7-branch","sha":"143baf7e80430da384a26d506015b96036e24e9e","user":{"login":"storaged-project","id":11505466,"avatar_url":"https://avatars1.githubusercontent.com/u/11505466?v=4","gravatar_id":"","url":"https://api.github.com/users/storaged-project","html_url":"https://github.com/storaged-project","followers_url":"https://api.github.com/users/storaged-project/followers","following_url":"https://api.github.com/users/storaged-project/following{/other_user}","gists_url":"https://api.github.com/users/storaged-project/gists{/gist_id}","starred_url":"https://api.github.com/users/storaged-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/storaged-project/subscriptions","organizations_url":"https://api.github.com/users/storaged-project/orgs","repos_url":"https://api.github.com/users/storaged-project/repos","events_url":"https://api.github.com/users/storaged-project/events{/privacy}","received_events_url":"https://api.github.com/users/storaged-project/received_events","type":"Organization","site_admin":false},"repo":{"id":16584540,"name":"blivet","full_name":"storaged-project/blivet","owner":{"login":"storaged-project","id":11505466,"avatar_url":"https://avatars1.githubusercontent.com/u/11505466?v=4","gravatar_id":"","url":"https://api.github.com/users/storaged-project","html_url":"https://github.com/storaged-project","followers_url":"https://api.github.com/users/storaged-project/followers","following_url":"https://api.github.com/users/storaged-project/following{/other_user}","gists_url":"https://api.github.com/users/storaged-project/gists{/gist_id}","starred_url":"https://api.github.com/users/storaged-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/storaged-project/subscriptions","organizations_url":"https://api.github.com/users/storaged-project/orgs","repos_url":"https://api.github.com/users/storaged-project/repos","events_url":"https://api.github.com/users/storaged-project/events{/privacy}","received_events_url":"https://api.github.com/users/storaged-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/storaged-project/blivet","description":"A python module for configuration of block devices","fork":false,"url":"https://api.github.com/repos/storaged-project/blivet","forks_url":"https://api.github.com/repos/storaged-project/blivet/forks","keys_url":"https://api.github.com/repos/storaged-project/blivet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/storaged-project/blivet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/storaged-project/blivet/teams","hooks_url":"https://api.github.com/repos/storaged-project/blivet/hooks","issue_events_url":"https://api.github.com/repos/storaged-project/blivet/issues/events{/number}","events_url":"https://api.github.com/repos/storaged-project/blivet/events","assignees_url":"https://api.github.com/repos/storaged-project/blivet/assignees{/user}","branches_url":"https://api.github.com/repos/storaged-project/blivet/branches{/branch}","tags_url":"https://api.github.com/repos/storaged-project/blivet/tags","blobs_url":"https://api.github.com/repos/storaged-project/blivet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/storaged-project/blivet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/storaged-project/blivet/git/refs{/sha}","trees_url":"https://api.github.com/repos/storaged-project/blivet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/storaged-project/blivet/statuses/{sha}","languages_url":"https://api.github.com/repos/storaged-project/blivet/languages","stargazers_url":"https://api.github.com/repos/storaged-project/blivet/stargazers","contributors_url":"https://api.github.com/repos/storaged-project/blivet/contributors","subscribers_url":"https://api.github.com/repos/storaged-project/blivet/subscribers","subscription_url":"https://api.github.com/repos/storaged-project/blivet/subscription","commits_url":"https://api.github.com/repos/storaged-project/blivet/commits{/sha}","git_commits_url":"https://api.github.com/repos/storaged-project/blivet/git/commits{/sha}","comments_url":"https://api.github.com/repos/storaged-project/blivet/comments{/number}","issue_comment_url":"https://api.github.com/repos/storaged-project/blivet/issues/comments{/number}","contents_url":"https://api.github.com/repos/storaged-project/blivet/contents/{+path}","compare_url":"https://api.github.com/repos/storaged-project/blivet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/storaged-project/blivet/merges","archive_url":"https://api.github.com/repos/storaged-project/blivet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/storaged-project/blivet/downloads","issues_url":"https://api.github.com/repos/storaged-project/blivet/issues{/number}","pulls_url":"https://api.github.com/repos/storaged-project/blivet/pulls{/number}","milestones_url":"https://api.github.com/repos/storaged-project/blivet/milestones{/number}","notifications_url":"https://api.github.com/repos/storaged-project/blivet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/storaged-project/blivet/labels{/name}","releases_url":"https://api.github.com/repos/storaged-project/blivet/releases{/id}","deployments_url":"https://api.github.com/repos/storaged-project/blivet/deployments","created_at":"2014-02-06T16:02:44Z","updated_at":"2018-02-01T17:39:07Z","pushed_at":"2018-02-05T10:25:07Z","git_url":"git://github.com/storaged-project/blivet.git","ssh_url":"git@github.com:storaged-project/blivet.git","clone_url":"https://github.com/storaged-project/blivet.git","svn_url":"https://github.com/storaged-project/blivet","homepage":null,"size":11794,"stargazers_count":43,"watchers_count":43,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":56,"mirror_url":null,"archived":false,"open_issues_count":36,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1"},"forks":56,"open_issues":36,"watchers":43,"default_branch":"2.1-devel"}},"_links":{"self":{"href":"https://api.github.com/repos/storaged-project/blivet/pulls/651"},"html":{"href":"https://github.com/storaged-project/blivet/pull/651"},"issue":{"href":"https://api.github.com/repos/storaged-project/blivet/issues/651"},"comments":{"href":"https://api.github.com/repos/storaged-project/blivet/issues/651/comments"},"review_comments":{"href":"https://api.github.com/repos/storaged-project/blivet/pulls/651/comments"},"review_comment":{"href":"https://api.github.com/repos/storaged-project/blivet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/storaged-project/blivet/pulls/651/commits"},"statuses":{"href":"https://api.github.com/repos/storaged-project/blivet/statuses/57524f382e414a56d729e8f274fa279bebf57a6c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"vpodzime"}}