Migrate from lmdb-zero to heed#3825
Conversation
…atches, fix exists check at batch
…n-default environment name
…values without prefixes, migrate old environment
|
Compiled master branch with this PR and got the following core dump: Stopped at: Not sure if the above stack is the place where the crash occurred, or just Linux defaulted to show thread 1 for |
… migration to interrupt process
| .write() | ||
| .get_mut(&env_path) | ||
| .unwrap() | ||
| .resizing |
There was a problem hiding this comment.
I think there is still a small race here, right? We check that open_txs_count is 0 first, and only then set resizing to true. In between, a new transaction could start because wait_for_resize() only blocks once resizing is true. Would it be safer to set resizing = true`before waiting for the open transactions to drain, then resize once the count reaches 0?
There was a problem hiding this comment.
we also set resize_checking to true to avoid blocking of existing transactions so its must be safe to resize only when there is really 0 txs count and only 1 check is active. if we'll put resizing before checking txs count it will stuck at the loop of iterator with single opened tx since we are waiting resize to finish. If env.resize method will fail, it will be called again at next check.
Migrate from non-maintained lmdb-zero to heed.
peersandchaindata, migrate existing dbs outside defaultlmdbenvironment (solves Use multiple LMDB dbs (tables) #3461)