Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1051.
The Relax Rules control (
1.3.6.1.4.1.4203.666.5.12) was implemented by havingLocalBackendModifyOperationandLocalBackendAddOperationreport themselves as synchronization operations while the control is present. That is what let them write attributes markedNO-USER-MODIFICATION, but the flag means "replayed from another replica" to everything else:LDAPReplicationDomain.synchronize()took it for a replay,remotePendingChanges.commit()found nothing and threw,ERR_OPERATION_NOT_FOUND_IN_PENDINGwent to the error log, andds-sync-histwas left alone, so nothing could publish the change on a later session either;AddOperationBasisrefuses 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 onNO-USER-MODIFICATIONandOBSOLETEattributes, by the schema check of the resulting entry, byAddOperationBasis, and by the privilege check which already requiredbypass-acl. The operations are ordinary otherwise: they get a CSN, updateds-sync-histand are published to the replication servers, where the replay is a synchronization operation already and accepts the relaxed attributes without the control.RelaxRulesReplicationTestruns 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 withUnwilling to Perform ... NO-USER-MODIFICATION) and pass with it;RelaxRulesTestCase,ReplicationRepairControlTest,AddOperationTestCase(138) andModifyOperationTestCase(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).