# Backfills और Reprocessing — Apache Airflow: Data Pipelines का Orchestration

Source: https://www.geekswithgeeks.com/hi/airflow/design-backfill

> सुधार या देर से हुए schema बदलाव के बाद तारीख़ों की सीमा सुरक्षित रूप से दोबारा चलाएँ।

## इतिहास जानबूझकर दोहराएँ

**Backfill** DAG को पिछले data intervals के लिए चलाता है, जैसे bug सुधारने या नया column जोड़ने के बाद। क्योंकि आपके tasks idempotent हैं और run की तारीख़ें उपयोग करते हैं, backfill बस वही तर्क कई तारीख़ों के लिए चलाना है। Backfill को Airflow CLI या UI से किसी ख़ास तारीख़-सीमा के लिए शुरू करें, concurrency (`max_active_runs`) सीमित करें ताकि वह आपके स्रोतों पर बोझ न बने, पहले छोटी सीमा पर परखें, और downstream उपभोक्ताओं पर नज़र रखें: दोबारा प्रोसेस हुआ डेटा alerts चला या dashboards ताज़ा कर सकता है।

## CLI से backfill

Syntax Airflow version पर निर्भर है, इसलिए `airflow dags backfill --help` (Airflow 2) या Airflow 3 का backfill command/UI देखें। पहले एक दिन परखें।

```bash
# Airflow 2.x style (illustrative)
airflow dags backfill orders_etl \
  --start-date 2026-09-01 --end-date 2026-09-07 \
  --reset-dagruns

# limit parallelism in the DAG definition: max_active_runs=2
```

## छोटा backfill, फिर बढ़ाएँ

एक साल का डेटा एक बार में दोबारा लिखने वाला backfill databases और downstream dashboards पर बोझ डाल सकता है। एक दिन करें, जाँचें, फिर बढ़ाएँ।

**Quiz:** Backfills को सुरक्षित क्या बनाता है?

- [ ] बिना keys के append करना
- [ ] datetime.now() उपयोग करना
- [x] Idempotent tasks जो run की तारीख़ें उपयोग करते हैं
- [ ] बिना सीमा सब कुछ एक साथ चलाना

*Answer:* Idempotent tasks जो run की तारीख़ें उपयोग करते हैं. निश्चित, तारीख़-आधारित tasks बिना दुष्प्रभाव दोहराए जा सकते हैं।
