---
id: ADR-CRM-DQ-013
title: Bound the size of atomic merges
product_area: crm
module: data-quality
revision: 1
status: proposed
design_intent: confirmed
source_sha:
  services-crm: a8d1364f1dd44b723bb5f9acba12f983e9ec8d69
decision: >-
  Merges exceeding the configured ceiling of one hundred thousand related rows
  or organization affiliations are refused; plans above ten thousand rows warn
  about duration and lock waits.
constrains:
  - DOM-CRM-DQ-003
  - WF-CRM-DQ-006
  - SVC-CRM-DQ-merges
  - SCR-CRM-DQ-008
origin: >-
  services-crm:docs/merging/decisions.md#D7, #D9 and #D10 (Andrew, 2026-10-12
  and 2026-10-14)
alternatives:
  - option: Increase the ceiling
    why_not: The measured lock duration would expose more ordinary edits to timeouts.
  - option: Move records in committed batches
    why_not: Staff would see a partially combined organization.
consequences:
  - Duration estimates and size warnings do not affect approval hashes.
  - >-
    The merge task has a fifteen-minute limit; production timing still depends
    on its workload.
supersedes: []
evidence:
  - >-
    services-crm at a8d1364f: modules/merges/services/planning/merge-engine.ts
    (LARGE_EXECUTION_ROWS, MERGE_ROW_CEILING); services/merges/merge-limits.ts.
---

# Bound the size of atomic merges

## Context

A single large transaction can hold many records against concurrent editing.

## Decision

Merges exceeding the configured ceiling of one hundred thousand related rows or organization affiliations are refused; plans above ten thousand rows warn about duration and lock waits.

## Alternatives Considered

Increase the ceiling. The measured lock duration would expose more ordinary edits to timeouts.

Move records in committed batches. Staff would see a partially combined organization.

## Consequences

Duration estimates and size warnings do not affect approval hashes. The merge task has a fifteen-minute limit; production timing still depends on its workload.
