Skip to content

FileChangelogDB.initializeDB() swallows ChangelogException: a replication server with an unreadable changelog starts anyway #802

Description

@vharseko

Spotted while reviewing #795, one line above the swallow that PR removes.

FileChangelogDB.initializeDB()
(opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/FileChangelogDB.java:282-300)
catches ChangelogException and only logs ERR_COULD_NOT_READ_DB:

public void initializeDB()
{
  try
  {
    replicationEnv = new ReplicationEnvironment(dbDirectory.getAbsolutePath(), replicationServer, TimeService.SYSTEM);
    ...
  }
  catch (ChangelogException e)
  {
    logger.traceException(e);
    logger.error(ERR_COULD_NOT_READ_DB, this.dbDirectory.getAbsolutePath(), e.getLocalizedMessage());
  }
}

ReplicationServer.initialize() calls it and then goes on to bind the listen port and start its
threads, so a replication server whose changelog cannot be read comes up and accepts
connections: the failure surfaces later, somewhere else — the exact shape #792 / #795 removed
for the listen port.

Why it was not fixed in #795

Propagating it means adding throws ChangelogException (or wrapping it in a ConfigException)
to the ChangelogDB interface and to every implementation and caller, which is a change of its
own.

What to do

Decide whether an unreadable changelog must prevent the replication server from starting — as
an unbindable listen port now does — and, if so, propagate the exception through ChangelogDB.

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