During replica creation, Longhorn will create a ‘revision.counter’ file with its initial counter set to 0. And for every write to the replica, the counter in ‘revision.counter’ file will be increased by 1.
The Longhorn Engine will use these counters to make sure all replicas are consistent during start time. These counters are also used during salvage recovery to decide which replica has the latest update.
Disable Revision Counter is an option in which every write on replicas is not tracked. When this setting is used, performance is improved, but the strong tracking for each replica is lost. This option can be helpful if you prefer higher performance and have a stable network infrastructure (e.g. an internal network) with enough CPU resources. When the Longhorn Engine starts, it will skip checking the revision counter for all replicas, but auto-salvage will still be supported through the replica’s head file stat. For details on how auto-salvage works without the revision counter, refer to
Disable Revision Counter
To disable or enable the revision counter from the Longhorn UI, click Setting > General > Disable Revision Counter.
To create individual volumes with settings that are customized against the general settings, go to the Volume page and click Create Volume.
By default, the is false, so the revision counter is enabled.
Set disableRevisionCounter
to true to disable the revision counter:
The logic for auto-salvage is different when the revision counter is disabled.
When the revision counter is disabled in this case, the engine controller will get the last modified time and head file size of all replicas. It will also do the following steps:
- Compare the head file size for all the candidate replicas, and pick the one with the largest file size as the source of truth.