Skip to content

Commit

Permalink
[docs] Add documentation on fileset migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
nbroyles committed Sep 17, 2020
1 parent 2f568ee commit ae69a1e
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions docs/operational_guide/fileset_migrations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Fileset Migrations

Occasionally, changes will be made to the format of fileset files on disk. When those changes need to be applied to already existing filesets, a fileset migration is required. Migrating existing filesets is beneficial so that improvements made in newer releases can be applied to all filesets, not just newly created ones.

## Migration Process
Migrations are executed during the initial stages of the bootstrap. When enabled, the filesystem bootstrapper will scan for filesets that should be migrated and migrate any filesets found. A fileset is determined to be in need of a migration based on the `MajorVersion` and `MinorVersion` found in the info file. If `MajorVersion.MinorVersion` is less than the target migration version, then that fileset will be scheduled for migration.

If migrations are deemed necessary, the bootstrap process pauses until the migrations complete. If a failure occurs while migrating, an error is logged and the process continues. If a fileset is not successfully migrated, the non-migrated version of the fileset is used going forward. In other words, whether they succeed or fail, migrations should leave filesets in a good state.

## Enabling Migrations
Migrations are enabled by setting the following fields in the M3 configuration (`m3dbnode.yml`):

```
db:
bootstrap:
fs:
migration:
targetMigrationVersion: "1.1"
# Optional. Defaults to the number of available CPUs / 2.
concurrency: <# of concurrent workers>
```

## Valid Target Migration Versions

<table>
<thead>
<tr>
<th>Version</th>
<th>Description</th>
</tr>
</thead>

<tbody>
<tr>
<td><code>&quot;none&quot;</code></td>
<td>Disables migrations. Effectively the same as not including the migration option in the M3 configuration</td>
</tr>
<tr>
<td><code>&quot;1.1&quot;</code></td>
<td>Migrates to version 1.1. Version 1.1 adds checksum values to individual entries in the index file of data filesets. This speeds up bootstrapping as validating the index file no longer requires loading and calculating the checksum of the entire file against the value in the digests file.</td>
</tr>
</tbody>
</table>

0 comments on commit ae69a1e

Please sign in to comment.