Skip to content
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

(feat): Refactor Resize Capabilities #14

Merged
merged 3 commits into from
May 24, 2024
Merged

Conversation

lasith-kg
Copy link
Collaborator

@lasith-kg lasith-kg commented May 24, 2024

This PR will create a v2. I am decommissioning resizeThreshold, renaming resizeFs to resize and converting the data type of lvmConsumption from int to uint64

FAQ

  • Why am I removing resizeThreshold?
    • While developing the resize capabilities for lvm2, I realised that hard-coding a sensible threshold amount was more scalable than creating a configurable threshold for each resize category
    • Imagine the chaos of having lvResizeThreshold, vgResizeThreshold and resizeThreshold!
    • In this PR, I set resizeThreshold to a default value of 99.999% Explanation
  • Why am I renaming resizeFs to resize?
    • We are now consuming resizeFs to determine whether a Physical Volume and Logical Volume needs to be resized.
    • These resources are not filesystems. I cannot write to a Logical Volume or Physical Volume as if it was an xfs file system
    • By renaming resizeFs to resize, I keep it concise and relevant to how it is being used throughout the application
  • Why did I change lvmConsumption from int to uint64?
    • lvmConsumption represents a percent value between 0 and 100
    • This will always be a positive value so lets ensure that the data type reflects this constraint
    • I cannot use uint16 or uint32 because they are not supported by the flags library
  • Why did I move the tolerances and threshold values from the layer to backend package?
    • During lvm development, I was reminded that the purpose of the layer was to act as the orchestrator
    • These threshold and tolerance values should be abstracted away from the layer
    • It is simpler to have the layer invoke a function like backend.ShouldResize(device) rather than backend.ShouldResize(device, threshold)
  • Why are we going up a major version?
    • Renaming an attribute: resizeFs to resize
    • Removing an attribute: resizeThreshold
    • Recent edition of LVM support to ebs-bootstrap

@lasith-kg lasith-kg changed the title (feat): Refactor Resize (feat): Refactor Resize Capabilities May 24, 2024
@lasith-kg lasith-kg merged commit 85c521d into main May 24, 2024
4 checks passed
@lasith-kg lasith-kg deleted the feature/resize-refactor branch May 24, 2024 03:59
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