Skip to content

Manifest::open always rewrites the MANIFEST. This is how a store changes its format stamp, and it happens at one durable point.

  1. Take a snapshot of the replayed state.
  2. Set generation to the old generation plus 1.
  3. Stamp the header store_format with the build’s current store format.
  4. Write to MANIFEST.tmp with mode 0600.
  5. fsync, rename into place, and fsync the directory.

The log is also rewritten when it exceeds 4 MiB.

Consequently a store becomes stamped at one durable point, before any byte of the new format is written to data files or WAL (SPEC V455). There is no downgrade afterwards (SPEC V456). A build whose stamp is lower than the file’s refuses to open the store before changing anything.

Format pre-4 is the SEAM 1 layout (SEAM 1 will be stamped 1 on disk at the first public release; planned, not yet in code). Pre-release stores carry pre-1 to pre-3, see pre-release stamps. The stored number for the current layout is discussed on the header page.

The stamp is bound into the AAD of every record, so a record from before the rewrite cannot be carried across it. Files keep their own per-file stamps and are migrated in the background, see Migration.