|
285 | 285 | public-only path sees a ~42% speedup; on the previous code it could stall |
286 | 286 | for minutes. |
287 | 287 |
|
| 288 | +* [Tombstone closed channels on KV-over-SQL |
| 289 | + backends](https://github.com/lightningnetwork/lnd/pull/10780). Closing a |
| 290 | + long-lived channel previously issued a single `DeleteNestedBucket` inside |
| 291 | + the close transaction. On the kvdb-on-SQL schema (sqlite, postgres) that |
| 292 | + delete fans out into a row-by-row `ON DELETE CASCADE` over the channel's |
| 293 | + revocation log and forwarding-package bucket, holding the database |
| 294 | + write-lock for many seconds — long enough on channels with millions of |
| 295 | + states to stall HTLC forwarding, time out htlcswitch retries, and trigger |
| 296 | + force-close cycles. `CloseChannel` now skips the cascading delete on |
| 297 | + these backends; the outpoint-index flip from `outpointOpen` to |
| 298 | + `outpointClosed` (already performed by the existing close path) is the |
| 299 | + authoritative closed-channel marker, and every reader of the open-channel |
| 300 | + bucket consults it before treating a channel as open. The bulk historical |
| 301 | + state — the chanBucket itself, the revocation log, and the per-channel |
| 302 | + forwarding-package bucket — remains on disk for the channel's lifetime in |
| 303 | + this database and is reclaimed wholesale by the upcoming native-SQL |
| 304 | + channel-state migration. bbolt and etcd retain the synchronous one-shot |
| 305 | + close path, where nested-bucket deletion is already cheap. |
| 306 | + |
| 307 | + > ⚠️ **Downgrade warning.** On sqlite/postgres, once a channel is |
| 308 | + > closed under this build the chanBucket and its nested state remain |
| 309 | + > on disk; the close is signalled only by the `outpointClosed` flip |
| 310 | + > in the outpoint index. Earlier `lnd` releases do not consult that |
| 311 | + > flip when iterating `openChannelBucket`, so downgrading to a |
| 312 | + > pre-0.21 binary after closing channels on these backends will |
| 313 | + > resurrect those channels as open in `listchannels`, |
| 314 | + > `pendingchannels`, and the chain-watch path. Operators who close |
| 315 | + > channels on sqlite/postgres after upgrading should treat the |
| 316 | + > upgrade as one-way for that database; bbolt and etcd users are unaffected |
| 317 | + > because the close path on those backends still deletes the chanBucket. |
| 318 | +
|
288 | 319 | ## Deprecations |
289 | 320 |
|
290 | 321 | ### ⚠️ **Warning:** Deprecated fields in `lnrpc.Hop` will be removed in release version **0.22** |
|
0 commit comments