Skip to content

Docker image: the background join has no server role, so a standalone replication server or a directory server without one needs the deprecated one-shot types #1178

Description

@vharseko

(line numbers on master, 3f4deb9)

Problem

Since #1086 (#1115) the image joins its replication topology in the background, on every start, with OPENDJ_REPLICATION_TYPE=simple, and the README declares the one-shot types srs, sdsr and rg deprecated in favour of it (README.md:182-189). But simple builds one kind of topology only: every server is a directory server and a replication server at once. The two other roles dsreplication enable offers - a replication server that holds no data (--onlyReplicationServerN) and a directory server that connects to replication servers elsewhere (--noReplicationServerN) - are reachable through the deprecated types alone. The deprecation leaves no supported way to run them.

That layout is the one of #534 (four directory servers without a replication server, two standalone replication servers - the topology that piled up missing changes under load), the one #1090 wants to test, and the usual production one, where the replication servers are kept off the servers that take the client load.

What simple does

  • One enable, both sides combined. The join runs a single dsreplication enable (join.sh:442-449) with --replicationPort1 and --replicationPort2 and neither role flag. Without them the tool configures both a replication server and a replication domain on each side (ReplicationCliArgumentParser.java:100-108).
  • The peer's role is not this server's to choose, and the enable chooses it anyway. A server without a replication server that is passed through without --noReplicationServer1 is given one: !serverDesc.isReplicationServer() && enableServer.configureReplicationServer() runs configureAsReplicationServer() (ReplicationCliMain.java:5087-5097). A role variable for the joining server alone is therefore not enough: as the call stands, every directory server without a replication server that a new member joins through silently becomes a combined one. Likewise, a replication-server-only peer passed without --onlyReplicationServer1 is asked to configure a domain for BASE_DN (ReplicationCliMain.java:5059-5060).
  • Membership means holding the data. A member holds the replication domain of BASE_DN and is registered in cn=admin data (replicates_base_dn(), join.sh:302-309). A replication server without data never has that domain, so the join cannot recognise one as a member.
  • Health waits for the data. A volume bootstrapped with simple carries INITIALIZE_PENDING until the join has initialized it from the topology (run.sh:192-194), and the health marker waits for the join (run.sh:156, run.sh:229-236). A replication server has no BASE_DN data to initialize.
  • The seed is a data holder. The first peer of REPLICATION_PEERS seeds a topology nobody else holds with its own data. A replication server has none to seed with.
  • The bootstrap always creates the data backend. setup.sh creates userRoot for BASE_DN on every server (setup.sh:86-88), and with ADD_BASE_ENTRY / SAMPLE_DATA fills it (:90-104). On a replication server that would be data nothing replicates, served to any client that reaches it.

What the deprecated types do

replicate.sh:87-150:

Proposal

A server role for simple, say REPLICATION_ROLE (the name is open):

Value Server dsreplication enable flag for this server
combined (default) directory server and replication server, as today --replicationPortN
directory directory server without a replication server --noReplicationServerN
replication replication server only, no data --onlyReplicationServerN + --replicationPortN
  1. Both sides of every enable get their actual role. This server's comes from its environment. The peer's is read from the peer - whether its configuration holds a replication server and a domain for BASE_DN - and never assumed, so a peer without a replication server keeps having none.
  2. Membership by role. A replication member has its replication server and is registered in cn=admin data (which the enable replicates to a replication-server-only server as well, ReplicationCliMain.java:5059-5060). A directory member has its BASE_DN domain, is registered, and its domain lists at least one replication server.
  3. Bootstrap by role. replication creates no userRoot and ignores ADD_BASE_ENTRY / SAMPLE_DATA, never carries INITIALIZE_PENDING, never seeds and is never initialized. Its health follows its membership.
  4. Seeding. Only a server that holds data (combined or directory) seeds. A topology needs at least one replication server: a directory server whose peers hold none does not join, and says so rather than retrying for ever.
  5. Docs. README: the roles, the Kubernetes layout (one StatefulSet per role, REPLICATION_PEERS listing the members of both), and how srs / sdsr map onto simple with roles, so that their deprecation has a replacement.
  6. Tests in docker-test-replication.sh: two replication + two directory servers, a change on each directory server reaches the other; a restart of each; a new member joined through a directory peer leaves that peer without a replication server; a replication server holds no BASE_DN backend; a directory server with no replication server among its peers does not turn healthy.

Out of scope

Related

Activity

  1. added 2 commits that reference this issue on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions