Skip to content

Commit 4179899

Browse files
authored
Support LSM in snapshot-converter and streaming ledger tables (#1603)
Closes #1592 Closes #1602
2 parents 6308a39 + 3823bfd commit 4179899

File tree

8 files changed

+1133
-216
lines changed

8 files changed

+1133
-216
lines changed

docs/website/contents/references/miscellaneous/utxo-hd/migrating.mdx

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ follows:
142142
</Tabs>
143143
</div>
144144

145-
## Convert the existing Ledger snapshots with `snapshot-converter`
145+
## Upgrading a Ledger snapshots from 10.4.x to 10.5.x
146146

147147
:::warning
148148

@@ -157,8 +157,29 @@ chain from Genesis, however this can take some hours.
157157

158158
We provide the `snapshot-converter` tool which can load a snapshot in the Legacy
159159
format and write it either in the in-memory or on-disk formats for
160-
UTxO-HD. Supposing you have copied a legacy snapshot to
161-
`<tmpdir>/snapshots/<slotno>` you can run the following command:
160+
UTxO-HD.
161+
162+
:::info
163+
164+
On cardano-node 10.6 there was a change in serialization unrelated to the
165+
UTxO-HD changes. This means that going from 10.4.x to 10.5.x can benefit from
166+
this doing a quick conversion using `snapshot-converter` as explained here, but
167+
it won't work when the target is 10.6 or newer. Such a format update can
168+
only be done via a replay of the chain.
169+
170+
The `snapshot-converter` tool still exists in the repository and will convert
171+
between the different UTxO-HD formats but it will no longer be able to load a
172+
snapshot older than 10.6, and therefore it won't be able to "upgrade" a Legacy
173+
snapshot to a UTxO-HD snapshot anymore.
174+
175+
For this reason, the process below is only useful for upgrading from 10.4.x to
176+
10.5.x, and **it must be performed with the `snapshot-converter` version that
177+
was released with nodes 10.5.x**.
178+
179+
:::
180+
181+
Supposing you have copied a legacy snapshot to `<tmpdir>/snapshots/<slotno>` you
182+
can run the following command:
162183

163184
<div class="tabsblock">
164185
<Tabs>

ouroboros-consensus-cardano/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ This package also contains a few executables:
2020

2121
* `app/immdb-server.hs`: serve an immutable DB via ChainSync and BlockFetch.
2222

23+
* `app/snapshot-converter.hs`: converts snapshots among different storage formats.
24+
2325
### Assertions
2426

2527
Our top level `cabal.project` enables assertions in both our local packages
@@ -378,3 +380,23 @@ To point a node to a running ImmDB server, use a topology file like
378380
]
379381
}
380382
```
383+
384+
385+
## snapshot-converter
386+
387+
## About
388+
389+
This tool converts snapshots among the different backends supported by the node.
390+
391+
## Running the tool
392+
393+
Invoking the tool follows the same simple pattern always:
394+
395+
```sh
396+
cabal run snapshot-converter -- <IN> <OUT> --config /path/to/cardano/config.json
397+
```
398+
399+
The `<IN>` and `<OUT>` parameters depend on the input and output format, receiving options:
400+
- `--mem-in PATH`/`--mem-out PATH` for InMemory
401+
- `--lmdb-in PATH`/`--lmdb-out PATH` for LMDB
402+
- `--lsm-database-in DB_PATH --lsm-snapshot-in PATH`/`--lsm-database-out DB_PATH --lsm-snapshot-out PATH` for LSM-trees.

0 commit comments

Comments
 (0)