-
Notifications
You must be signed in to change notification settings - Fork 55
cache data in LVM device manager? #413
Comments
I repeat my reasoning here which I posted earlier in a PR
Node, Controller, and k8s (and possibly even more, some sidecars) are exchanging messages. |
I don't agree if it adds any extra complexity :), It's just one more data structure where we add/delete values to/from it. One can argue that it needs mutex locking but, all LVM calls are already synchronous.
No, I would see this more like a generic programming design, where a simple(inexpensive) data structure could solve than context switched exec call. |
I agree with your argument and this brings me a question of whether PMEM-CSI really needs any caching even in step 3? It can get all the needed information by querying its StateManager and/or DeviceManager. |
Amarnath Valluri <[email protected]> writes:
> Let's continue the discussion whether that caching is worth the extra complexity.
I don't agree, it adds any extra complexity :), It's just one more data structure where we add/delete values to/from it. One can argue that it needs mutex locking but, all LVM calls are already synchronous.
> Do we have data how expensive the LVM command invocation+parsing really is?
No, I would see this more like a generic programming design, where a
simple(inexpensive) data structure could solve than context switched
exec call.
If maintaining that data structure is simple, then why was there a bug
in the code? Code that doesn't exist can't have bugs. That's also a
design principle. For PMEM-CSI, correctness and robustness are more
important than performance.
|
The bug was not because of the complexity. Result of a human error in writing and reviewing code. |
Amarnath Valluri <[email protected]> writes:
> If maintaining that data structure is simple, then why was there a bug in the code?
The bug was not because of the complexity. Result of a human error in
writing and reviewing code.
That just proofs my point :-) Even if the code is simple, mistakes
happen and it is better to not have the code in the first place if it is
not absolutely needed.
Regarding robustness: what outside events could lead to the cached data
becoming stale, and how would PMEM-CSI recover from that?
|
None, The cache is updated only when calls(Create/Delete volume) initiated by Kubernetes/PMEM-CSI Node Controller. Changes happening to LVM volumes outside of driver context(say manually removing lvm volume) are not tracked by driver anyway. |
Amarnath Valluri <[email protected]> writes:
> what outside events could lead to the cached data becoming stale
None, The cache is updated only when calls(Create/Delete volume)
initiated by Kubernetes/PMEM-CSI Node Controller. Changes happening to
LVM volumes outside of driver context(say manually removing lvm
volume) are not tracked by driver anyway.
What happens if the admin manually does a `lvremove` for a volume that
he wants to get rid of quickly?
|
This is not the expected way to remove a volume by admin, he has to remove the appropriate PVC/PV. But anyway, in this case, our driver cache(not just LVM cache) still treats that the volume exists till we get a request from Kubernetes to delete that volume. |
Amarnath Valluri <[email protected]> writes:
> What happens if the admin manually does a `lvremove` for a volume that he wants to get rid of quickly?
This is not the expected way to remove a volume by admin, he has to
remove the appropriate PVC/PV.
I know and you know, but an admin might not care and this might even be
justified when the cluster is screwed and he needs to clean up. He might
first manually delete the volume and then delete the PVC.
But anyway, in this case, our driver
cache(not just LVM cache) still treats that the volume exists till we
get a request from Kubernetes to delete that volume.
And will that then work?
|
As per current code, DeleteVolume, in this case, fails at ClearDevice(). |
ironically, just after I started this "let's reduce bookkeeping entries", I see the need to add more of that. Nodeserver should register Published volumes so that it can check in repeated calls, was some attribute (like read-only) same. Currently we dont keep that information. To implement CSI spec better, we have to start recording those bits of information. BTW, while looking around in that code, I see there is already VolInfo designed in nodeServer struct, but we never store anything there, looks like this is not fully implemented by original idea. We try to read entry out of that struct, however, and always get empty which is correct, and we log empty value. |
Discussion on issue intel#413, raised a requirement that PMEM-CSI should handle the DeleteVolume() call for volumes that the underlined device already deleted manually by the admin. So for such a volume we just ignore and return no error in DeviceManager.DeleteVolume(). This also makes DeleteVolume() idempotent.
Discussion on issue intel#413, raised a requirement that PMEM-CSI should handle the DeleteVolume() call for volumes that the underlined device already deleted manually by the admin. So for such a volume we just ignore and return no error in DeviceManager.DeleteVolume(). This also makes DeleteVolume() idempotent.
Discussion on issue intel#413, raised a requirement that PMEM-CSI should handle the DeleteVolume() call for volumes that the underlined device already deleted manually by the admin. So for such a volume we just ignore and return no error in DeviceManager.DeleteVolume(). This also makes DeleteVolume() idempotent.
Discussion on issue intel#413, raised a requirement that PMEM-CSI should handle the DeleteVolume() call for volumes that the underlined device already deleted manually by the admin. So for such a volume we just ignore and return no error in DeviceManager.DeleteVolume(). This also makes DeleteVolume() idempotent.
Discussion on issue intel#413, raised a requirement that PMEM-CSI should handle the DeleteVolume() call for volumes that the underlined device already deleted manually by the admin. So for such a volume we just ignore and return no error in DeviceManager.DeleteVolume(). This also makes DeleteVolume() idempotent.
Discussion on issue intel#413, raised a requirement that PMEM-CSI should handle the DeleteVolume() call for volumes that the underlined device already deleted manually by the admin. So for such a volume we just ignore and return no error in DeviceManager.DeleteVolume(). This also makes DeleteVolume() idempotent.
Discussion on issue intel#413, raised a requirement that PMEM-CSI should handle the DeleteVolume() call for volumes that the underlined device already deleted manually by the admin. So for such a volume we just ignore and return no error in DeviceManager.DeleteVolume(). This also makes DeleteVolume() idempotent.
Discussion on issue intel#413, raised a requirement that PMEM-CSI should handle the DeleteVolume() call for volumes that the underlined device already deleted manually by the admin. So for such a volume we just ignore and return no error in DeviceManager.DeleteVolume(). This also makes DeleteVolume() idempotent.
Discussion on issue intel#413, raised a requirement that PMEM-CSI should handle the DeleteVolume() call for volumes that the underlined device already deleted manually by the admin. So for such a volume we just ignore and return no error in DeviceManager.DeleteVolume(). This also makes DeleteVolume() idempotent.
Discussion on issue intel#413, raised a requirement that PMEM-CSI should handle the DeleteVolume() call for volumes that the underlined device already deleted manually by the admin. So for such a volume we just ignore and return no error in DeviceManager.DeleteVolume(). This also makes DeleteVolume() idempotent.
Discussion on issue intel#413, raised a requirement that PMEM-CSI should handle the DeleteVolume() call for volumes that the underlined device already deleted manually by the admin. So for such a volume we just ignore and return no error in DeviceManager.DeleteVolume(). This also makes DeleteVolume() idempotent.
Discussion on issue intel#413, raised a requirement that PMEM-CSI should handle the DeleteVolume() call for volumes that the underlined device already deleted manually by the admin. So for such a volume we just ignore and return no error in DeviceManager.DeleteVolume(). This also makes DeleteVolume() idempotent.
Discussion on issue intel#413, raised a requirement that PMEM-CSI should handle the DeleteVolume() call for volumes that the underlined device already deleted manually by the admin. So for such a volume we just ignore and return no error in DeviceManager.DeleteVolume(). This also makes DeleteVolume() idempotent.
Discussion on issue intel#413, raised a requirement that PMEM-CSI should handle the DeleteVolume() call for volumes that the underlined device already deleted manually by the admin. So for such a volume we just ignore and return no error in DeviceManager.DeleteVolume(). This also makes DeleteVolume() idempotent.
Discussion on issue intel#413, raised a requirement that PMEM-CSI should handle the DeleteVolume() call for volumes that the underlined device already deleted manually by the admin. So for such a volume we just ignore and return no error in DeviceManager.DeleteVolume(). This also makes DeleteVolume() idempotent.
Discussion on issue intel#413, raised a requirement that PMEM-CSI should handle the DeleteVolume() call for volumes that the underlined device already deleted manually by the admin. So for such a volume we just ignore and return no error in DeviceManager.DeleteVolume(). This also makes DeleteVolume() idempotent.
Discussion on issue intel#413, raised a requirement that PMEM-CSI should handle the DeleteVolume() call for volumes that the underlined device already deleted manually by the admin. So for such a volume we just ignore and return no error in DeviceManager.DeleteVolume(). This also makes DeleteVolume() idempotent.
Discussion on issue intel#413, raised a requirement that PMEM-CSI should handle the DeleteVolume() call for volumes that the underlined device already deleted manually by the admin. So for such a volume we just ignore and return no error in DeviceManager.DeleteVolume(). This also makes DeleteVolume() idempotent.
Discussion on issue intel#413, raised a requirement that PMEM-CSI should handle the DeleteVolume() call for volumes that the underlined device already deleted manually by the admin. So for such a volume we just ignore and return no error in DeviceManager.DeleteVolume(). This also makes DeleteVolume() idempotent.
Discussion on issue intel#413, raised a requirement that PMEM-CSI should handle the DeleteVolume() call for volumes that the underlined device already deleted manually by the admin. So for such a volume we just ignore and return no error in DeviceManager.DeleteVolume(). This also makes DeleteVolume() idempotent.
Discussion on issue intel#413, raised a requirement that PMEM-CSI should handle the DeleteVolume() call for volumes that the underlined device already deleted manually by the admin. So for such a volume we just ignore and return no error in DeviceManager.DeleteVolume(). This also makes DeleteVolume() idempotent.
Discussion on issue intel#413, raised a requirement that PMEM-CSI should handle the DeleteVolume() call for volumes that the underlined device already deleted manually by the admin. So for such a volume we just ignore and return no error in DeviceManager.DeleteVolume(). This also makes DeleteVolume() idempotent.
Discussion on issue intel#413, raised a requirement that PMEM-CSI should handle the DeleteVolume() call for volumes that the underlined device already deleted manually by the admin. So for such a volume we just ignore and return no error in DeviceManager.DeleteVolume(). This also makes DeleteVolume() idempotent.
Discussion on issue intel#413, raised a requirement that PMEM-CSI should handle the DeleteVolume() call for volumes that the underlined device already deleted manually by the admin. So for such a volume we just ignore and return no error in DeviceManager.DeleteVolume(). This also makes DeleteVolume() idempotent.
In #408 (comment), @okartau pointed out that https://github.com/intel/pmem-csi/blob/e09d8dae00fcd126011c6bbe66951f90b35fec30/pkg/pmem-device-manager/pmd-lvm.go caches information about the LVM state on the node. @avalluri explained that this is to avoid expensive invocation of LVM commands and parsing of their output.
Let's continue the discussion whether that caching is worth the extra complexity. It already was the source of one bug (the one fixed by #408).
Do we have data how expensive the LVM command invocation+parsing really is?
The text was updated successfully, but these errors were encountered: