How does the index of a deleted snapshot (e.g. oldest, next oldest) affect coalescing performance? #8244
Replies: 4 comments
-
Hello @egyptianbman. When I originally read your analysis, it sounded correct. Thanks to @PhanLe1010 (who I discussed it with) for clueing me in to the following! When Longhorn purges snapshots after a snapshot deletion, the following steps are triggered:
So, to make a long story short, even though the oldest snapshot file appears to be removed in favor of the next oldest snapshot file, data is actually copied in reverse (from the newer snapshot file to the older one). Then, some file system metadata operations take place to make things look "right". I would not expect the feature you are requesting to speed up this process. If you have the following snapshots:
Both of these operations are virtually identical from a Longhorn perspective:
Please chime in to keep me honest if I've said something incorrect @PhanLe1010 and @longhorn/dev-data-plane! |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for such a thorough response! Are the snapshots always growing since longhorn is essentially merging oldest-1 into oldest? Is oldest then actually always the delta from the first snapshot to the oldest-1? |
Beta Was this translation helpful? Give feedback.
-
Each snapshot has a maximum size that is the nominal size of the volume. If In the "worst" case, coalescing does not reduce the actual size, because
I'm not sure I follow.
In some since, |
Beta Was this translation helpful? Give feedback.
-
I have converted this to a discussion for now. Please feel free to open a new feature request if you feed we need one after we wrap the discussion up! |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe (👍 if you like this request)
Problem statement: I have nightly snapshots configured for various volumes and have noticed a considerable IO increase when they run, due to deletion of the oldest image (configured to retain 5).
Describe the solution you'd like
I think there might be a considerable improvement in performance if snapshots deleted the n-1 oldest image, instead of the oldest. If my understanding of how snapshots work is accurate, this means only the delta from the oldest to n-1 would be deleted which could be a considerable difference if the volume is large (i.e. 1tb with ~5g delta).
Describe alternatives you've considered
I considered creating my own cron job that queries the api to accomplish this, but haven't gotten around to it yet.
Additional context
N/A
Beta Was this translation helpful? Give feedback.
All reactions