Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-3983

Target reconciliation broken when _targetQuery results contain full objects

    Details

      Description

      When the _targetQuery for a given mapping returns full objects within the results, the recon target phase may fail and/or behave unexpectedly.

      One way to reproduce the problem is via the following:
      1. Install OpenIDM 3.1.0 w/OpenDJ 2.6 as a source system (pre-populated with sample data)
      2. Using sample2d as a base, configure the OpenDJ -> Managed User mapping to include the following source and target queries:

                  "sourceQuery" : {
                      "_queryFilter" : "uid sw \"\""
                  },
      
                  "targetQuery" : {
                      "_queryFilter" : "displayName sw \"\""
                  },
      

      3. Perform a initial reconciliation from OpenDJ -> Manage User to both create and link the target objects
      4. Modify the previously defined _sourceQuery and change it to the following:

                  "sourceQuery" : {
                      "_queryFilter" : "uid sw \"user.0\""
                  },
      

      The above will reduce the scope of visible source objects to a single OpenDJ account.
      5. Re-run reconciliation with the new _sourceQuery. Notice that the target recon phase will to correctly process the remaining target objects and throw an error similar to the following:

      Sep 08, 2015 4:14:53 PM org.forgerock.openidm.sync.impl.ObjectMapping$TargetSyncOperation assessSituation
      INFO: Situation CONFIRMED in target reconciliation that indicates source may have changed. Source: { "description": "This is the description for Denice Chattoe.", "ldapGroups": [  ], "sn": "Chattoe", "givenName": "Denice", "employeeNumber": "1999", "dn": "uid=user.1999,ou=People,dc=example,dc=com", "telephoneNumber": "+1 097 474 7678", "cn": "Denice Chattoe", "uid": "user.1999", "mail": "user.1999@maildomain.net", "_id": "48652d86-2a15-34ca-8d83-ac79b5c989c8" }, targetId: 37418262-aff6-4456-af0d-20dc21949903, firstId: 48652d86-2a15-34ca-8d83-ac79b5c989c8, secondId: 37418262-aff6-4456-af0d-20dc21949903
      Sep 08, 2015 4:14:53 PM org.forgerock.openidm.sync.impl.ObjectMapping$3 recon
      WARNING: Unexpected failure during target reconciliation 880bb513-af6e-413b-b01a-b930fec7a299
      org.forgerock.openidm.sync.impl.SynchronizationException: target '_id' has changed; expected: 37418262-aff6-4456-af0d-20dc21949903, found: 8aa33ca0-9931-4e18-9d2a-a3cb8c416131
              at org.forgerock.openidm.sync.impl.ObjectMapping.updateTargetObject(ObjectMapping.java:502)
              at org.forgerock.openidm.sync.impl.ObjectMapping.access$1500(ObjectMapping.java:80)
              at org.forgerock.openidm.sync.impl.ObjectMapping$SyncOperation.performAction(ObjectMapping.java:1628)
      

      Notice the target _id is being changed as a result of a miss-match within the state of the ResultIterable object used to cache the target query results:

      org.forgerock.openidm.sync.impl.SynchronizationException: target '_id' has changed; expected: 37418262-aff6-4456-af0d-20dc21949903, found: 8aa33ca0-9931-4e18-9d2a-a3cb8c416131
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                matthias.grabiak Matthias Grabiak
                Reporter:
                cgdrake Chris Drake
              • Votes:
                0 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: