-
Notifications
You must be signed in to change notification settings - Fork 123
[decision]: Changetracking (round 2) #4714
[decision]: Changetracking (round 2) #4714
Conversation
I've mainly updated some alternatives with regards to full copy-on-write within Elektra. One more thing that we need to discuss, is what we do with false positives - i.e. keys that are detected as changed even though practically they aren't. This can (and will) happen with plugins that do transformation of the key values. As of now, I've added to the assumptions that false positives may be okay. We might be able to provide some advanced API that plugins can use to filter out false positives. |
Please elaborate (ideally within the decision, maybe in notes). If I change a value and then back it is obviously not the same reference (needs more memory) but a string-comparison still shows it is unchanged. Doesn't the comparison avoid any false positives? |
@markus2330 It is elaborated in the decision, under "Assumptions". It has nothing to do on how we compare values, but that plugins may change the values before writing to disk. |
Thx, I see! Couldn't this problem solved as well if we require users to call |
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.
Good to see progress here!
I don't see how this would solve anything. The big problem is that something other than the user can change the values. This means that plugins using the change tracking API after the transformation step (e.g. notifications plugins and in particular the record plugin) will potentially get other change tracking results than plugins before the step. From my POV, the "truest" change tracking results could be determined by:
This way, we would only detect if something truly changed. But this also means change tracking would be useless for all plugins other than notification hooks and the record hook. Those are the only plugins that are executed AFTER everything is done. |
That goes in the direction of what I suggested in #3497 a long time ago. But doing such a split on the I actually think, the "true" diff would be calculated between what is returned by
I don't quite understand that statement. I'd assume the diff is calculated once in We could of course also provide an API for calculating diffs (should be a separate library though). But that API should IMO take 2 |
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 agree with markus2330 that we should assume transformations are done correctly (whatever that may mean) in this decision. At least for now. If we find that there is no correct way to do them, then we may need to revisit this.
However, I also think false positives for values are not an issue at all. False negatives would be a much bigger issue, because that means we miss changes. If there is a use case where false positives must be avoided, we can just do a kind of re-check.
The change tracking plugin should have access to the current data. It can just check if the diff matches the current data and if not update the diff.
That said, I also believe that in your example the user using red
(or in my example false
) can simply be called incorrect. Then the reason for the false positive is simply that the user made an incorrect change. I say "incorrect", because the user should use the format returned by kdbGet
. So if RED
is returned then they should use RED
and not red
. In fact, you could even argue that the plugin that does the uppercasing should raise an error during kdbSet
, if it sees a non-uppercase value.
cdf6fde
to
f070535
Compare
9b0e0fd
to
7070385
Compare
7070385
to
20d647d
Compare
Co-authored-by: Markus Raab <markus2330@users.noreply.github.com>
Co-authored-by: Klemens Böswirth <23529132+kodebach@users.noreply.github.com>
Co-authored-by: Klemens Böswirth <23529132+kodebach@users.noreply.github.com>
20d647d
to
c760eb6
Compare
Please rerequest the review when I should have a look. |
I took the liberty and restructured this decision a bit. I have found that there are 3 largely independent things that we need to decide on here:
|
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.
LGTM, but if you think the three parts are independent, it might make sense to split them into 3 decision files as well.
I'm not 100% sure it makes sense, since they are still quite related and share constraints, assumptions and most of the problem. But it may be easier to move forward, if we can decide the parts independently.
Well, I don't think they are 100% independent. What I mean is that those are 3 areas we need to decide on, but it's still a single decision. Otherwise, I would have to repeat some stuff in each alternative (e.g., if the implementation is in a plugin, then it could still be possible to use I just want to present some alternatives for each area, and then we pick the most suitable ones from each. |
Co-authored-by: Klemens Böswirth <23529132+kodebach@users.noreply.github.com>
jenkins build libelektra please |
@markus2330 could you please look over the decision? |
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.
Definitely looks fine for in_discussion. Before it can be in solutions_clear please add how a plugin would provide "Solutions - Query".
@markus2330 I have added an entry as to how the query mechanism could be implemented in a plugin. Do note, however, that I actually intended to only have the API within a library (i.e. |
I think we can merge this but there are build errors. |
The build error is a timeout in |
jenkins build libelektra please |
@markus2330 @kodebach CI is green, we can merge now. |
Basics
(added as entry in
doc/news/_preparation_next_release.md
whichcontains
_(my name)_
)Please always add something to the release notes.
(first line should have
module: short statement
syntax)close #X
, are in the commit messages.doc/news/_preparation_next_release.md
scripts/dev/reformat-all
Checklist
(not in the PR description)
Review
Labels