Skip to content
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

[xud-backup] new approach preventing corrupted states & locking xud's main db #1652

Open
kilrau opened this issue Jun 12, 2020 · 0 comments
Open
Assignees
Labels
database Database related issues P3 low priority

Comments

@kilrau
Copy link
Contributor

kilrau commented Jun 12, 2020

post-1.0.0

The problem: currently it could happen that xud-backup backs up the db in a corrupted state (e.g. in the middle of a write) with the current "copy the whole db every time" approach because as far as I see it, we don't lock the db (and best case we shouldn't). Albeit not being trivial (from a first google search), we'd need to revisit this and switch to a different approach.

Approaches that come to mind:

Let's research and discuss options we have.

@kilrau kilrau added P3 low priority database Database related issues labels Jun 12, 2020
@kilrau kilrau changed the title [xud-backup] sql-based backup to prevent backing up corrupted states [xud-backup] sql-based backup to prevent backing up corrupted states & locking the db Jun 12, 2020
@kilrau kilrau changed the title [xud-backup] sql-based backup to prevent backing up corrupted states & locking the db [xud-backup] new approach preventing corrupted states & locking the db Jun 12, 2020
sangaman added a commit that referenced this issue Jun 12, 2020
This changes the behavior of the xud backup from backing up the xud db
every time it changes (which is very often) to every 3 minutes, provided
that it has changed in the preceding 3 minutes. Note that this approach
still needs refinement to prevent corrupted backups as described in
issue #1652.

Closes #1368.
sangaman added a commit that referenced this issue Jun 12, 2020
This changes the behavior of the xud backup from backing up the xud db
every time it changes (which is very often) to every 3 minutes, provided
that it has changed in the preceding 3 minutes. Note that this approach
still needs refinement to prevent corrupted backups as described in
issue #1652.

Closes #1368.
@kilrau kilrau changed the title [xud-backup] new approach preventing corrupted states & locking the db [xud-backup] new approach preventing corrupted states & locking xud's main db Jun 12, 2020
sangaman added a commit that referenced this issue Jun 15, 2020
This changes the behavior of the xud backup from backing up the xud db
every time it changes (which is very often) to every 3 minutes, provided
that it has changed in the preceding 3 minutes. Note that this approach
still needs refinement to prevent corrupted backups as described in
issue #1652.

Closes #1368.
sangaman added a commit that referenced this issue Jun 16, 2020
This changes the behavior of the xud backup from backing up the xud db
every time it changes (which is very often) to every 3 minutes, provided
that it has changed in the preceding 3 minutes. Note that this approach
still needs refinement to prevent corrupted backups as described in
issue #1652.

Closes #1368.
raladev pushed a commit that referenced this issue Jun 16, 2020
* refactor(backup): remove raiden

* feat(backup): write xud db every 3 minutes max

This changes the behavior of the xud backup from backing up the xud db
every time it changes (which is very often) to every 3 minutes, provided
that it has changed in the preceding 3 minutes. Note that this approach
still needs refinement to prevent corrupted backups as described in
issue #1652.

Closes #1368.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database Database related issues P3 low priority
Projects
None yet
Development

No branches or pull requests

3 participants