libelektra
libelektra copied to clipboard
mounting: avoid missing sync plugin
Currently, when you change /sw/kdb/current/plugins you might forget to add sync which will might lead to data loss on later crashes (no fsync() after writing to configuration file).
We could either warn when it is not added or always add it irrelevant to the content of /sw/kdb/current/plugins?
Additionally, sync plugin is not available for the default backend (at least when nothing was mounted to / or system/elektra/mountpoints).
sync is already recommended, so we should this bug in a more general: warn if recommended plugins are missing. Lets rethink this for the next milestone.
There is another issue that even if something already provides sync #1394, sync still gets added.
A very simple solution would be to always add recommended plugins. Then sync would get added, too.
A very simple solution would be to always add recommended plugins. Then sync would get added, too.
Does this mean that if some other plugin provides sync, then sync itself is not added?
Does this mean that if some other plugin provides sync, then sync itself is not added?
Yes, then we would not need sync to be part of /sw/elektra/kdb/#0/current/plugins, which always gets added. Recommendations are only added, if they were not fulfilled earlier.
I mark this issue stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping the issue by writing a message here or create a new issue with the remainder of this issue. Thank you for your contributions :sparkling_heart:
I closed this issue now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue. Thank you for your contributions :sparkling_heart:
@markus2330
Why don't we just call fsync() in resolver? I assume it is because, there could be further modifications in postcommit. But (at least in new-backend) it would be pretty easy to enforce that the resolver plugin is always called as the last postcommit plugin (where it could call fsync()).
The idea is that there are different ways of implementing sync (fdatasync) and the resolver is already complicated enough as is. But yes, I am not totally against implementing it in the resolver, as it would also optimize the number of syscalls (one open/close less). This is, however, totally OT here, the issue here is about something else. I hide these two comments.
@markus2330 making it the resolvers obligation to sync isn't really off topic. The resolver is already required (without one nothing works), so by moving the sync there, it couldn't be missing.
I mark this stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping by writing a message here or create a new issue with the remainder of this issue. Thank you for your contributions :sparkling_heart:
I closed this now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue. Thank you for your contributions :sparkling_heart: