Skip to content

Make the replay retry budget of a replication domain configurable instead of a constant with a test-only setter #901

Description

@vharseko

How long a replica retries a change its backend could not apply, and how long it waits between
attempts, is decided by constants in LDAPReplicationDomain. An operator whose maintenance windows
are longer than the built-in budget cannot raise it, and the only way to exercise the policy in a
test is a public setter on a production singleton.

Today

opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/LDAPReplicationDomain.java

constant value what it decides
IN_PLACE_REPLAY_ATTEMPTS 10 how many times a replay is retried before the session is restarted
REPLAY_GIVE_UP_DELAY_IN_MS 5 min how long a change is retried before the replica gives up on it and diverges
REPLAY_RETRY_DELAY_IN_MS 1 s the backoff, multiplied by the number of restarts in a row
MAX_REPLAY_RETRY_DELAY_IN_MS 10 s the longest the session is left down
MAX_FAILED_REPLAY_ATTEMPTS_TRACKED 1000 how many failing changes are remembered

Giving up means recording a change which was never applied as replayed: the replica diverges, raises
the org.opends.server.replication.UnreplayedChange alert and has to be reinitialized. Five minutes
is a reasonable default, but an import-ldif or a rebuild-index on a large backend outlasts it, and
the administrator who knows that has no way to say so.

What it would look like

The domain already carries this kind of knob in ReplicationDomainCfg - replay-thread-number,
heartbeat-interval, changetime-heartbeat-interval, assured-timeout - so the natural shape is a
property next to them, in
opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/ReplicationDomainConfiguration.xml,
with the admin guide entry which comes with it. changeConfig() already re-reads that configuration
when it changes.

At least replay-give-up-delay is worth exposing; the backoff and the in-place attempt count could
stay as they are, or follow it.

Why this is separate

Doing it well means a generated configuration property, its documentation, and a decision about which
of the five knobs deserve to be public. #892 introduced the budget as a constant with a
@VisibleForTesting setter (setReplayGiveUpDelay()), which the tests use because they cannot wait
five minutes. A real property would remove that setter, remove the constant the test duplicates, and
answer the operator question at the same time.

Raised from the review of #892.

Activity

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