Description
We persist the cluster version within a flat file in the data directory. Before attempting to open Pebble, we assert that the currently persisted version is sufficiently high (guarding against 'skipping' an unskippable version):
cockroach/pkg/storage/pebble.go
Lines 929 to 954 in 53814aa
We should also guard against rolling back from a newer, finalized cluster version here. I believe we have such protection later after the Engine has started although I haven't gone searching for it yet. But if we make backwards incompatible changes to the encryption-at-rest, validating after the engine has started is too late.
We should move handling of the cluster version file into the storage/fs
package during fs.Env
initialization to ensure that it fully encompasses encryption-at-rest initialization. And we should assert that the persisted cluster version is neither too high nor too low.
Jira issue: CRDB-51481