libelektra icon indicating copy to clipboard operation
libelektra copied to clipboard

backend plugin

Open vLesk opened this issue 6 years ago • 5 comments

Building upon the implementation of elektraPluginCommit in #2798, I would like to reimplement the Backend structure as a plugin. That would bring the following benefits:

  • Greater detachment from the core of libelektra, as KDB would only need to call the respective plugin functions,
  • Nesting plugins would be possible as backends could contain further backends.

Another problem I would like to solve with this implementation is that backends have a limited fixed amount of plugins that they can contain.

To solve this, I propose restructuring the plugin arrays (getplugins, setplugins and errorplugins) to arrays of linked lists. That way, plugins assigned to a specific role are added to the end of the list at the position corresponding to the role, with the possibility of a flexible number of further plugins being added to that role.

Due to complexity issues with operations such as file resolving and change recognition, the following roles will still only contain a single slot in their respective arrays:

  • getresolver
  • getstorage
  • rollback
  • setresolver
  • setstorage
  • commit

Implementing backends as plugins has already been discussed in #973 and #1274.

vLesk avatar Sep 15 '19 13:09 vLesk

Thank you for the summary!

markus2330 avatar Sep 15 '19 18:09 markus2330

@vLesk What is the current status?

markus2330 avatar Aug 07 '20 13:08 markus2330

As far as I can see, the implementation should be done (the ensurePluginUnmounted function in kdb.c is commented in though as we discussed a few months ago, additional work would need to be done for that to be supported), I'm still working on fixing the bugs. I've made changes to mount.c and further changes to the backend-related .cpp files. I'm currently working full time but I have some days off I can use, and in September I'll be working reduced hours so it should be easier to work out the rest of the bugs.

vLesk avatar Aug 12 '20 20:08 vLesk

Thank you, it would be so great to get this finished. :sparkling_heart:

It is really one of the core features of Elektra and we constantly run into the too many plugin problem. The ensurePluginUnmounted is not a big deal, as discussed before. Maybe you can throw a not_implemented error there?

markus2330 avatar Aug 13 '20 14:08 markus2330

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:

stale[bot] avatar Jul 30 '22 22:07 stale[bot]