Skip to content

fs.mergeVolumes: Make a plan based on volumes size - #4999

Merged
chrislusf merged 2 commits into
seaweedfs:masterfrom
yeganemehr:automatic-volume-merge
Nov 13, 2023
Merged

fs.mergeVolumes: Make a plan based on volumes size#4999
chrislusf merged 2 commits into
seaweedfs:masterfrom
yeganemehr:automatic-volume-merge

Conversation

@yeganemehr

@yeganemehr yeganemehr commented Nov 13, 2023

Copy link
Copy Markdown
Contributor

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

  • Merge volumes of a single collection
  • Merge only with specified destination volume (-toVolumeId)
  • Merge only with specified source volume (-fromVolumeId)

How is the PR tested?

I run this locally and on my cluster.

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/]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about changing the directory into a named parameter also, in a separate PR?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, after you merged this I'll send another PR. Is it okay with you?

Comment thread weed/shell/command_fs_merge_volumes.go Outdated
@chrislusf
chrislusf merged commit d355647 into seaweedfs:master Nov 13, 2023
@yeganemehr
yeganemehr deleted the automatic-volume-merge branch November 13, 2023 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants