customize the wallet flush #358
Labels
No labels
area: devops
area: discovery
area: docs
area: livestream
area: proposal
consider soon
Epic
good first issue
hacktoberfest
hard fork
help wanted
icebox
Invalid
level: 0
level: 1
level: 2
level: 3
level: 4
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
on hold
priority: blocker
priority: high
priority: low
priority: medium
resilience
soft fork
Tom's Wishlist
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
work in progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbrycrd#358
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add parameters to change the wallet flush rate. Separate out the disk sync from the lsn_reset.
Questions:
BerkDB does obfuscate the file out of the box, but lbrycrd/bitcoin runs lsn_reset every time it flushes, which effectively resets/disables the machine-specific tie.
@BrannonKing I think this is the real solution https://stackoverflow.com/a/23475187/2038176
I think that call is just really overzealous. As long as we have the log files we don't need to rewrite the whole database with an
lsn_reset
.So the moral to the story is don't allow
lsn_reset
when LSNs don't match.lsn_reset
should probably only be called when the dump wallet command is called, so that it can be moved.Also I would probably never switch from BDB to SQLite. SQLite is not really meant for large amounts of data whereas BDB is. https://www.quora.com/What-is-the-difference-between-SQLite-and-Berkeley-DB
As I understand it, if we remove lsn_reset from the flush and you have a hardware failure then that wallet will be lost forever. Is that acceptable? Can we set up some other kind of wallet export & backup that runs once an hour?
If you review the documentation that is not what it means at all. Thats what someone said on the bitcoin forums. The lsn stands for log sequence numbers, and it uses that to know what additions there are for the for the file, to exactly avoid our situation. People use BDB to store terabytes of data, if they called lsn_reset it would take forever. You call lsn_reset when you want to move the file and not take the log files with it. We can also add some preventative code to avoid making changes with the LSNs dont match. The important thing to do is to make sure there are no uncommitted transactions, but that takes microseconds.
Feel free to do your own research on it but from mine, I don't think that statement is true.
@BrannonKing, @tiger5226 seems relatively confident this
lsn_reset
change would solve this issue and not affect existing behavior. What is the work load to either make this change or ship a version with a flag so it can be tested?If we're uncertain about safety, it seems fine to run a test build in production on internal APIs before properly releasing.
Possible solution in #360
I research a bit more about lsn_reset, it actually randomise the position of private key
bdb might keep bits of the unencrypted private key in slack space in the database file
as we can see in wallet.cpp.
In other hand
txn_checkpoint
is need to be called at periodic time to ensure all changes since last checkpoint are flushed, in case of crash unflushed data will be lost, that's pretty unwanted behaviour at wallet side and it can cause transaction loss. In this case-flushwallet
looks pretty dangerous parameter since it'll skiptxn_checkpoint
call.Fixed in 17.4.1