[OPENDJ-6431] Support replication of offline updates to LDIF backends Created: 04/Jul/19  Updated: 07/Jan/20  Resolved: 16/Jul/19

Status: Done
Project: OpenDJ
Component/s: backends, replication
Affects Version/s: 7.0.0
Fix Version/s: 7.0.0

Type: Improvement Priority: Critical
Reporter: Matthew Swift Assignee: Michal Severin [X] (Inactive)
Resolution: Fixed Votes: 0
Labels: Verified

Issue Links:
depends on OPENDJ-6430 LDAP SDK Ldif#diff() returns empty mo... Done
is related to OPENDJ-5985 Divergence of "cn=admin data" after s... Dev backlog
OPENDJ-6440 QA - OPENDJ-6431: Support replication... Sub-task Closed carole forel  
Epic Link: Replication self-registration
Story Points: 3
Dev Assignee: Matthew Swift
QA Assignee: Michal Severin [X] (Inactive)


DJ has always attempted to support replication of offline changes to the schema backend. However, this support is not available for LDIF backends and, in particular, cn=admin data where symmetric keys are located.

Steps to reproduce:

  1. install two replicated DJ instances, DS1 and DS2, without enabling production mode
  2. observe that both servers do not contain any symmetric keys
  3. stop DS1
  4. perform an encrypted backup of DS1
  5. observe that DS1 now contains a single symmetric key, but DS2 does not yet
  6. restart DS1
  7. observe that the server starts and connects successfully to the topology, but the symmetric key is never synchronized to the rest of the topology. This prevents the backup from being restored on any other server other than DS1.

This bug is particularly important from a devops / automation point of view where servers may import data during a bootstrap phase.

Comment by Matthew Swift [ 09/Jul/19 ]

Fix has been merged, although the unit test coverage is not very good because a significant amount of refactoring is required. In particular, it would be nice to check that the LDIF backend detects offline changes as follows:

  1. configure an LDIF backend
  2. verify that there are no offline changes
  3. close the backend
  4. apply offline changes
  5. open the backend
  6. verify that there are now offline changes.

Unfortunately, the existing unit test depends on the server running. To close the backend we need to stop the server, make changes and then restart. However, the server restart will automatically flush out the offline changes. A better approach would be to refactor the LDIF backend tests so that they are true unit tests that do not depend on the server running and, instead, use mocked config and server context.

Comment by Michal Severin [X] (Inactive) [ 07/Jan/20 ]

Verified with 7.0.0-SNAPSHOT rev. 1d33bc905c3

Generated at Thu Jan 28 14:16:10 UTC 2021 using Jira 7.13.12#713012-sha1:6e07c38070d5191bbf7353952ed38f111754533a.