Skip to content

No test for a ModifyDN conflict solved while server-error-result-code is one of the conflict codes #910

Description

@vharseko

ds-cfg-server-error-result-code is configurable and is not validated as a result code, so it can be set to a code conflict resolution owns. #892 (issue #889) made the replay handle that, and one half of it has no test.

The rule

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

private static final Set<ResultCode> CONFLICT_RESULT_CODES = ...   // :407
    ResultCode.NO_SUCH_OBJECT, ResultCode.ENTRY_ALREADY_EXISTS,
    ResultCode.NOT_ALLOWED_ON_RDN, ResultCode.NOT_ALLOWED_ON_NONLEAF,
    // solveNamingConflict(ModifyDNOperation) solves these two as well
    ResultCode.UNWILLING_TO_PERFORM, ResultCode.OBJECTCLASS_VIOLATION);

A change which fails with the configured code is left to solveNamingConflict() when that code is one of these - conflict resolution is the only thing which can solve them - and is treated as a failure of the server only once conflict resolution reports it could not (isConfiguredServerErrorResultCode(), :2795).

What is covered and what is not

  • Covered: UpdateOperationTest.changeConflictResolutionCanNotSolveOnTheServerErrorCodeIsRetried sets the code to 53 (UNWILLING_TO_PERFORM) and asserts that a Delete which keeps failing with it is retried and applied rather than recorded as replayed.
  • Not covered: that a naming conflict which solveNamingConflict(ModifyDNOperation) does solve is still solved with that setting in place. UNWILLING_TO_PERFORM and OBJECTCLASS_VIOLATION were added to the set for the ModifyDN overload specifically, and nothing exercises that combination - the test above would pass with those two entries removed, because the code then routes through isServerFailure() and is retried anyway.

What is needed

A test which, with ds-cfg-server-error-result-code set to 53 (and a second run at 65), replays a ModifyDN whose conflict solveNamingConflict(ModifyDNOperation) resolves through those result codes, and asserts the entry ends up where conflict resolution puts it - not retried as a server failure and not skipped. NamingConflictTest / UpdateOperationTest.namingConflicts are the closest existing scenarios to build it from.

Low severity: it guards a non-default configuration. It is listed here so the gap is recorded rather than rediscovered.

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

    Labels

    replicationtestsTest suites: fixing, enabling, un-disabling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions