Skip to content

Commit

Permalink
Clean up origin links after revert
Browse files Browse the repository at this point in the history
If a snapshot was taken after the one reverted to, remove its origin
field.

If a snapshot was reverted, any snapshot that points at it should have
its origin field removed.

Signed-off-by: mulhern <[email protected]>
  • Loading branch information
mulkieran committed Aug 29, 2024
1 parent 7880dea commit 38bc267
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/engine/strat_engine/thinpool/thinpool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,14 @@ where
origin.uuid, origin.thin_id, e
);
}
for fs in filesystem_metadata_map.values_mut() {
if fs.origin.map(|o| o == snap_uuid).unwrap_or(false)
|| (fs.origin.map(|o| o == origin.uuid).unwrap_or(false)
&& fs.created > created)
{
fs.origin = None;
}
}
}
Err(err) => {
snap.uuid = snap_uuid;
Expand Down

0 comments on commit 38bc267

Please sign in to comment.