-
Notifications
You must be signed in to change notification settings - Fork 129
Backup plugin for off-site backups of the local database #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## master #97 +/- ##
==========================================
+ Coverage 47.75% 52.67% +4.92%
==========================================
Files 15 17 +2
Lines 1734 1984 +250
==========================================
+ Hits 828 1045 +217
- Misses 906 939 +33
Continue to review full report at Codecov.
|
38afa59 to
57745da
Compare
Also implements the `stream_changes` function in the FileBackend which is used by `restore` to get all the changes.
The node_factory from pyln-client clears the node directory when provisioning a new node, which interferes with the backup-cli creation of the initial snapshot. This just disables the cleaning until we can release the next pyln-client version
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backups are a major issue in the Lightning Protocol, given that any sort of
dataloss could potentially result in loss of funds. This means that restoring
an old backup of the database could result in the node broadcasting an old
state, which is a cheat attempt in the protocol, which is punished.
This plugin implements the basic mechanisms to create a synchronous backup of
any change to the database, and ensures that the backup stays in sync with the
database. It does so in a generic way allowing to write backups to a variety
of backends, but initially only implements a file-system based backup backend
that is located on the same machine, but on a separate disk. Doing so already
provides protection against data corruption on the primary disk. Potential
future improvements could include:
custommsghookIn the case of a dedicated backup server the plugin could also manage a
subscription that is used to pay for the backup service.