Skip to content

[#1051] Replicate a change made under the Relax Rules control like any other - #1053

Open
vharseko wants to merge 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:feature/1051-relax-rules-replication
Open

vharseko wants to merge 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:feature/1051-relax-rules-replication

Conversation

@vharseko

Copy link
Copy Markdown
Member

Fixes #1051.

The Relax Rules control (1.3.6.1.4.1.4203.666.5.12) was implemented by having LocalBackendModifyOperation and LocalBackendAddOperation report themselves as synchronization operations while the control is present. That is what let them write attributes marked NO-USER-MODIFICATION, but the flag means "replayed from another replica" to everything else:

  • on a replicated suffix the change was never published: LDAPReplicationDomain.synchronize() took it for a replay, remotePendingChanges.commit() found nothing and threw, ERR_OPERATION_NOT_FOUND_IN_PENDING went to the error log, and ds-sync-hist was left alone, so nothing could publish the change on a later session either;
  • the request was hidden from the access log, skipped the pre-operation plugins and the password policy;
  • an add carrying such an attribute did not get that far: AddOperationBasis refuses it while parsing the attributes, on the real synchronization flag, which the control never set.

The control now relaxes what it is meant to relax and nothing else. LocalBackendWorkflowElement.isRelaxRulesRequested(Operation) reads the request once, up front, and is consulted by the checks on NO-USER-MODIFICATION and OBSOLETE attributes, by the schema check of the resulting entry, by AddOperationBasis, and by the privilege check which already required bypass-acl. The operations are ordinary otherwise: they get a CSN, update ds-sync-hist and are published to the replication servers, where the replay is a synchronization operation already and accepts the relaxed attributes without the control.

RelaxRulesReplicationTest runs a relaxed modify and a relaxed add over a replicated suffix with a broker listening on the replication server: each must be published for its entry, carry the relaxed attribute, leave historical information behind and not be reported as a missing pending change. Both failed before the fix (the modify with nothing published, the add with Unwilling to Perform ... NO-USER-MODIFICATION) and pass with it; RelaxRulesTestCase, ReplicationRepairControlTest, AddOperationTestCase (138) and ModifyOperationTestCase (933) stay green.

The reference appendix gains a sentence on what the control does in OpenDJ (asciidoc and docbook).

Related: #1050, #1052 (the replication repair control, which is the tool for a change that must stay on one replica).

…ules control like any other

The control was implemented by having the local add and modify operations report
themselves as synchronization operations, which is what let them write attributes
marked NO-USER-MODIFICATION. That flag means "replayed from another replica" to
everything else, so on a replicated suffix the change was never published: the
replication domain took it for a replay, found no pending change to commit and
logged ERR_OPERATION_NOT_FOUND_IN_PENDING, and left the entry with no historical
information to publish the change from later. The same flag hid the request from
the access log and the plugins. An add carrying such an attribute did not get that
far: AddOperationBasis refuses it while parsing the attributes, on the real flag.

The control now relaxes what it is meant to relax and nothing else. Whether the
request carries it is read once, up front, and consulted by the checks on
NO-USER-MODIFICATION and OBSOLETE attributes, by the schema check of the resulting
entry, and by the privilege check which already required bypass-acl. The
operations are ordinary otherwise: they get a CSN, update ds-sync-hist and are
published to the replication servers, where the replay is a synchronization
operation already and accepts the relaxed attributes without the control.

RelaxRulesReplicationTest runs a relaxed modify and a relaxed add over a
replicated suffix with a broker listening on the replication server, and checks
that each is published for its entry, carries the relaxed attribute, leaves
historical information behind and is not reported as a missing pending change.
@vharseko vharseko added bug replication java Changes to Java sources tests Test suites: fixing, enabling, un-disabling docs labels Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug docs java Changes to Java sources replication tests Test suites: fixing, enabling, un-disabling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A Relax Rules change on a replicated suffix is not replicated and logs an internal error

1 participant