fs.mergeVolumes: Make a plan based on volumes size - #4999
Merged
Conversation
chrislusf
reviewed
Nov 13, 2023
| This would help clear half-full volumes and let vacuum system to delete them later. | ||
|
|
||
| fs.mergeVolumes -toVolumeId=y [-fromVolumeId=x] [-apply] /dir/ | ||
| fs.mergeVolumes [-toVolumeId=y] [-fromVolumeId=x] [-collection="*"] [-apply] [/dir/] |
Collaborator
There was a problem hiding this comment.
How about changing the directory into a named parameter also, in a separate PR?
Contributor
Author
There was a problem hiding this comment.
OK, after you merged this I'll send another PR. Is it okay with you?
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem are we solving?
I had 500 half-full volumes on my cluster, this means 15TB of wasted disk, It was hard and time-consuming to merge volumes individually.
How are we solving the problem?
So i wrote a function to create a map (named
plan) based on current status of volumes and decide how volumes must merge.This function respect replication policy, volume TTL, collection, read-only volumes and max volumes size limit.
Now it's possible to
-toVolumeId)-fromVolumeId)How is the PR tested?
I run this locally and on my cluster.