Commit 45d54e3
committed
Fix LSM snapshot restoration by resolving double path nesting
The LSM session was being initialised with the full lsmPath as both the
HasBlockIO root and the session's FsPath inside it, producing a doubled
on-disk layout like:
<state-dir>/lsm/<state-dir>/lsm/{active,snapshots,...}
instead of:
<state-dir>/lsm/{active,snapshots,...}.
Effect on snapshots: scripts/postgresql-setup.sh --create-snapshot looks
for the LSM tree at <state-dir>/lsm/snapshots/<slot>, didn't find it
because of the doubled path, silently fell back to the InMemory branch,
and produced a tarball missing the LSM tree files. On --restore-snapshot
+ db-sync startup the snapshot couldn't be loaded (ErrSnapshotDoesNotExist)
and sync replayed from genesis.
Fix:
Pass mkFsPath [] as the session's FsPath so it's rooted at the
HasBlockIO root directly. Also harden the snapshot script to abort with
a clear error when an lsm/ subtree exists but no LSM snapshot is found
at the expected path, instead of producing an incomplete tarball.
Files staged for commit:
- cardano-db-sync/src/Cardano/DbSync/Ledger/State.hs
- scripts/postgresql-setup.sh1 parent d323ee3 commit 45d54e3
2 files changed
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
231 | 237 | | |
232 | 238 | | |
233 | 239 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
179 | 188 | | |
180 | 189 | | |
181 | 190 | | |
| |||
0 commit comments