# ADR-015 — Durability، RPO و failover چه تعهدی دارند؟

What do durability, RPO, and failover promise?

Status: proposed · Date: 2026-10-15

## مسئله / Context

از دست نرفتن run پس از crash فرایند با از دست نرفتن write در خرابی ناحیه یکی نیست.

Surviving process crashes differs from preserving writes after region failure.

## گزینه‌ها / Alternatives

backup روزانهٔ تنها؛ backup+WAL مستقل؛ warm standby ناهمزمان؛ replication همزمان با writer fencing. گزینهٔ pilot، backup+WAL و بازیابی سرد ناحیه است.

Daily backup alone; independent backup plus WAL; asynchronous warm standby; synchronous replication with writer fencing. The pilot selects backup plus WAL and cold regional recovery.

## انتخاب فعلی / Choice

هدف‌های منتخبِ طراحی پایلوت: worker با RPO=0 و RTO≤۲min؛ دیسک/DB با RPO≤۵min و RTO≤۳۰min؛ ناحیه با RPO≤۱۵min و RTO≤۴h؛ index مشتق‌شده با منبع سالم، RTO≤۴h. همه هدف‌اند، نه نتیجهٔ آزمون.

Selected pilot design targets: worker RPO0/RTO≤2min; disk/database RPO≤5min/RTO≤30min; region RPO≤15min/RTO≤4h; derived-index rebuild with intact source RTO≤4h. These are objectives, not measured results.

## چرایی و trade-off / Rationale and trade-off

دادهٔ پایلوت مصنوعی و ابزارها خواندنی‌اند. زمان‌های R01–R04 از بودجهٔ تشخیص/restore/replay/اعتبارسنجی می‌آیند؛ پیش از دادهٔ واقعی، تحمل loss و هزینهٔ standby بازنگری شود.

Pilot data is synthetic and tools are read-only. R01–R04 allocate detection, restore, replay, and validation time; revisit loss tolerance and standby cost before real data.

## فرض‌ها / Assumptions

R01–R04 در recovery.json؛ ۱۰GB دادهٔ مرجع برای restore، ۵۰MB/s انتقال و دسترسی مستقل بازیابی. RF=3 در E08 فقط سناریوی ظرفیت log است.

R01–R04 in recovery.json; 10GB restore size, 50MB/s transfer, and independent recovery access. E08’s RF3 remains a log-capacity scenario only.

## روش آزمون / Validation

drillهای مستقل worker، دیسک، ناحیه و reindex با canary دارای journal اجرا شوند؛ ساعت RTO از آغاز خرابی است. policy/ACL و blobها هم باید صحیح باشند؛ تا آن زمان نتیجه planned است.

Run separate journaled canary drills for worker, disk, region, and reindex failures; start the RTO clock at failure onset. Policy/ACLs and blobs must also be correct; results remain planned until then.

## بازنگری / Revisit

ورود دادهٔ واقعی، ابزار دارای اثر، DB بزرگ‌تر از ۱۰GB، archive gap خارج بودجه یا دو شکست drill؛ هدف/زیرساخت/هزینه را دوباره انتخاب کن.

Revisit for real data, side-effecting tools, databases above 10GB, excessive archive gaps, or two failed drills; reassess objectives, infrastructure, and cost.

DDIA: 2, 6, 9, 10

[Recovery contracts](../recovery.json)
