-
Notifications
You must be signed in to change notification settings - Fork 293
Allow to preserve legacy DBs layout, use leveldb-only layout by default #357
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
Allow to preserve legacy DBs layout, use leveldb-only layout by default #357
Conversation
I think Opera should throw an error when trying to use Currently it continues the reformat and fails on broken database:
|
integration/legacy_migrate.go
Outdated
@@ -186,7 +186,7 @@ func translateGossipPrefix(p byte) byte { | |||
return p | |||
} | |||
|
|||
func migrateLegacyDBs(chaindataDir string, dbs kvdb.FlushableDBProducer) error { | |||
func migrateLegacyDBs(chaindataDir string, dbs kvdb.FlushableDBProducer, mode string) error { | |||
if !isEmpty(path.Join(chaindataDir, "gossip")) { |
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 think this check is not much necessary due to we already check it before calling the function migrateLegacyDBs()
; it's okay to re-check inside the function but I prefer to use short circuit as below to reduce one long nested if condition
if !isEmpty(path.Join(chaindataDir, "gossip")) { | |
if isEmpty(path.Join(chaindataDir, "gossip")) { | |
return null | |
} |
I think it only migrate the legacy preset via this checking? if legacy preset is presented then the
|
If I understand correctly then the from preset layout in the case of
so the |
That's right,
So I have to either:
|
Implemented this in dff7354 |
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.
LGTM
Co-authored-by: rus-alex <[email protected]>
Co-authored-by: rus-alex <[email protected]>
Co-authored-by: rus-alex <[email protected]>
Co-authored-by: rus-alex <[email protected]>
Hey team, I have a question here. Also, if there's a more appropriate medium to ask besides this comments section, please let me know. I am attempting to run a fresh archive node sync using txtracing/1.1.2-rc.6 on PebbleDB, while also using genesis I'm running an archive node today with the following flags:
Thanks, |
TL;DR: If you used 1.1.2-rc.6 with Pebble to initialise the DB from genesis, you don't need to do anything else.
The genesis file contains data needed to start a node, in this case including full state history, but in a general form. It doesn’t really convey the low level data storage format, just the keys and values needed to reconstruct the desired state. So if you use it to initialise a node, it will use your DB backend setting and layout preset even for the data state reconstruction at the beginning of the process. It basically reloads the data like a restore from a backup.
… On 11. 5. 2023, at 21:17, Yannick Monye ***@***.***> wrote:
Hey team, I have a question here. Also, if there's a more appropriate medium to ask besides this comments section, please let me know.
I am attempting to run a fresh archive node sync using txtracing/1.1.2-rc.6 on PebbleDB, while also using genesis mainnet-109331-full-mpt.g to retain archival data. Once my node finishes initializing with the archive genesis file, would I still need to rebuild the database for this v1.1.2-rc6 release? I'm not exactly sure if initializing the genesis file with the PebbleDB flags automatically converts all historical states to a PebbleDB format, but I've been running a node for a while & wanted to ensure everything was done properly.
I'm running an archive node today with the following flags:
/blockchain/clients/ftm/go-opera/build/opera --genesis=/blockchain/nodes/ftm/go-opera/mainnet/mainnet-109331-full-mpt.g --syncmode=full --gcmode=archive --db.preset=pbl-1 --port=30305 --http --http.vhosts="*" --http.corsdomain="*" --http.addr=0.0.0.0 --http.port=8545 --ws --ws.origins="*" --ws.addr=0.0.0.0 --ws.port=8546 --datadir=/blockchain/nodes/ftm/go-opera/mainnet --tracenode --tracing --http.api="ftm,eth,debug,admin,web3,personal,net,txpool,sfc"
Thanks
—
Reply to this email directly, view it on GitHub <#357 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AFTFDZNZ52KRFWNOQUYUZ73XFU3N7ANCNFSM575JVLCA>.
You are receiving this because your review was requested.
|
Thanks! |
1.1.1-rc.2-pebble
). ldb-1 is used by default instead of pbl-1.reformat
mode for multidb migration for instant migration with unaltered DBs layoutMigration options:
--db.migration.mode reformat --db.preset legacy-ldb
--db.migration.mode reformat --db.preset legacy-pbl
--db.migration.mode rebuild
Flag
--db.migration.mode
is required only if datadir isn't migrated.