mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
gossipd: gossip_store errors after rewrite are fatal.
We can't continue, since we've moved the indexes. We'll just crash anyway, as seen from bugs #2742 and #2743. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
eb5cc47bdd
commit
24cc371cdf
@ -311,24 +311,23 @@ bool gossip_store_compact(struct gossip_store *gs)
|
||||
"gossip_store: Entry at %zu->%zu not updated?",
|
||||
omap->from, omap->to);
|
||||
|
||||
if (count != gs->count - gs->deleted) {
|
||||
status_broken("Expected %zu msgs in new gossip store, got %zu",
|
||||
if (count != gs->count - gs->deleted)
|
||||
status_failed(STATUS_FAIL_INTERNAL_ERROR,
|
||||
"gossip_store: Expected %zu msgs in new"
|
||||
" gossip store, got %zu",
|
||||
gs->count - gs->deleted, count);
|
||||
goto unlink_disable;
|
||||
}
|
||||
|
||||
if (deleted != gs->deleted) {
|
||||
status_broken("Expected %zu deleted msgs in old gossip store, got %zu",
|
||||
if (deleted != gs->deleted)
|
||||
status_failed(STATUS_FAIL_INTERNAL_ERROR,
|
||||
"gossip_store: Expected %zu deleted msgs in old"
|
||||
" gossip store, got %zu",
|
||||
gs->deleted, deleted);
|
||||
goto unlink_disable;
|
||||
}
|
||||
|
||||
if (rename(GOSSIP_STORE_TEMP_FILENAME, GOSSIP_STORE_FILENAME) == -1) {
|
||||
status_broken(
|
||||
"Error swapping compacted gossip_store into place: %s",
|
||||
strerror(errno));
|
||||
goto unlink_disable;
|
||||
}
|
||||
if (rename(GOSSIP_STORE_TEMP_FILENAME, GOSSIP_STORE_FILENAME) == -1)
|
||||
status_failed(STATUS_FAIL_INTERNAL_ERROR,
|
||||
"Error swapping compacted gossip_store into place:"
|
||||
" %s",
|
||||
strerror(errno));
|
||||
|
||||
status_trace(
|
||||
"Compaction completed: dropped %zu messages, new count %zu, len %"PRIu64,
|
||||
|
Loading…
Reference in New Issue
Block a user