SKEG · OPERATE

Upgrade from Skeg 0.7 to 0.8

Choose the upgrade path, convert a supported store and check the destination before switching traffic.

Skeg 0.8 · Development documentation

Convert a supported 0.7 store into a new directory, verify it with Skeg 0.8 and then switch application traffic. Keep the original store and the 0.7 executable for rollback.

You need the Skeg 0.8 executable, a maintenance window, and enough disk space for the backup and converted store. In the commands below, skeg means the 0.8 executable. Replace the example paths with ones your service account can access.

1. Preserve the original

Pause application traffic, stop the old server cleanly and follow backup and restore. Record its executable, startup settings, account store and quota sidecar. Keep the backup separate from the source and destination of the conversion.

Choose the right path for the source

What Skeg reportsWhat to do
The index has the original 0.7 layout, with no index generation, a flat on-disk base layout and a pre-V3 delta logFollow the offline conversion below.
The index predates generations but its files use a different layout, or the index has a generation but its delta log is missing or lacks row versionsLoad the rows from their original source into a new store.
The target version already accepts the store in writable modeRehearse opening a restored copy and run the application checks below.

When the server reports NEEDS_CONVERSION, read the remedy in the error. For a store that opens only with --mode serve, queries by ID can still work. Vector search can return INDEX_FAULT when Skeg cannot verify that the shard copies belong to the same index. Verify the specific operations your application will use.

2. Convert into a new path

Use the target executable for the conversion. The source must be stopped and the destination must be new. Keep the two paths separate:

skeg convert --from /srv/skeg/data-old --to /srv/skeg/data-new

The converter holds the source shard locks, reads the source without modifying its records, writes a new store and checks the source again. Existing source lock files are required; do not create missing files to bypass a refusal. Read the complete report and check the exit status before proceeding.

Exit statusMeaningNext action
0Conversion verified and destination publishedReview the record counts, then declare authentication and quotas.
1Conversion failedInvestigate the reported phase and destination state.
2Invalid command lineCorrect the arguments.
3The source could not be converted completelyRead the reported damage, ambiguity or unsupported layout and follow the named remedy.
4The conversion could not fit its memory budgetReview the resources named in the report before retrying into a new destination.

Skeg verifies the destination’s vector rows and key-value records against the source before publishing it. Save the report, which includes record counts, the source-state check and the destination state. Check the application’s records and searches in step 4.

Keys with ambiguous tenant prefixes

Some legacy key spellings resemble tenant-prefixed keys. The converter cannot infer whether they were tenant-scoped or literal anonymous keys. If the report asks for this decision, establish how the source was used before retrying. The declaration applies to the ambiguous keys in the conversion:

skeg convert --from /srv/skeg/data-old --to /srv/skeg/data-new-tenant \
  --declare-prefixed-keys tenant

Use tenant when the prefix identifies the owning tenant. Use anonymous when the whole key, including the prefix-like text, belongs to the anonymous owner. This changes ownership interpretation; do not choose a value just to suppress the error. A store needing different interpretations for different ambiguous keys needs investigation before conversion.

Memory budget

The default conversion accounting budget is 1 GiB. To set another positive byte count, pass --memory-budget:

skeg convert --from /srv/skeg/data-old --to /srv/skeg/data-new-budget \
  --memory-budget 536870912

This example sets a 512 MiB conversion budget. With a small budget, Skeg can read a shard’s log multiple times to process one key partition at a time. Allow time for those reads and check host headroom separately from the conversion budget.

3. Declare authentication and quotas

Conversion does not discover an external authentication store or silently decide to discard it. The converted store refuses activation until both authentication and quotas have been declared.

For a source that had neither, explicitly declare both absent:

skeg convert --declare-auth none --declare-quotas none \
  --to /srv/skeg/data-new

For an authenticated deployment, preserve the account store and quota sidecar from the same stopped state. Restore independent copies for the destination; keep the originals with the rollback store. In the example below, /etc/skeg contains the destination’s copies. Name their final absolute paths:

skeg convert --declare-auth /etc/skeg/auth.kdb \
  --declare-quotas /etc/skeg/auth.kdb.quotas \
  --to /srv/skeg/data-new

Use the destination you actually converted in step 2. Both declarations must be supplied in the same command. If that deployment has no quota sidecar, declare --declare-quotas none; do not use none for a file whose settings must be retained.

Declared files must already exist, be regular files rather than symlinks, and be readable in their expected formats. The quota file, when declared, must be the auth path with .quotas appended. Quotas without an auth file are refused. Declaration records the files; it does not copy them, create accounts or enable strict authentication.

Check that the declaration command exits successfully and reports a certified state. If it reports publication without certification, follow its instruction to repeat the same declaration while the store remains stopped.

4. Open and validate the destination

Review the server configuration first. Run skeg config check with the same file, environment and startup flags you will use below. Skeg 0.8 serves RESP3 by default, and native clients need a listener started with --protocol native.

Start the converted store on a separate local port. Use the shard count the store already declares. The examples below use eight shards. Replace 8 with your store’s count. See shard configuration if startup reports a layout mismatch.

For a store without authentication, use a command like this:

SKEG_SHARDS=8 skeg --data-dir /srv/skeg/data-new --addr 127.0.0.1:6381

For an authenticated store, pass the declared account store and preserve the service’s authentication policy. This example requires login and uses ops as the existing admin tenant:

SKEG_SHARDS=8 skeg --data-dir /srv/skeg/data-new --addr 127.0.0.1:6381 \
  --tenant-auth /etc/skeg/auth.kdb --tenant-strict --admin-tenant ops

Use the actual admin tenant if the deployment has one. Authenticate as known users and check tenant boundaries, quotas, key-value records, vectors and payloads using the restore checklist.

If the report says routing changed, compare search recall and response times with your baseline. Conversion can collapse identical copies and place rows by hash. Also check how your clients parse replies and errors using protocol compatibility.

Switch traffic only after the checks pass. Keep writes directed at one instance. Skeg does not reconcile diverging copies.

If conversion stops

A failed conversion may leave a hidden staging directory or a destination marked CONVERTING. The report identifies what remains. Do not remove marker files to force the server to open a partial store. Retry from the preserved source into a new destination after resolving the cause.

A CONVERTED store awaiting security declarations is a different state: use step 3. Keep the destination stopped while updating declarations.

Rollback

Before new writes are accepted, you can return to the preserved original store with its original executable, auth files and settings. Once clients have written to the new instance, the old copy is stale. Plan how to recover those writes before switching back. Use the preserved 0.7 files with the 0.7 executable.