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

Hot Reloading lvmd.conf #785

Closed
jakobmoellerdev opened this issue Nov 20, 2023 · 8 comments
Closed

Hot Reloading lvmd.conf #785

jakobmoellerdev opened this issue Nov 20, 2023 · 8 comments
Assignees
Labels

Comments

@jakobmoellerdev
Copy link
Contributor

What should the feature do:

Currently, topolvm-node reads out lvmd.conf file into a global variable on startup based on a command-line flag. In our tests we already bind the file to a config map instead. However, any changes to the config maps or the file after topolvm-node has been started don't get respected until a restart. It would be great to include a "hot-reload" functionality into lvmd.conf that is able to take care of reloading topolvm-node when the content changes.

Ways to solve this:

  1. Introduce a file hot reloading mechanism and a simple interface to always get the latest result when using it in topolvm-node
  2. Restart topolvm-node automatically when changes have been detected.

What is use case behind this feature:
Use case is that we have changing lvmd config entries after initial configuration and startup time. We can call it a part of normal "day-2-operations" in topolvm.

We are happy to provide a solution if the use case is accepted.

@llamerada-jp
Copy link
Contributor

Thank you for your post.

I suggest you to use Reloader. It is often referred to in similar posts such as the following.

This product is generic and will help if you are having similar problems with other products.

@jakobmoellerdev
Copy link
Contributor Author

To be honest, I am not sure why we should do a restart of topolvm for this case. It is a global variable that we can simply update on-demand without issues, and avoid a restart completely.

@llamerada-jp
Copy link
Contributor

llamerada-jp commented Nov 22, 2023

lvmd.yaml is not global. It intends to configure settings on a per-node basis. For example, when using groups of nodes with different specs, we intended to have a different lvmd.yaml. It was difficult to write such settings in Helm, which may have been misleading you.
And, we expected that lvmd.yaml would not need to be changed unless the hardware of the individual node or device class was changed. Therefore, we had not considered the hot-reload necessary.

@jakobmoellerdev
Copy link
Contributor Author

lvmd.yaml is not global. It intends to configure settings on a per-node basis. For example, when using groups of nodes with different specs, we intended to have a different lvmd.yaml.

I think that this is not a common use case because the bug with the default device class missing and causing configuration failures for different nodes was only discovered a few days ago.

It was difficult to write such settings in Helm, which may have been misleading you. And, we expected that lvmd.yaml would not need to be changed unless the hardware of the individual node or device class was changed. Therefore, we had not considered the hot-reload necessary.

I understand. However, even if a volume group gets changed we would need to restart topolvm-node and thus have downtime which we would like to avoid. The tool you suggested just automates the restart, which is not something we want / need.

If you want, we can hide this functionality behind a feature flag if required.

@toshipp
Copy link
Contributor

toshipp commented Nov 22, 2023

I don't understand why you're worried about downtime. When we update the image, the pods are restarted, so the downtime is unavoidable.
I think reading lvmd.conf at boot time is better to keep the implementation clean and simple.

@jakobmoellerdev
Copy link
Contributor Author

I don't understand why you're worried about downtime. When we update the image, the pods are restarted, so the downtime is unavoidable. I think reading lvmd.conf at boot time is better to keep the implementation clean and simple.

A downtime during an upgrade is unavoidable, yes. But that is part of regular maintenance of normal SRE maintenance windows in any operational cluster right? I am talking about changes of configurations.

Either way, this is not a major issue for us. We will integrate it in lvm-operator and trigger a restart from there based on a file-watch. It does not complicate our logic so its okay not to have in upstream for us and we're not pushing for it.

I still think there is room for improvement here. How do you protect users from expecting that the correct configuration is used when topolvm-node is not restarted?

@llamerada-jp
Copy link
Contributor

A downtime during an upgrade is unavoidable, yes. But that is part of regular maintenance of normal SRE maintenance windows in any operational cluster right? I am talking about changes of configurations.

It's not so often to change configurations for most users. So, I guess it's acceptable to wait for downtime during pod restart to read topolvm.conf.

Either way, this is not a major issue for us. We will integrate it in lvm-operator and trigger a restart from there based on a file-watch. It does not complicate our logic so its okay not to have in upstream for us and we're not pushing for it.

Thanks, I'm glad if you do so.

I still think there is room for improvement here. How do you protect users from expecting that the correct configuration is used when topolvm-node is not restarted?

It can also be said for all applications which don't support the hot-reload of configuration files.

It might be nice to write this behavior in the document. For instance, Rook does so.

https://github.com/rook/rook/blob/master/Documentation/Storage-Configuration/Advanced/ceph-configuration.md#custom-cephconf-settings

If you add the settings to the ConfigMap after the cluster has been initialized, each daemon will need to be restarted where you want the settings applied:

@jakobmoellerdev
Copy link
Contributor Author

Closing as per discussion above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

3 participants