-
Notifications
You must be signed in to change notification settings - Fork 123
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
WIP: spec fix #555
WIP: spec fix #555
Conversation
@markus2330 is this kind of approach to fix the problem with getting non-existing keys ok with you ? |
It seems like you try to solve an ordering issue in an unappropriate way. |
couldn't fine any other way to do it. |
98b1b60
to
fe294d0
Compare
@@ -693,6 +726,15 @@ int kdbGet (KDB * handle, KeySet * ks, Key * parentKey) | |||
|
|||
ksRewind (ks); | |||
|
|||
if (elektraGetDoUpdate2 (split, ks, parentKey) == -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the problem is: this is called too late, you cannot call doUpdate after postprocessing of the keysets.
What about following logic:
elektraGetDoUpdate
hook MIDDLEGETSTORAGE
elektraGetDoUpdate2
elektraSplitGet // postprocessing
...
hook POSTGETSTORAGE
and spec will be called in MIDDLEGETSTORAGE?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
elektraSplitMerge needs to be called before spec, and elektraSplitGet before elektraSplitMerge. So i guess i'd have to adjust elektraSplitGet but i'm not sure how to do the part with the syncbits
@markus2330 can you take a look at the currrent approach ? |
@@ -526,7 +527,39 @@ static int elektraGetDoUpdate (Split * split, Key * parentKey) | |||
return 0; | |||
} | |||
|
|||
static int elektraGetDoUpdate2 (Split * split, KeySet * ks, Key * parentKey) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not like the duplication of the code, can you add the NR_OF_PLUGINS as parameter?
elektraSplitMerge should be quite cheap, but better to benchmark it. Actually, having a more efficient ksAppend is in TODO. (You can take advantage of that keysets are sorted when giving them together.) If it is expensive we could avoid it to be done twice if no such hook exists? Doesn't it create a problem if a plugin removed some keys after position 6? (Because they would stay in the merged key set then).Don't you need to work on a duplicated keyset temporarily for the first elektraSplitMerge? |
But looks better now and less invasive, but there are still code duplication and formatting issues. Also the PR is too big, there are many unrelated parts here. |
c2a5d27
to
75c95b2
Compare
@markus2330 done. |
Thank you! |
crude hacked together code, just a possible approach