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

Migrate LMDB database to RocksDB with new CLI command #2979

Merged
merged 7 commits into from
Oct 23, 2020

Conversation

wezrule
Copy link
Contributor

@wezrule wezrule commented Sep 25, 2020

This adds a new CLI command --migrate_database_lmdb_to_rocksdb which takes the LMDB database, deletes the RocksDB folder if it exists and creates an equivalent RocksDB ledger.

This adds the necessary parallel for loops for the required tables, should be rebased after #2950 is in.

@wezrule wezrule added enhancement documentation This item indicates the need for or supplies updated or expanded documentation cli Changes related to the Command Line Interface labels Sep 25, 2020
@wezrule wezrule self-assigned this Sep 25, 2020
@wezrule wezrule requested review from guilhermelawless and SergiySW and removed request for guilhermelawless September 25, 2020 12:36
@wezrule wezrule changed the title Migrate LMDB database to RocksDB Migrate LMDB database to RocksDB CLI command Sep 25, 2020
@wezrule wezrule changed the title Migrate LMDB database to RocksDB CLI command Migrate LMDB database to RocksDB with new CLI command Sep 25, 2020
@guilhermelawless
Copy link
Contributor

Mainnet migration at ~55M blocks:

  • 19GB at the end from a 30GB data.ldb, took 13 minutes on a Ryzen 3600 and NVME SSD, 16GB RAM
  • 19GB at the end from a 22GB data.ldb, took 28 minutes on a i5-6600 and SATA SSD, 8GB RAM

Second one produced a message "There was an error migrating" but everything seems fine after migrating, investigating.

@zhyatt zhyatt added this to the V22.0 milestone Oct 6, 2020
@SergiySW
Copy link
Contributor

22GB from 21GB data.ldb. 29 minutes on i7-4970K and SATA SSD. 16GB RAM

@wezrule wezrule merged commit 88cb6e3 into nanocurrency:develop Oct 23, 2020
@wezrule wezrule deleted the migrate_lmdb_to_rocksdb branch October 23, 2020 12:56
@zhyatt zhyatt mentioned this pull request Feb 9, 2021
20 tasks
@qwahzi
Copy link
Collaborator

qwahzi commented Mar 12, 2021

Worked nicely for me on V22DB11, even without being fully synced (had ~1.7M blocks), took ~5 minutes to convert. First launch afterwards was still LMDB, but then I realized I needed to update my config-node.toml. Should this be done by default for v22+? I'm assuming RocksDB will be the preferred production backend

`[node.rocksdb]

Whether to use the RocksDB backend for the ledger database.

type:bool

enable = true`

@whalemachine
Copy link
Contributor

whalemachine commented Mar 15, 2021

Successful on 22DB11, 4 minutes. 4670k@4.5ghz, 16GB, 1TB sata SSD. Ledger 5.8GB to 3.5GB. Ubuntu 20.04.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Changes related to the Command Line Interface documentation This item indicates the need for or supplies updated or expanded documentation enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants