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

backend plugin #2963

Closed
vLesk opened this issue Sep 15, 2019 · 5 comments
Closed

backend plugin #2963

vLesk opened this issue Sep 15, 2019 · 5 comments
Assignees
Milestone

Comments

@vLesk
Copy link
Contributor

vLesk commented Sep 15, 2019

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 vLesk added this to the 1.0.0 milestone Sep 15, 2019
@vLesk vLesk self-assigned this Sep 15, 2019
@vLesk vLesk changed the title backend plugin backend plugin Sep 15, 2019
@markus2330
Copy link
Contributor

Thank you for the summary!

vLesk added a commit to vLesk/libelektra that referenced this issue Sep 16, 2019
vLesk added a commit to vLesk/libelektra that referenced this issue Sep 16, 2019
vLesk added a commit to vLesk/libelektra that referenced this issue Sep 16, 2019
vLesk added a commit to vLesk/libelektra that referenced this issue Sep 16, 2019
@vLesk vLesk mentioned this issue Sep 16, 2019
14 tasks
vLesk added a commit to vLesk/libelektra that referenced this issue Nov 4, 2019
vLesk added a commit to vLesk/libelektra that referenced this issue Nov 4, 2019
vLesk added a commit to vLesk/libelektra that referenced this issue Nov 19, 2019
vLesk added a commit to vLesk/libelektra that referenced this issue Nov 19, 2019
vLesk added a commit to vLesk/libelektra that referenced this issue Nov 26, 2019
vLesk added a commit to vLesk/libelektra that referenced this issue Nov 26, 2019
vLesk added a commit to vLesk/libelektra that referenced this issue Apr 10, 2020
vLesk added a commit to vLesk/libelektra that referenced this issue Apr 10, 2020
@markus2330
Copy link
Contributor

@vLesk What is the current status?

@vLesk
Copy link
Contributor Author

vLesk commented Aug 12, 2020

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.

@markus2330
Copy link
Contributor

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

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?

kodebach pushed a commit to vLesk/libelektra that referenced this issue Sep 5, 2020
kodebach pushed a commit to vLesk/libelektra that referenced this issue Sep 5, 2020
vLesk pushed a commit to vLesk/libelektra that referenced this issue Sep 11, 2020
This was referenced Sep 22, 2020
kodebach pushed a commit to kodebach/libelektra that referenced this issue Mar 6, 2021
Squashed version of:

	decisions: added decision for backend plugin

	Discussed in ElektraInitiative#2963

	backend: added basic files for backend plugin

	Discussed in ElektraInitiative#2963

	plugin: added the modules keyset to plugins

	The keyset has been added to the Plugin struct and elektraPluginOpen. Discussed in ElektraInitiative#2969.

	backend: implemented elektraBackendOpen

	Discussed in ElektraInitiative#2969.

	backend: implemented elektraBackendGet

	Discussed in ElektraInitiative#2969.

	documentation: updated documentation reflecting the changed mount point configuration

	Changed documents:
	- architecture.md
	- plugins-ordering.md
	- README.md in src/plugins

	Discussed in ElektraInitiative#2969.

	backend: made basic implementation of elektraBackendSet, elektraBackendCommit and elektraBackendError

	Discussed in ElektraInitiative#2969.

	backend: Added implications to decision for the backend plugin

	Discussed in ElektraInitiative#2969.

	documentation: Modified role names in plugins-ordering

	Discussed in ElektraInitiative#2969.

	kdbprivate: Added definitions of new plugin positions, still need to remove old ones

	Discussed in ElektraInitiative#2969.

	cpp tools: made basic modifications to conform with new backend plugin

	Still incomplete, the tests do not pass yet. Discussed in ElektraInitiative#2969.

	testtool_backend: modified tests to conform to new backend configuration

	Discussed in ElektraInitiative#2969.

	backend: modifications to clear compiler errors, moved plugin position definitions to kdbprivate

	Discussed in ElektraInitiative#2969.

	backend: modified plugin functions to be called once per plugin role

	Discussed in ElektraInitiative#2969.

	backend: changed function calls to match new api

	Revert "cpp tools: made basic modifications to conform with new backend plugin"

	This reverts commit 63a10fe.

	tools: modified libs/tools to be compatible with the new backend plugin

	Discussed in ElektraInitiative#2969.

	backend: changed back the names of the roles of a backend

	Discussed in ElektraInitiative#2969.

	backend: changed back the names of the roles in a backend

	Discussed in ElektraInitiative#2969.

	kdbprivate: modified functions and structs to support the backend plugin

	Discussed in ElektraInitiative#2969.

	version: implemented external version plugin to work with the backend plugin

	Related to ElektraInitiative#2969.

	missing: implemented external missing plugin for compatibility with backend plugin

	Related to ElektraInitiative#2969.

	backend.c: modified backend functions to conform with new backend plugin and removed unneeded functions

	Discussed in ElektraInitiative#2969.

	missing: reformatted code style

	version: reformatted code style

	backend: restyled code

	Related to ElektraInitiative#2969.

	tools: restyled code

	Related to ElektraInitiative#2969.

	backend: restyled code

	Related to ElektraInitiative#2969.

	backend: first modifications for compatibility with the backend plugin, more to come

	Discussed in ElektraInitiative#2969.

	mount: modifications for compatibility with the backend plugin

	Discussed in ElektraInitiative#2969.

	plugin.c: restyled code

	Related to ElektraInitiative#2969.

	split: modifications for compatibility with backend plugin

	Related to ElektraInitiative#2969.

	trie: modifications for compatibility with the backend plugin

	Discussed in ElektraInitiative#2969.

	plugin.c: removed unnecessary functions

	Discussed in ElektraInitiative#2969.

	split: moved keyset sizes from backend to split and modified backendUpdateSize

	Discussed in ElektraInitiative#2969.

	kdbEnsure: commented out the ensurePluginUnmounted function until it is made compatible with the backend plugin

	Discussed in ElektraInitiative#2969.

	kdb: modified kdb functions to use the backend plugin

	Discussed in ElektraInitiative#2969.

	tests.c: modified tests to support backend plugin and new split structure

	Discussed in ElektraInitiative#2969.

	backend: modified test_backend and moved it to the backend plugin

	Related to ElektraInitiative#2969.

	backend: partially implemented tests, commented out places in tests that did not work

	Discussed in ElektraInitiative#2969.

	backend: minor debugging changes

	Discussed in ElektraInitiative#2969.

	testmod_backend: finished tests

	Discussed in ElektraInitiative#2969.

	umount: modified tests to use new configuration

	Discussed in ElektraInitiative#2969

	backend: changed mount point of default backend

	Part of ElektraInitiative#2969

	backend: fixed bug in elektraBackendClose which called elektraPluginClose on the wrong plugin array

	testmod_backend: partially fixed memory leaks

	backend: finished fixing memory leaks

	Based on ElektraInitiative#2969

	backend: fix some memory problems

	backend: fixed wrong arguments when calling kdbGet

	Based on ElektraInitiative#2963

	backend: fixed bug where the wrong plugin was passed to plugin function calls

	reformatted code

	mount: added check not to call backendOpenModules for the backend plugin itself

	Based on ElektraInitiative#2969

	backend: Made kdbGet return ELEKTRA_PLUGIN_STATUS_SUCCESS in the resolver phase if there is no resolver

	Based on ElektraInitiative#2969

	backend, kdb: reformatted code

	Based on ElektraInitiative#2969

	cache: disable cache mount
kodebach pushed a commit to kodebach/libelektra that referenced this issue Oct 6, 2021
Squashed version of:

	decisions: added decision for backend plugin

	Discussed in ElektraInitiative#2963

	backend: added basic files for backend plugin

	Discussed in ElektraInitiative#2963

	plugin: added the modules keyset to plugins

	The keyset has been added to the Plugin struct and elektraPluginOpen. Discussed in ElektraInitiative#2969.

	backend: implemented elektraBackendOpen

	Discussed in ElektraInitiative#2969.

	backend: implemented elektraBackendGet

	Discussed in ElektraInitiative#2969.

	documentation: updated documentation reflecting the changed mount point configuration

	Changed documents:
	- architecture.md
	- plugins-ordering.md
	- README.md in src/plugins

	Discussed in ElektraInitiative#2969.

	backend: made basic implementation of elektraBackendSet, elektraBackendCommit and elektraBackendError

	Discussed in ElektraInitiative#2969.

	backend: Added implications to decision for the backend plugin

	Discussed in ElektraInitiative#2969.

	documentation: Modified role names in plugins-ordering

	Discussed in ElektraInitiative#2969.

	kdbprivate: Added definitions of new plugin positions, still need to remove old ones

	Discussed in ElektraInitiative#2969.

	cpp tools: made basic modifications to conform with new backend plugin

	Still incomplete, the tests do not pass yet. Discussed in ElektraInitiative#2969.

	testtool_backend: modified tests to conform to new backend configuration

	Discussed in ElektraInitiative#2969.

	backend: modifications to clear compiler errors, moved plugin position definitions to kdbprivate

	Discussed in ElektraInitiative#2969.

	backend: modified plugin functions to be called once per plugin role

	Discussed in ElektraInitiative#2969.

	backend: changed function calls to match new api

	Revert "cpp tools: made basic modifications to conform with new backend plugin"

	This reverts commit 63a10fe.

	tools: modified libs/tools to be compatible with the new backend plugin

	Discussed in ElektraInitiative#2969.

	backend: changed back the names of the roles of a backend

	Discussed in ElektraInitiative#2969.

	backend: changed back the names of the roles in a backend

	Discussed in ElektraInitiative#2969.

	kdbprivate: modified functions and structs to support the backend plugin

	Discussed in ElektraInitiative#2969.

	version: implemented external version plugin to work with the backend plugin

	Related to ElektraInitiative#2969.

	missing: implemented external missing plugin for compatibility with backend plugin

	Related to ElektraInitiative#2969.

	backend.c: modified backend functions to conform with new backend plugin and removed unneeded functions

	Discussed in ElektraInitiative#2969.

	missing: reformatted code style

	version: reformatted code style

	backend: restyled code

	Related to ElektraInitiative#2969.

	tools: restyled code

	Related to ElektraInitiative#2969.

	backend: restyled code

	Related to ElektraInitiative#2969.

	backend: first modifications for compatibility with the backend plugin, more to come

	Discussed in ElektraInitiative#2969.

	mount: modifications for compatibility with the backend plugin

	Discussed in ElektraInitiative#2969.

	plugin.c: restyled code

	Related to ElektraInitiative#2969.

	split: modifications for compatibility with backend plugin

	Related to ElektraInitiative#2969.

	trie: modifications for compatibility with the backend plugin

	Discussed in ElektraInitiative#2969.

	plugin.c: removed unnecessary functions

	Discussed in ElektraInitiative#2969.

	split: moved keyset sizes from backend to split and modified backendUpdateSize

	Discussed in ElektraInitiative#2969.

	kdbEnsure: commented out the ensurePluginUnmounted function until it is made compatible with the backend plugin

	Discussed in ElektraInitiative#2969.

	kdb: modified kdb functions to use the backend plugin

	Discussed in ElektraInitiative#2969.

	tests.c: modified tests to support backend plugin and new split structure

	Discussed in ElektraInitiative#2969.

	backend: modified test_backend and moved it to the backend plugin

	Related to ElektraInitiative#2969.

	backend: partially implemented tests, commented out places in tests that did not work

	Discussed in ElektraInitiative#2969.

	backend: minor debugging changes

	Discussed in ElektraInitiative#2969.

	testmod_backend: finished tests

	Discussed in ElektraInitiative#2969.

	umount: modified tests to use new configuration

	Discussed in ElektraInitiative#2969

	backend: changed mount point of default backend

	Part of ElektraInitiative#2969

	backend: fixed bug in elektraBackendClose which called elektraPluginClose on the wrong plugin array

	testmod_backend: partially fixed memory leaks

	backend: finished fixing memory leaks

	Based on ElektraInitiative#2969

	backend: fix some memory problems

	backend: fixed wrong arguments when calling kdbGet

	Based on ElektraInitiative#2963

	backend: fixed bug where the wrong plugin was passed to plugin function calls

	reformatted code

	mount: added check not to call backendOpenModules for the backend plugin itself

	Based on ElektraInitiative#2969

	backend: Made kdbGet return ELEKTRA_PLUGIN_STATUS_SUCCESS in the resolver phase if there is no resolver

	Based on ElektraInitiative#2969

	backend, kdb: reformatted code

	Based on ElektraInitiative#2969

	cache: disable cache mount
kodebach pushed a commit to kodebach/libelektra that referenced this issue Nov 8, 2021
Squashed version of:

	decisions: added decision for backend plugin

	Discussed in ElektraInitiative#2963

	backend: added basic files for backend plugin

	Discussed in ElektraInitiative#2963

	plugin: added the modules keyset to plugins

	The keyset has been added to the Plugin struct and elektraPluginOpen. Discussed in ElektraInitiative#2969.

	backend: implemented elektraBackendOpen

	Discussed in ElektraInitiative#2969.

	backend: implemented elektraBackendGet

	Discussed in ElektraInitiative#2969.

	documentation: updated documentation reflecting the changed mount point configuration

	Changed documents:
	- architecture.md
	- plugins-ordering.md
	- README.md in src/plugins

	Discussed in ElektraInitiative#2969.

	backend: made basic implementation of elektraBackendSet, elektraBackendCommit and elektraBackendError

	Discussed in ElektraInitiative#2969.

	backend: Added implications to decision for the backend plugin

	Discussed in ElektraInitiative#2969.

	documentation: Modified role names in plugins-ordering

	Discussed in ElektraInitiative#2969.

	kdbprivate: Added definitions of new plugin positions, still need to remove old ones

	Discussed in ElektraInitiative#2969.

	cpp tools: made basic modifications to conform with new backend plugin

	Still incomplete, the tests do not pass yet. Discussed in ElektraInitiative#2969.

	testtool_backend: modified tests to conform to new backend configuration

	Discussed in ElektraInitiative#2969.

	backend: modifications to clear compiler errors, moved plugin position definitions to kdbprivate

	Discussed in ElektraInitiative#2969.

	backend: modified plugin functions to be called once per plugin role

	Discussed in ElektraInitiative#2969.

	backend: changed function calls to match new api

	Revert "cpp tools: made basic modifications to conform with new backend plugin"

	This reverts commit 63a10fe.

	tools: modified libs/tools to be compatible with the new backend plugin

	Discussed in ElektraInitiative#2969.

	backend: changed back the names of the roles of a backend

	Discussed in ElektraInitiative#2969.

	backend: changed back the names of the roles in a backend

	Discussed in ElektraInitiative#2969.

	kdbprivate: modified functions and structs to support the backend plugin

	Discussed in ElektraInitiative#2969.

	version: implemented external version plugin to work with the backend plugin

	Related to ElektraInitiative#2969.

	missing: implemented external missing plugin for compatibility with backend plugin

	Related to ElektraInitiative#2969.

	backend.c: modified backend functions to conform with new backend plugin and removed unneeded functions

	Discussed in ElektraInitiative#2969.

	missing: reformatted code style

	version: reformatted code style

	backend: restyled code

	Related to ElektraInitiative#2969.

	tools: restyled code

	Related to ElektraInitiative#2969.

	backend: restyled code

	Related to ElektraInitiative#2969.

	backend: first modifications for compatibility with the backend plugin, more to come

	Discussed in ElektraInitiative#2969.

	mount: modifications for compatibility with the backend plugin

	Discussed in ElektraInitiative#2969.

	plugin.c: restyled code

	Related to ElektraInitiative#2969.

	split: modifications for compatibility with backend plugin

	Related to ElektraInitiative#2969.

	trie: modifications for compatibility with the backend plugin

	Discussed in ElektraInitiative#2969.

	plugin.c: removed unnecessary functions

	Discussed in ElektraInitiative#2969.

	split: moved keyset sizes from backend to split and modified backendUpdateSize

	Discussed in ElektraInitiative#2969.

	kdbEnsure: commented out the ensurePluginUnmounted function until it is made compatible with the backend plugin

	Discussed in ElektraInitiative#2969.

	kdb: modified kdb functions to use the backend plugin

	Discussed in ElektraInitiative#2969.

	tests.c: modified tests to support backend plugin and new split structure

	Discussed in ElektraInitiative#2969.

	backend: modified test_backend and moved it to the backend plugin

	Related to ElektraInitiative#2969.

	backend: partially implemented tests, commented out places in tests that did not work

	Discussed in ElektraInitiative#2969.

	backend: minor debugging changes

	Discussed in ElektraInitiative#2969.

	testmod_backend: finished tests

	Discussed in ElektraInitiative#2969.

	umount: modified tests to use new configuration

	Discussed in ElektraInitiative#2969

	backend: changed mount point of default backend

	Part of ElektraInitiative#2969

	backend: fixed bug in elektraBackendClose which called elektraPluginClose on the wrong plugin array

	testmod_backend: partially fixed memory leaks

	backend: finished fixing memory leaks

	Based on ElektraInitiative#2969

	backend: fix some memory problems

	backend: fixed wrong arguments when calling kdbGet

	Based on ElektraInitiative#2963

	backend: fixed bug where the wrong plugin was passed to plugin function calls

	reformatted code

	mount: added check not to call backendOpenModules for the backend plugin itself

	Based on ElektraInitiative#2969

	backend: Made kdbGet return ELEKTRA_PLUGIN_STATUS_SUCCESS in the resolver phase if there is no resolver

	Based on ElektraInitiative#2969

	backend, kdb: reformatted code

	Based on ElektraInitiative#2969

	cache: disable cache mount
@stale
Copy link

stale bot commented Jul 30, 2022

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 💖

@stale stale bot added the stale label Jul 30, 2022
@kodebach kodebach removed the stale label Jul 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants