Commit Graph

32 Commits

Author SHA1 Message Date
fmhoeger
46f28a88a2 Fix backup plugin
Update required Python version
Update pyln and other packages
Update README
2024-02-12 20:40:57 +00:00
Chris Guida
3754a9e0f8 Demote autopilot, backup, donations, drain, helpme, historian, paytest, probe, prometheus, rebalance, and summary to the archive
drain: fix drain msats
drain: failing CI because of msats
historian: add inotify to historian deps
historian: update lockfile
2024-02-06 20:29:25 +00:00
Michael Schmoock
6ab4d35003 backup: nits assert without parentheses 2022-12-31 14:55:43 +01:00
Michael Schmoock
7f18073a3a backup: fix flake8 code nits 2022-12-31 14:55:43 +01:00
Christian Decker
7ef9e6c172 docs: Rename from c-lightning to core-lightning for local plugins 2022-05-13 18:07:13 +02:00
Wladimir J. van der Laan
804a9bb290 backup: Implement network backup 2021-02-04 13:06:41 +01:00
Michael Schmoock
4a9df896ad backup: fix deadlock by removing the sqlite3 check
I commented out that check and placed a NOTE that future developers
to see upfront putting in RPC stuff in init is potentially bad.
2021-02-01 14:33:46 +01:00
Christian Decker
c32894bd08 backup: Implement compaction for FileBackend
Compaction for the FileBackend involves restoring the DB from the
backup, up to the penultimate state, then taking a snapshot of the
restored DB, and then appending the last change to the backup. The new
backup is then atomically swapped with the old backup.

The special treatment for the last change is necessary as usual due to
the rewind functionality, otherwise we'd be in an un-rewindable state,
which can cause trouble if c-lightning died without committing the
last change.
2021-01-16 13:29:37 +01:00
Christian Decker
2037240353 backup: Add scaffolding for compactions 2021-01-16 13:29:37 +01:00
Christian Decker
d28d68cb16 backup: Ensure entries in the tx are bytes
We could end up in some cases with string-encoded statements.
2021-01-16 13:29:37 +01:00
Wladimir J. van der Laan
a6afc5a612 backup: Increase version_count after each version
Fix #183.
2020-12-18 19:42:16 +01:00
Michael Schmoock
1f05674b5b backup: cleanup flake8 nits 2020-12-11 11:01:02 +01:00
Michael Schmoock
be523aa54f backup: restore default filename lightningd.sqlite3 2020-12-11 11:01:02 +01:00
Christian Decker
092b295d06 backup: Rewrite erroneously expanded SQL stmts on-the-fly
Seems to have little to no performance impact.
2020-12-11 10:52:23 +01:00
Michael Schmoock
0cbee3fc48 backup: fix loglevel to just INFO 2020-11-27 12:05:51 +01:00
Christian Decker
3a1a89ecf8 backup: Add a warning about the deprecated backup-destination flag 2020-11-25 19:26:44 +01:00
Christian Decker
f34787d065 backup: Rely solely on backup.lock and do not cache writes
Caching writes was causing us some issues if the startup of
`lightningd` didn't complete, i.e., the writes would happen on the
live DB, but we'd forget about them. Since we have the backup.lock
file in same directory as the plugin is running in, we no longer have
to defer the writes. This hugely simplifies our logic.

Fixes #155

Changelog-Fixed: backup: The plugin doesn't lose sync anymore if the startup is interrupted
2020-11-25 19:26:44 +01:00
Christian Decker
630d385a0b backup: Mark the backup-destination option as UNUSED
We'll start relying solely on the `backup.lock` file generated by the
`backup-cli`. But we keep the option so we don't automatically break
all configs that simply updated.
2020-11-25 19:26:44 +01:00
Christian Decker
a1f005012a backup: Perform preflight checks before entering the plugin loop 2020-05-18 22:44:49 +02:00
Christian Decker
fbc494ec23 backup: Kill lightningd instead of the roundabout way around
Looking up the process parents and searching for `lightnignd` allows us to
kill directly. It also means we no longer have to wait for the RPC to be
enabled to abort.
2020-05-18 22:44:49 +02:00
Christian Decker
9b5a9076d4 backup: Fix flaky test due to logs being dropped on shutdown
We were writing logs directly before killing `lightningd` which resulted in
the logs being lost. The subsequent check for the log-lines then would fail
obviously.
2020-05-18 22:44:49 +02:00
Michal Rostecki
e7c1ae60a1 backup: Remove duplicate call of initialize()
Before this change, backup backend was initialized twice - in on_init()
and get_backend() functions. This change leaves only one call in
get_backend() and adds a kwarg determining whether init failure should
be fatal.

Signed-off-by: Michal Rostecki <mrostecki@mailfence.com>
2020-04-15 21:00:30 +02:00
Christian Decker
ef31a4ac85 backup: Refuse to create a new FileBakend if the backing file exists 2020-04-12 19:35:21 +02:00
Christian Decker
ce49404eb4 backup: Add PRAGMA foreign_keys=on when restoring so cascades work
We heavily rely on foreign key constraints to keep the DB consistent and drop
dependent objects such as UTXO set entries when we roll back a block. We also
need to enable the foreign key constraints when restoring otherwise these
dependents are not removed and we run into constraint violations.
2020-04-12 19:35:21 +02:00
Christian Decker
a68758b1d0 backup: Implement the restore method for all backends
Also implements the `stream_changes` function in the FileBackend which is used
by `restore` to get all the changes.
2020-04-12 19:35:21 +02:00
Christian Decker
caa5c0a16b backup: Add the version to the FileBackend format 2020-04-12 19:35:21 +02:00
Christian Decker
8f2eea2840 backend: Make sure that initialize initializes the metadata 2020-04-12 19:35:21 +02:00
Christian Decker
4c146bf2a4 backend: Use th backup URL in backup-cli and add snapshot type to FileBackend 2020-04-12 19:35:21 +02:00
Christian Decker
c58e675877 backup: Ensure at startup that the backup backend was initialized 2020-04-12 19:35:21 +02:00
Christian Decker
97c702731a backup: Add a bit more documentation to the abstract backend class 2020-04-12 19:35:21 +02:00
Christian Decker
4e19c32444 backup: Add backup-cli tool and use it to initialize the backups 2020-04-12 19:35:21 +02:00
Christian Decker
c049069cff backup: Initial version of the backup plugin 2020-04-12 19:35:21 +02:00