-
Notifications
You must be signed in to change notification settings - Fork 122
cachefilter plugin needs improvements #1072
Comments
I'm testing my implementation with my REST service. The problem I face is that I'm using two basic mountpoints, namely ExampleKeys in use
On start of servicethe two mountpoints
are read with During run-time
is successfully fetched (+ updated) and merged with the cache during |
I somehow have the feeling the plugin doesn't get called at all for successive |
I am afraid that more informal descriptions do not really bring us further. It looks good what you write, but it is vague. The next step are test cases which describe the desired behavior.
I do not so a reason why you cannot be agnostic to the actual mountpoints. Did something not work with one cache and always adding all keys?
It should be safe to add more keys in unrelated backends (see splitBuildup: backends outside of parentKey are not in Split and thus irrelevant for further logic).
Cannot reproduce, please open a separate issue for this with commands/test case to reproduce it. I tried:
Yes, postgetstorage is only called if kdbGet() has something to do. You need postgetstorage/deinit (which should be always called). @mpranj Is postgetstorage/deinit already available in your repo? Can you create a PR? The problem is in src/libs/elektra/kdb.c line 760: If no update is needed, kdbGet immediately exits without calling POSTGETSTORAGE/POSTGETCLEANUP hooks.
|
Obivously nothing works because of the wrong placement, but as I had this idea pretty late I tried a lot of things that did not work before already. But I guess using one cache should work if I use following strategy:
Forget about it; has also to do with the not correctly working cache.
That would be great, yes. |
I tried it with your suggestion in kdb.c, but it doesn't seem to work either. The cachefilter plugin is listed below |
With this information it is hard to tell what the cause is, can you open an PR demonstrating the issue? It might be:
Did you try to run with logger/debugger? |
Yes, I tried everything mentioned above as far as I can tell. I can create a demo PR tomorrow.
Can't be the case actually as I've never changed it and it is already part of the master branch. |
I could create a PR with postgetstorage/deinit, yes. |
Will you make a PR in near future @mpranj or shall I try to change the hooks for my purpose on my own? Personally I don't really need the change, but it would improve performance and I could probably get rid of my own cache implementation. But this change can be done later as well. |
I'm still writing a test plugin to ensure that it works properly. If you're in a hurry, I could make a PR without the tests. |
I don't know what exactly you want to test, but maybe my plugin could be (partially) used for tests as well? |
Closed due to removal of cachefilter plugin |
As discussed in #829, the cachefilter plugin needs some changes.
Expected Behavior
The cachefilter plugin should always ensure that:
kdbGet()
calls deliver what the user expects (i.e. the keys for theparentKey
), no matter how often and on whatkdbGet()
was called before.kdbSet()
adds all cached keys to the keyset before allowing the backends to write them, so that no keys get lost.@markus2330 is this also how you would think it should work?
Questions
kdbGet()
calls that fetch keys from multiple mountpoints? Use one cache or multiple (how to know what to put where)?E.g. mountpoints
dir/test/mp1
anddir/test/mp2
and two successive callskdbGet(ks1, "dir/test/mp1/something")
andkdbGet(ks2, "dir/test/mp2/something")
.kdbSet()
if keys of two mountpoints have been requested before?Ad. previous example: The cache will at this point contain all keys of the mountpoints that are not in the
/something
directory. When usingkdbSet(ks1, "dir/test/mp1/something")
, do we also need to (or even may) add the keys ofdir/test/mp2
to the keyset (without breaking anything)?kdbGet()
, successivekdbGet()
calls on the same or child-keys won't return anything.kdbGet()
calls so far received from kdb, updating the cache is not possible inkdbSet()
without knowning what previouskdbGet()
calls returned and to what of those calls thekdbSet()
call belongs to.The text was updated successfully, but these errors were encountered: