-
Notifications
You must be signed in to change notification settings - Fork 44
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
feat(backup): write xud db every 3 minutes max #1655
Conversation
a269867
to
fe5b0ea
Compare
You can run this with |
Tested this today on the same setup from yesterday:
Swaps are still comparably slow but faster compared to yesterday (ltc/btc swaps in about 10s total time to complete). Nowhere near the 30s timeout. eth/btc still hits the timeout in most cases. As per our recommended setup, backups are written to an external USB pen drive on both machines, so backup writes should not influence disk I/O on the main disk where the main xud db resides. Reads/locks of the xud main db will. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran this branch on two environments, swapping on testnet. Watched the xud backup file change and (on taker side) there are still changes being made to the backup file during the swap and are not delayed to the next 3 minutes interval (xud backup file changed at 10:15 and 10:16, where I did a swap):
kilrau@beast:/media/USB/xud-backup/02-Testnet$ ls -la
total 84
drwxr-xr-x 2 root root 4096 Jun 8 16:10 .
drwxr-xr-x 5 root root 4096 May 1 11:34 ..
-rw-r--r-- 1 root root 461 Jun 12 16:04 lnd-BTC
-rw-r--r-- 1 root root 461 Jun 12 16:04 lnd-LTC
-rw-r--r-- 1 root root 69632 Jun 13 10:15 xud
kilrau@beast:/media/USB/xud-backup/02-Testnet$ ls -la
total 84
drwxr-xr-x 2 root root 4096 Jun 8 16:10 .
drwxr-xr-x 5 root root 4096 May 1 11:34 ..
-rw-r--r-- 1 root root 461 Jun 12 16:04 lnd-BTC
-rw-r--r-- 1 root root 461 Jun 12 16:04 lnd-LTC
-rw-r--r-- 1 root root 69632 Jun 13 10:16 xud
kilrau@beast:/media/USB/xud-backup/02-Testnet$
On maker side the db changes in larger intervals and not during the swap. But I didn't test this thoroughly enough to verify that it is different on maker/taker side, so I might be wrong here.
Backup tests need to be adjusted:
And can you comment out that raiden db test for now?
|
These tests should be either removed completely or need to be rewritten since the functionality of the backup daemon changed. |
fe5b0ea
to
57669c2
Compare
I updated the tests to conform to the new backup approach. |
#1655 (review) still needs to be addressed though. Can do some more testing today if required. |
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.
57669c2
to
cfdf8b6
Compare
@kilrau In my tests I confirmed this is only updating the backup at most every 3 minutes, can you please double check on your end if you're still seeing that behavior? And confirm xud is on commit |
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.