[OPENDJ-3865] Missing upgrade task to update "config/MakeLDIF/*" files Created: 14/Mar/17  Updated: 08/Nov/19  Resolved: 15/Mar/17

Status: Done
Project: OpenDJ
Component/s: upgrade
Affects Version/s: 4.0.0
Fix Version/s: 4.0.0

Type: Bug Priority: Critical
Reporter: Christophe Sovant Assignee: Gaetan Boismal [X] (Inactive)
Resolution: Fixed Votes: 0
Labels: Verified

QA Assignee: Christophe Sovant

 Description   

After an upgrade to 4.0.0 the files under config/MakeLDIF folder and not updated.

Scenario

  • install a server 3.5
  • upgrade it to 4.0.0
  • run makeldif tool (4.0.0 version) using the default example.template (the one available under "config/MakeLDIF" which is 3.5.0 version)
    => this will generate entries like that (the entries are not valid due to missing objectclass)
    dn: dc=example,dc=com
    dc: example
    
    dn: ou=People,dc=example,dc=com
    ou: People
    
    dn: uid=user.0,ou=People,dc=example,dc=com
    objectClass: top
    objectClass: person
    objectClass: organizationalPerson
    objectClass: inetOrgPerson
    givenName: Aaccf
    sn: Amar
    cn: Aaccf Amar
    ...
    
  • now makeldif tool (4.0.0 version) using the default example.template (the one available under "template/config/MakeLDIF" which is 4.0.0 version)
    => this will generate entries like that
    dn: dc=example,dc=com
    dc: example
    objectClass: top
    objectClass: domain
    
    dn: ou=People,dc=example,dc=com
    ou: People
    objectClass: top
    objectClass: organizationalUnit
    
    dn: uid=user.0,ou=People,dc=example,dc=com
    objectClass: top
    objectClass: person
    objectClass: organizationalPerson
    objectClass: inetOrgPerson
    givenName: Aaccf
    sn: Amar
    cn: Aaccf Amar
    ...
    

We should copy all the file available under "template/config/MakeLDIF"" during upgrade process



 Comments   
Comment by Ludovic Poitou [ 14/Mar/17 ]

I'm not sure I agree with this.
Upgrade should not overwrite data that may have been customised by customers. I usually hack the config/MakeLDIF/example.template to match the amount of users I want. I would be annoyed if it got rewritten after an upgrade.

Comment by Gaetan Boismal [X] (Inactive) [ 14/Mar/17 ]

I did not thought about that Ludovic Poitou, that's a good point. On the other hand, it would also be a pain for a user to have the makeldif tool generating invalid LDIF out of the box.
We discussed with Christophe Sovant and Jean-Noël Rouvignac and it seems that we have three options to fix the issue:

  • Compute a fingerprint of the old example.template (assuming it has not changed since the older version from which the upgrade is supported), embed it in the source code and use it to see if the template has been modified by the user. If not we can override it.
  • Copy and *rename* the new template/config/MakeLDIF/example.template to config/MakeLDIF/example_4.0.0.template
  • Do nothing and specify in the release note that the new template should be used and why

Ludovic PoitouMatthew Swift WDYT?

Comment by Matthew Swift [ 14/Mar/17 ]

I'm inclined to agree with Ludo, but for slightly different reasons.

We're talking about upgrade here. Why would anyone want to use makeldif sample template on an upgraded instance? This template is generally used when evaluating the software, which rarely going to be upgraded, and certainly not in production systems. In other words, the sample template is used during evaluation, and upgrade is performed in production: the two use cases don't align.

A bigger concern is that the makeldif template format has changed, which may impact users with custom templates, e.g. for load testing. Therefore, we may want to document the API change and mention it in the release notes. WDYT Ludovic Poitou ? If you agree I'll add the release notes label.

Comment by Mark Craig [ 14/Mar/17 ]

Matthew Swift, the following change is covered in the compatibility chapter of the release notes, https://qa-backstage.forgerock.com/docs/ds/5/release-notes#chap-compatibility :

"
When specifying a branch in makeldif templates, you must now also specify the object classes for the branch. For example, suppose a template creates an organizational unit branch as follows:

branch: ou=People,[suffix]

You now create the organization unit branch as follows:

branch: ou=People,[suffix]
objectClass: top
objectClass: organizationalUnit

For details on writing makeldif templates, see makeldif.template.
"

Comment by Matthew Swift [ 14/Mar/17 ]

Ah, thanks Mark. You're several steps ahead as usual!

Comment by Gaetan Boismal [X] (Inactive) [ 14/Mar/17 ]

Thanks Matt and Mark! I was too focused on the fact that makeldif wouldn't work out of the box with sample template but I forgot it's only in an upgrade use case. Your comment makes sense to me Matt. So it looks like we should close this issue as "won't fix" or "not a defect" and we do no have much more to do then since the release note is already ok.

Comment by Christophe Sovant [ 15/Mar/17 ]

Ok to not update the "example.template" as this is already documented in the compatibility chapter.

But this issue is still valid for the following files under "template/config/MakeLDIF":

  • addrate.template
  • people_and_groups.template
    These files are new in 4.0.0 so no risk to overwrite data from customers and from my point of view should be copy during upgrade process.
Comment by Mark Craig [ 15/Mar/17 ]

Workaround: manually copy the files to the new instance?

If that is acceptable, perhaps adding a release-notes label to this is enough for the short term.

Comment by Christophe Sovant [ 22/Mar/17 ]

Verified using OpenDJ 4.0.0 RC5 (rev cb1324cb486b0367f91f1bb88f6cc55512aa46a8)

Generated at Mon Nov 23 16:37:03 UTC 2020 using Jira 7.13.12#713012-sha1:6e07c38070d5191bbf7353952ed38f111754533a.