How the sites of a cluster treat the operator rules of a replication
config merge. Every site must apply the same contract to the same
payload or the sites persist different configs, so the S3 edit path
probes the peers before merging and a peer payload carries the contract
its sender applied.
Give the site rules in rules the lowest priorities no operator rule uses,
in rule order, leaving every operator rule’s priority untouched. Operator
priorities decide which rule wins per target, so they are part of the
submitted policy; site rules are derived state and only need to be unique
(validate_replication_config_structure rejects duplicates). The result
is a pure function of the rule list, so the site-replication reconciler,
the peer ingestion merge and the S3 edit merge all converge on the same
bytes and the reconciler’s no-op check holds.
Whether rule is one the local reconciler derived for a current remote
site-replication peer in peer_deployment_ids. With an empty peer set
(site replication disabled) nothing qualifies, so a bucket outside site
replication keeps the verbatim S3 put/delete semantics.
Whether a config’s Role is a site-replication ARN naming a site in
deployment_ids. Such a role is the holder’s identity, not policy: the
reconciler’s per-peer target lookup reads it, so carrying it across sites
would pin the receiver’s targets to the sender’s. Any other role — an IAM
role, or an operator remote target whose ARN happens to carry an empty
region — passed target validation and drives target selection.
merge_incoming_replication_config for the S3 put/delete-bucket-replication
path (issue #1948): only rules the local reconciler derived for a current
peer in peer_deployment_ids survive as site rules; every other stored
rule — including an operator-authored site-repl-* id — is operator state
that the request replaces or deletes. An incoming rule whose id is a
current peer’s site-repl-<id> is dropped whatever its ARN: accepting it
would duplicate the reconciler rule’s id. Under
OperatorRuleContract::Legacy the merge instead reproduces what the
pre-contract peers will do with the broadcast, listing the operator rules
in priority order so their relative order survives the renumbering.
Deployment id extracted from a site-replication target ARN
(arn:{rustfs|minio}:replication::<deployment-id>:<bucket>), or None
for an operator-authored ARN.
Deployment id of the peer a reconciler-derived rule replicates to, or
None for any other rule. The reconciler builds each rule from one peer:
the id is site-repl-<deployment id> and the destination ARN names that
same deployment id — an operator-authored site-repl-user rule, or a
site-repl-<peer> id pasted onto a foreign ARN, fails the agreement check.
Callers that know the current peer set must also confirm the id is one of
those peers before treating the rule as reconciler-owned.
Structural validation of a replication configuration, mirroring the checks
MinIO’s replication.Config.Validate performs before persisting: at least
one rule, at most REPLICATION_CONFIG_MAX_RULES, non-negative and unique
per-rule priorities (a missing Priority counts as 0, like Go’s zero value),
rule IDs within REPLICATION_CONFIG_MAX_RULE_ID_LEN bytes, a Filter
carrying only one of Prefix/Tag/And, and delete marker replication
disabled on rules with a direct Filter.Tag. Tags inside Filter.And do
NOT trigger the delete-marker check — MinIO only inspects the direct tag,
and mc replicate add --tags "k1=v1&k2=v2" (delete-marker replication on
by default) puts multiple tags into And.Tags, so rejecting that shape
would break mc-generated configs that MinIO accepts.