-
Notifications
You must be signed in to change notification settings - Fork 121
Dirty Upgrade
TokuFT runs recovery when its environment is opened and its recovery log does not end with a clean shutdown log entry. The version of the recovery log must be the same as the version of the recovery software. When these versions are different, TokuFT recovery does not run and the open of the environment fails.
There are two problems with only supporting upgrade on a clean shutdown.
- If one takes a snapshot backup of a running TokuFT system, the TokuFT recovery log will probably be dirty, and this will prohibit upgrading to a newer version of the TokuFT software. One must install the backup, run the matching TokuFT version, get a clean shutdown, and then upgrade the TokuFT software. This is a pain.
- If there is a unrecoverable crash during TokuFT recovery, and a newer version of the TokuFT software has a bug fix, then there is no way to run the newer version.
We describe how TokuFT can support several versions of its recovery log and other files so that upgrade is much simpler.
Diff version 24 and 25
- Hashes removed from the rollinclude rollback log entry
- No FT changes.
Diff version 25 and 26
- No log changes
- Basement node encoding changed for fixed length rows.
Diff version 26 and 27
- No log changes
- Nonleaf node message tree encoding changed.
We are going to ignore dirty upgrade from version 24 for now since it would require code hacks to support the version 24 rollinclude rollback log entry. These hacks are easy. The test code is hard.
We are going to support dirty upgrade from versions 25 through 27. This starts with TokuDB 7.1.5.
The disk version is the verion of the log on disk.
The soft version is the version of the logging software currently running.
The upgrade rules applied in this order are:
- If disk version > soft version then error, can not go backwards.
- If disk version == soft version then ok, run recovery if not clean shutdown.
- If any version && clean shutdown, then ok, no need for recovery.
- If 25 <= disk version && disk version <= 27 && soft version == 27, then ok, run recovery.
- Otherwise, error, need a clean shutdown using the disk version.
Rule 4 is new and will have to be updated for new versions to support dirty upgrade from versions 25 through 27.