#2942 when updaing IPA, updater tasks may get conflicting names and update will fail
Closed: Fixed None Opened 11 years ago by abbra.

When generating update tasks, IPA uses current time rounded to the second and a random number. Unfortunately, in virtual machines randomness is scarce and rounding time to the second may often produce resulting task number which was already used before:

2012-07-24T08:53:42Z INFO Creating task to index attribute: memberOf
2012-07-24T08:53:42Z DEBUG Task id: cn=indextask_1343129352, cn=index, cn=tasks, cn=config
2012-07-24T08:53:43Z INFO Indexing finished
2012-07-24T08:53:43Z INFO Updating existing entry: cn=memberHost,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config
2012-07-24T08:53:43Z DEBUG ---------------------------------------------
2012-07-24T08:53:43Z DEBUG dn: cn=memberHost,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config
2012-07-24T08:53:43Z DEBUG objectclass: 
2012-07-24T08:53:43Z DEBUG      top
2012-07-24T08:53:43Z DEBUG      nsIndex
2012-07-24T08:53:43Z DEBUG nsindextype: eq
2012-07-24T08:53:43Z DEBUG cn: memberHost
2012-07-24T08:53:43Z DEBUG nssystemindex: false
2012-07-24T08:53:43Z DEBUG ---------------------------------------------
2012-07-24T08:53:43Z DEBUG Final value
2012-07-24T08:53:43Z DEBUG dn: cn=memberHost,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config
2012-07-24T08:53:43Z DEBUG objectclass: 
2012-07-24T08:53:43Z DEBUG      top
2012-07-24T08:53:43Z DEBUG      nsIndex
2012-07-24T08:53:43Z DEBUG nsindextype: eq
2012-07-24T08:53:43Z DEBUG cn: memberHost
2012-07-24T08:53:43Z DEBUG nssystemindex: false
2012-07-24T08:53:43Z DEBUG []
2012-07-24T08:53:43Z DEBUG Live 1, updated 0
2012-07-24T08:53:43Z INFO Done
2012-07-24T08:53:48Z INFO Creating task to index attribute: memberHost
2012-07-24T08:53:48Z DEBUG Task id: cn=indextask_1343129352, cn=index, cn=tasks, cn=config
2012-07-24T08:53:48Z ERROR Upgrade failed with This entry already exists

Attached is the patch that solves the problem by building a SHA1 hash out of non-rounded time and attribute name:

2012-07-24T09:34:22Z INFO Creating task to index attribute: memberOf
2012-07-24T09:34:22Z DEBUG Task id: cn=indextask_71b935e50f59419d997d1ec51b59d94be958bd8b,cn=index,cn=tasks,cn=config
2012-07-24T09:34:23Z INFO Indexing finished
2012-07-24T09:34:23Z INFO Updating existing entry: cn=memberHost,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config
2012-07-24T09:34:23Z DEBUG ---------------------------------------------
2012-07-24T09:34:23Z DEBUG dn: cn=memberHost,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config
2012-07-24T09:34:23Z DEBUG objectclass: 
2012-07-24T09:34:23Z DEBUG      top
2012-07-24T09:34:23Z DEBUG      nsIndex
2012-07-24T09:34:23Z DEBUG nsindextype: eq
2012-07-24T09:34:23Z DEBUG cn: memberHost
2012-07-24T09:34:23Z DEBUG nssystemindex: false
2012-07-24T09:34:23Z DEBUG ---------------------------------------------
2012-07-24T09:34:23Z DEBUG Final value
2012-07-24T09:34:23Z DEBUG dn: cn=memberHost,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config
2012-07-24T09:34:23Z DEBUG objectclass: 
2012-07-24T09:34:23Z DEBUG      top
2012-07-24T09:34:23Z DEBUG      nsIndex
2012-07-24T09:34:23Z DEBUG nsindextype: eq
2012-07-24T09:34:23Z DEBUG cn: memberHost
2012-07-24T09:34:23Z DEBUG nssystemindex: false
2012-07-24T09:34:23Z DEBUG []
2012-07-24T09:34:23Z DEBUG Live 1, updated 0
2012-07-24T09:34:23Z INFO Done
2012-07-24T09:34:28Z INFO Creating task to index attribute: memberHost
2012-07-24T09:34:28Z DEBUG Task id: cn=indextask_8641d5d7243b122057102811455adfd7eb73f83b,cn=index,cn=tasks,cn=config
2012-07-24T09:34:29Z INFO Indexing finished

This is a blocker, must be fixed before GA

upgrades already automated will catch with existing tests - upstream only

Metadata Update from @abbra:
- Issue assigned to abbra
- Issue set to the milestone: FreeIPA 3.0 Beta 2

7 years ago

Login to comment on this ticket.

Metadata