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

pvmove wrong logic on corner case #119

Closed
socketpair opened this issue May 30, 2023 · 1 comment
Closed

pvmove wrong logic on corner case #119

socketpair opened this issue May 30, 2023 · 1 comment

Comments

@socketpair
Copy link

socketpair commented May 30, 2023

I have two PVs and one VG over them. First PV is empty (no allocated PE). The second is full (all PEs allocated, no free PEs).

pvmove /dev/first_pv exits with non-zero code saying No extents available for allocation.

It should check first if there is nothing to do. And only THEN check for extents available for allocation.

@zkabelac
Copy link

zkabelac commented Jun 5, 2023

So the returned status value cannot be qualified as bug and this is more a philosophical question and there is no clear definition in logic - i.e. many 'lvchange' command will give you an error if you try to change something into the state in which the LV already is.

Note - in the case it would first check 'extents' for moving - it gives this error message:
"No data to move for vg."

So in most cases 'lvm2' does report an error if the command could not be doing what it was asking to be doing - it does NOT usually try to 'sanitize' commands working with metadata and report 'success' if there is nothing to do.

We would likely need to introduce some new set of options, but it's usually not worth....
(Taking into account how many other existing script we would broke by checking some reported errors)

@zkabelac zkabelac closed this as completed Jun 5, 2023
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

No branches or pull requests

2 participants