Slap.Streams.Upgrade (slap_streams v0.6.1)

Copy Markdown View Source

Offline conversion of stream metadata written by version 0.4.0 and earlier.

Summary

Functions

Converts version 1 metadata to version 2 using exclusively owned handles.

Functions

run(dbs)

@spec run([Slap.SlateDB.t()]) :: :ok | {:error, term()}

Converts version 1 metadata to version 2 using exclusively owned handles.

Stop every node using the store and take a backup before opening these handles. Only trusted stored ETF records may be supplied. Finish or delete incomplete copy forks with the old version before running this conversion.

Checks all supplied shards before writing and converts metadata in durable batches. Stops on the first error; close and reopen the handles before retrying. Converted records are skipped. Message rows, offsets, trim, producer state, Stream-Seq, expiry and closed state are preserved. Background cleanup finishes old deletion and trim work after the cluster restarts.