We need an upgrade procedure if we make changes to storage.
As a first step Sink::Store::upgrade() provides a hook that can be used to drive the process ("sinksh upgrade") calls this function.
In a first implementation this now simply nukes all local caches so you have to resync (This will also nuke any local changes that have not yet been replayed).
What we want out of this system is:
- Allow Kube to initially block while displaying a "Please wait while upgrading..." message.
- Support building newly added indexes, remove removed indexes, change changed indexes... etc. as part of the upgrade procedure.
- Detect if the storage has not yet been upgraded elsewhere and refuse to read/write before that is completed (because otherwise we can't tell what's going to happen).