Issue Details (XML | Word | Printable)

Key: DIRSERVER-840
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Emmanuel Lecharny
Reporter: Emmanuel Lecharny
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Directory ApacheDS

Double modification on a modify ?

Created: 02/Feb/07 11:38 PM   Updated: 09/Oct/09 12:04 AM
Return to search
Component/s: None
Affects Version/s: 1.5.1
Fix Version/s: 2.0.0-RC1

Time Tracking:
Not Specified

Issue Links:
Duplicate
 

Resolution Date: 09/Oct/09 12:04 AM


 Description  « Hide
We have had a convo with alex about the OperationalService. I saw that when doing a modification on an entry, we first call the next interceptor (and this will modify the entry on the backend), then we add two new attributes (modifiers name and date) and store again the data into the backend. This does not seems to be very efficient, but we don't remember the reason why it's done like that ...

Here is the convo

elecharny in OperationalService
akarasulu yep
elecharny when doing a modify,
akarasulu ahha
elecharny you first call the next interceptor, then you update the nexus with the entry with
elecharny two new attributes
elecharny why don't you add the attrs into the entry and then call the netx interceptors ?
akarasulu hmmm I had some reason for this
elecharny this is a simple modify instead of two
akarasulu don't remember
akarasulu yeah yeah I see what you mean
akarasulu can't remember now
elecharny this seems to cost the double
akarasulu yes it does
akarasulu can you put this in JIRA
elecharny yeah
akarasulu just past this info
akarasulu from IRC

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Emmanuel Lecharny added a comment - 18/Aug/07 04:49 AM
This is still an existing problem.

Alex Karasulu added a comment - 18/Aug/07 06:54 AM
Fixed on commit revision 567238 here:

     http://svn.apache.org/viewvc?view=rev&rev=567238

I'm not going to bother backport this to 1.0 unless someone wants me to.

Emmanuel Lecharny added a comment - 03/Oct/07 11:59 PM
I reopen the issue, because the double modification _is_ necessary. The 'fix' had a very bad side effect, which was not exhibited because the way the operational attributes were added to the list of modified attributes was incorrect : the list was never modifed in fact...

Here is the reason why we need this double modification :
- the opAttr interceptor first call the schema interceptor
- the schema interceptor check for every modification, and if the modified attr is not modifable by user (and this is the case for modifiersName and modifyTimestamp), it generates an error
- as the opAttr interceptor was not correctly injecting those two attrs into the modification list, it worked well, except that we lost those modifications
- and at the end, the second modification was here to store those operational attribute directly into the nexus.

What was bad about this double modification (and still is) is that we cannot guarantee that the operation is atomic( we have 2 mods in a row for the same entry). Even from the perf perspective, it's far from being perect.
Now the problem is that we have no easy way to add the 2 opAttrs before calling the schema interceptor, because those attrs will be seen as invalid, and it will generate an error.

One possible solution would be to add a flag in the ModificationItem structure to signal an attribute which has been added by the server.


Emmanuel Lecharny added a comment - 04/Oct/07 11:48 AM
Still present in trunk...

Emmanuel Lecharny added a comment - 01/Apr/08 07:03 AM
We can't affect a bug to a released version ! Rescheduled to 1.5.2

Emmanuel Lecharny added a comment - 02/Apr/08 10:45 PM
Postponed.

Emmanuel Lecharny added a comment - 17/Sep/08 05:35 PM
I just wonder why an operationnal attribute is checked against the schema ??? This sounds like a nonsense, as Op attr are managed by the server itself, so they are just always valid !

Emmanuel Lecharny added a comment - 18/Sep/08 12:05 PM
modifiersName and modifyTimestamp Operational Attributes are NO-USER-MODIFICATION attributes, so they should not be ruled out by the schema interceptor.

Emmanuel Lecharny added a comment - 18/Sep/08 02:48 PM
The big issue we have is that the ChangeLog interceptor is trying to revert the modification, and this include modification of operational attributes which have been added in the second pass.

IMO, we should create a second class of attributes : those who have been added by the server, w<hich shoul dbypass the Schema Interceptor.

Emmanuel Lecharny added a comment - 27/Nov/08 01:24 AM
It falls into the 'Optimization' phase. Postponed to 1.5.9

Emmanuel Lecharny added a comment - 15/Aug/09 08:41 AM
Affected to 2.0.0-RC1, we won't release a 1.5.9

Emmanuel Lecharny added a comment - 09/Oct/09 12:04 AM
Fixed in schema refactoring branch, as a side fix.