-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
List btrfs snapshots separately in the subvolume detail page #20234
Conversation
@mvollmer I thought a bit on how we could implement filtering: We could come up with a system where we don't have to hardcode the "filters" in but we could register filters for pages which want that.
This registers a filter which lives in Alternatively, we just hardcode filters:
Page/Card can have I'm not thinking of introducing something like a filter component. But maybe it is interesting to have something usable. |
I think this is a bit too much machinery. Let's just do what we need, and nothing more. |
Alright, after the discussion today in standup:
|
c22d6d0
to
ce13bed
Compare
ce13bed
to
528f40a
Compare
@jelly: Yes, I think that's what we want. Good, simple summary. I think we (you and/or @mvollmer and I) agreed on that a while ago somewhere? Perhaps in a video call? Perhaps in an issue? I don't remember where, but if we all agree on that, then that's great. To restart: I definitely do not want them on the overview (and never have) and I think the details pages are the right places for the snapshots. |
So the listing of snapshots on the page of their origin in a crossref table works. Let's nail down when to hide snapshots in the regular child tables. What about this: snapshots are only included in a child table when they are on the top-level. Otherwise they are replaced with a row that summarizes them "(20 snapshots)". Clicking on that row will go to the parent of those snapshots. Here is a made-up example (without that rule applied): Here, all the home-123 and images-123 subvolumes are snapshots. They would be omitted from the table and replaced with "(13 snapshots)". But when going to the "snapshots" subvolume, they would be listed like they are now, because they are on the top-level in that table: And of course they would also be listed on the page of their origin: In addition the page for a snapshot subvolume should have a link back to its origin: Heere the could be a description row with "Snapshot origin data/home". |
Good point.... I forgot about that... So on the overview they need to go away, that is a requirement from @garrett
What view is this? The filesystem detail page? Can we differentiate the overview and filesystem detail page easily?
Hmm feels a bit magical to me.
But then you wouldn't know it is a special subvolume would you? Better asked, how would we implement this:
The problem is a bit that BTRFS is very lenient and you can make everything everywhere without having to give it logical names.
Agreed.
Stretch goal, but seems nice! |
So parent_uuid is the origin of the snaphot subvolume, and parent_dir is the parent subvolume, right? In my example, "snapshots" is the parent of "home-1234", and "home" is the origin of "home-1234" (since it was created by "btrfs subvolume snapshot /run/butter/data/home /run/butter/data/snapshots/home-1234"). So your code above would not hide any snapshots in my example, since no snapshot subvolume has the subvolume as both parent and origin. It would only hide snapshots that are directly inside their origins, like the one created by "btrfs subvolume snapshot /run/butter/data/home /run/butter/data/home/snapshot-1". In my understanding, we want to get rid of snapshots in our tables because there are too many of them and they are usually not interesting. Isn't that the goal? |
That rule would apply to any ChildrenTable, thus to each page, overview and details. We can distinguish overview and details pages and we do that already: only the overview has icons, for example), But I propose we don't do that when deciding whether to hide snapshots. If they are distracting on the overview, they are also distracting elsewhere, no? And with the summary line, you can easily find the place that lists them all. |
Should we have actions on snapshots when they are listed in the crossrefs table? At least "Delete" seems appropriate. |
No this does indeed not work...
Yes, but you argued for showing them? |
Sounds reasonable. |
Yes, but sparingly. Snapshots are also subvolumes and we need to offer all the functionality of subvolumes for them, somewhere. Maybe people want to mount them, or copy them back to their origin. |
Some conclusions from my side:
Note: what if we show a subvolume snapshot as |
Conclusion from standup with @mvollmer "Let's merge this and figure out filtering/hiding subvolumes later. |
866349f
to
658725b
Compare
@martinpitt do you mind taking the review over? |
Alternative idea, we have one list of subvolumes:
|
658725b
to
984038f
Compare
pkg/storaged/btrfs/subvolume.jsx
Outdated
@@ -413,6 +434,9 @@ const BtrfsSubvolumeCard = ({ card, subvol, mismount_warning, block, fstab_confi | |||
<DescriptionList className="pf-m-horizontal-on-sm"> | |||
<StorageDescription title={_("Name")} value={subvol.pathname} /> | |||
<StorageDescription title={_("ID")} value={subvol.id} /> | |||
{snapshot_origin !== null && | |||
<StorageDescription title={_("Snapshot origin")} value={snapshot_origin.pathname} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a link, no?
actions, | ||
}); | ||
|
||
if (subvol.id !== 5 && subvol.parent_uuid !== null) | ||
register_crossref({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add the "Delete" action here.
In btrfs a snapshot is a subvolume with a parent_uuid field filled in with the uuid of the subvolume of which the snapshot is made. Note that btrfs allows one to make a snapshot of a snapshot.
Register crossrefs for snapshots so they show under snapshots in the detail page of a subvolume.
984038f
to
70ae75e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
register_crossref({ | ||
key: subvol.parent_uuid, | ||
card, | ||
size: mounted && <StorageUsageBar stats={use} short />, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test.
This PR identifies snapshots and lists them under the subvolume in a separate card.
Open questions:
Show snapshots of a subvolume in the detail view
Snapshot origin is shown in snapshot detail view