https://bugs.openldap.org/show_bug.cgi?id=10411
Issue ID: 10411 Summary: Seems like importing data with slapadd does not create the structuralObjectClass OpAttr when -s flag is used Product: OpenLDAP Version: 2.6.10 Hardware: All OS: All Status: UNCONFIRMED Keywords: needs_review Severity: normal Priority: --- Component: client tools Assignee: bugs@openldap.org Reporter: elecharny@apache.org Target Milestone: ---
When exporting entries with a slapcat and removing all the opAttrs, keeping the bare entries with only user attributes, then importing them with slapadd creates entries without the structuralObjectClass attribute, when using the -s flag.
Which leads to en error 80 'No structuralObjectClass Operation Attribute' when trying to modify an injected entry.
(I'll check if this was the standard behaviour un 2.4/2/5=)
Two remarks: - the structuralObjectClass should be added no matter what, assuming it's correct (ie the objectclass hierarchy is sane) - and even if it's not created, there is no reason to get a error 80 when modifying the entry: the structuralObjectClass should be added when a modify operation is applied (all in all, it's an OpAttr, up to the server to deal with it).
Here is the added entry:
version: 1 dn: o=service,o=worteks objectClass: organization o: service description: One entry #structuralObjectClass: organization
When removing the -s flag, all works fine.
Note: the reason I was using the -s flag is that I wanted to squeeze as much performance as possible when injecting 30M entries. The gain may be minimal (like 4 s when injecting 10M entries - 1m9 vs 1m13) , but still.
https://bugs.openldap.org/show_bug.cgi?id=10411
--- Comment #1 from elecharny@apache.org --- Note: I would qualify it as minor, not normal.
https://bugs.openldap.org/show_bug.cgi?id=10411
Howard Chu hyc@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |minor Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED
--- Comment #2 from Howard Chu hyc@openldap.org --- The input to slapadd is supposed to be the unmodified output of slapcat. If you're deleting opattrs, then you should be feeding that in using ldapadd instead.
https://bugs.openldap.org/show_bug.cgi?id=10411
elecharny@apache.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |FIXED
--- Comment #3 from elecharny@apache.org --- I buy that. I was surprised that the other oppAttrs were created, but on a second thought I can understand that recreating the structuralObjetclass would potentially cost more than the gain of using the -s flag. Up to me to use a proper set of data, as you said, generated by slapcat.
You can close the ticket. Thanks for your insight, Howard!
https://bugs.openldap.org/show_bug.cgi?id=10411
Howard Chu hyc@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|FIXED |INVALID Keywords|needs_review |
--- Comment #4 from Howard Chu hyc@openldap.org --- (In reply to elecharny from comment #3)
I buy that. I was surprised that the other oppAttrs were created, but on a second thought I can understand that recreating the structuralObjetclass would potentially cost more than the gain of using the -s flag. Up to me to use a proper set of data, as you said, generated by slapcat.
You can close the ticket. Thanks for your insight, Howard!
In particular, the structuralObjectClass of an entry is computed during the schema checking, so we can't know what to set it to without schema checking.
https://bugs.openldap.org/show_bug.cgi?id=10411
--- Comment #5 from elecharny@apache.org --- Regardless of how slapadd works, I still think that when modifying an entry that does not have a structuralObjectClas opAttr should work: it's not really a problem to detect that the entry does not have this OpAttr, and to compute one on the fly while processing the Modify operation.
But that would be another bugzilla issue.