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

cachefilter plugin update #1078

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@Namoshek
Contributor

Namoshek commented Nov 11, 2016

Purpose

Show problems with cachefilter plugin.

Test Case

$> kdb mount users.dump dir/users dump
$> kdb mount configs.dump dir/configs dump
$> kdb global-mount cachefilter

$> kdb shell
> kdbGet dir/users
return value: 0
> kdbGet dir/configs
return value: 0
> ksOutput
> keySetName dir/users/Namoshek
> keySetString password
> ksAppendKey 
> ksOutput
dir/users/Namoshek string: password
> kdbSet dir/users/Namoshek
return value: 1
> ksOutput
dir/users/Namoshek string: password
> ksCut dir/users
> ksOutput
> keySetName dir/configs/some/test/config/path
> keySetString some-conf-value
> ksAppendKey
> ksOutput
dir/configs/some/test/config/path string: some-conf-value
> kdbSet dir/configs/some/test/config/path
return value: 1
> ksCut dir/configs
> ksOutput
> kdbGet dir/users
return value: 0
> ksOutput
dir/users/Namoshek string: password
> ksCut dir/users
> kdbGet dir/configs
return value: 0
> ksOutput
dir/configs/some/test/config/path string: some-conf-value
> ksCut dir/configs
> ksOutput

$> kdb ls dir
dir/configs/some/test/config/path
dir/users/Namoshek
1 Warning was issued:
 Warning number: 79
	Description: Postcondition of backend was violated
	Ingroup: kdb
	Module: 
	At: /home/marvin/Schreibtisch/libelektra-improvements/src/libs/elektra/split.c:501
	Reason: drop key dir/users/Namoshek not belonging to "dir/users" with name "dir/users" but instead to "dir/configs" with name "dir/configs" because it is hidden by other mountpoint
	Mountpoint: dir
	Configfile: /home/marvin/Schreibtisch/libelektra-improvements/build/.dir/users.dump

The test case basically reflects what my REST service is doing, with the difference that successive kdbGet calls do not return anything in the latter (probably because the plugin is not called... for whatever reason).

As you can see above, keys are also written to the wrong mountpoint when the whole cache is appended during kdbSet. I also noticed that my global plugin list gets always reset when working with mount commands (maybe a side-effect of my plugin?).

@markus2330

This comment has been minimized.

Contributor

markus2330 commented Nov 11, 2016

POSTGETSTORAGE has weird semantics: @tom-wa what was the idea here?. They are executed for in line 600 for only one backend (but similar to foreach semantics), thus keys are injected in wrong backends. But in other places (error condition) it has deinit semantics. This mixture makes it unusable.

For this PR you could remove the line 600, and fix the hook for your needs. This would also be valuable input for @mpranj which requirements the hook positions have.

@markus2330 markus2330 added this to the 0.8.20 milestone Nov 23, 2016

@markus2330

This comment has been minimized.

Contributor

markus2330 commented Dec 9, 2016

I pushed this together with #874 in the new branch cachefilter. The testcase above should work, but their are issues with #874

@markus2330 markus2330 removed this from the 0.8.20 milestone Oct 13, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment