# recovery_init_sync_method

> recovery_init_sync_method sets the method for synchronizing the data directory before crash recovery. It is a sighup setting present in PG14–18; the latest recorded boot default is fsync.
---

> [!NOTE]
> **Fact — official short description:** “Sets the method for synchronizing the data directory before crash recovery.”

## Identity {#identity}

| Field | Value | Meaning |
| --- | --- | --- |
| Type | `enum` | Upstream pg_settings type |
| Context | `sighup` | Takes effect after configuration reload |
| Unit | — | Raw unit |
| Range | — | Raw limits in the last observed version |
| Enum values | `fsync`, `syncfs` | — for non-enum types |
| Category | Error Handling | Upstream classification |
| Latest boot value | `fsync` | fsync |
{.fields meta="-"}

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG14 |
| Present in | PG14–19 Beta 3 |
| Removed in | No |
| Introduction commit | [`61752afb2640`](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=61752afb26404dfc99a535c7a53f7f04dc110263) — Provide recovery_init_sync_method=syncfs. |
| Commit date | 2021-03-20 |
| Discussion | [thread 1](https://postgr.es/m/11bc2bb7-ecb5-3ad0-b39f-df632734cd81%40discourse.org) · [thread 2](https://postgr.es/m/CAEET0ZHGnbXmi8yF3ywsDZvb3m9CbdsGZgfTXscQ6agcbzcZAw%40mail.gmail.com) |

## Default history {#default-history}

| Versions | Raw `boot_val` | Unit | Human value |
| --- | --- | --- | --- |
| PG14–19 Beta 3 | `fsync` | — | fsync |
{.full-width caption="Measured PG9.0–19 Beta 3 boot defaults"}

## How it works {#mechanism}

Sets the method for synchronizing the data directory before crash recovery. A configuration reload applies a new value; existing work already in flight is not retroactively changed.

Before crash recovery, PostgreSQL synchronizes the data directory so replay is not built on unflushed copied files. fsync walks files portably; where supported, syncfs can synchronize the containing filesystem more quickly but has a broader scope.

Monitor and change recovery_init_sync_method together with data_sync_retry, restart_after_crash, fsync. Validate on the relevant server role and real workload, then use its sighup context to choose session change, reload, or restart; a historical boot default is not the current effective value.

## Tuning advice {#tuning-advice}

> [!TIP]
> **Advice.** These are workload-specific starting points and must be validated with measurements.

| Workload | Guidance |
| --- | --- |
| OLTP | Change recovery_init_sync_method only from an explicit failure model and measured evidence. Validate in a session/test environment, deploy according to its context, and retain a rollback value. |
| OLAP | Test separately under long queries, batch jobs, and peak concurrency rather than copying OLTP assumptions to analytical nodes. |
| Small nodes | Keep the default without a concrete problem; small systems should not trade global compatibility or failure semantics for a marginal gain. |
{.full-width}

## Pigsty {#pigsty}

Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.

| Template | Effective value | Versus upstream boot | Source expression |
| --- | --- | --- | --- |
| OLTP | Unmodified | — | — |
| OLAP | Unmodified | — | — |
| CRIT | Unmodified | — | — |
| TINY | Unmodified | — | — |
{.full-width}

> [!CAUTION]
> **Advice — pending human review.** Fact from the current Pigsty template projection: OLTP: PG14–19 Beta 3 unmodified; OLAP: PG14–19 Beta 3 unmodified; CRIT: PG14–19 Beta 3 unmodified; TINY: PG14–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.

## Common pitfalls {#common-pitfalls}

- Confusing the boot default of recovery_init_sync_method with its current effective value.
- Ignoring its sighup context when deciding when it takes effect.
- Changing several interacting settings at once and losing causal evidence.
- Rolling out globally without testing the real failure or workload boundary.

## Related parameters {#related-parameters}

[`data_sync_retry`](/parameters/data-sync-retry/) · [`restart_after_crash`](/parameters/restart-after-crash/) · [`fsync`](/parameters/fsync/) · [`full_page_writes`](/parameters/full-page-writes/) · [`exit_on_error`](/parameters/exit-on-error/)

## References {#references}

- [PostgreSQL 19 Beta 3 — recovery_init_sync_method](https://www.postgresql.org/docs/19/runtime-config-error-handling.html#GUC-RECOVERY-INIT-SYNC-METHOD)
- [PostgreSQL 19 release notes](https://www.postgresql.org/docs/19/release-19.html)
- [Machine-readable GUC export](/data/guc.jsonl)
