-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Conversation
In general it is better to separate different types of data into different columns and not invent key schemes. So +1 from me.
I think it's fine if
|
@cheme Can you add a warning or a migration or something? A note in a PR that nobody in the validator community reads is not enough to inform the community. Many validators use paritydb already and will be caught by surprise if their node suddenly stops working. We can also provide a |
writing a migration sounds like a good idea (at least from rocksdb to paritydb it is easy), will do nw. |
There are labels for this like "migation needed" "breaks api" "breaks everything" |
I don't think migration from rocksdb to paritydb is needed at this point. The whole point of introducing
@cheme Is that really the case? Changes in paritydb related to tree index support are backwards compatible with existing database format (version 5). Are they not? |
yes changes are backward compatible (untested but it was written to be). At first I did implement 'auto' to keep using existing db, but I switch that off during review :(. I could revert (I remember testing the use case). |
This is how "auto" is supposed to work at the moment:
|
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.
A node with paritydb synced successfully on Versi and an issue has been created for further improvements mentioned in this PR. So LGTM.
As for the migration, UIUC validators running with --db=auto
will continue to have rocksdb as a backend for the parachain db, unless they purge the db (but the ones with --db=paritydb-experimental
will create one from scratch). Whether they are advised to use auto
or purge the parachains db should be clarified in the release notes.
That is, that they'll instantiate a new DB but won't require resync?
I suspect that we should see how consensus behaves when all nodes use paritydb (it would be great to have this as a ZombieNet test, can you file an issue for that?) |
Yes, AFAIK, purging the parachains DB doesn't require a resync (of the main DB). But another test won't hurt: https://github.com/paritytech/devops/issues/1423#issuecomment-1046612572.
|
cea49b3 did change 'auto' to not change db. |
This was successfully tested.
Not sure what you mean? I think |
Do we know how many? Because if they all start with empty parachains db and they are more than 1/3, it might cause some problems with finality. Code-wise, this PR is good to go IMHO unless we hear some objections today. |
This reverts commit cea49b3.
yes, the change I did (revert of cea49b3), revert to using parity-db for parachains whenever it is used as main database (even when using 'auto'). That was the conclusion of a conversation with @arkpar yesterday: basically there is no sense in using two different database if switching is smooth. On a different topic, I did implement a first version of remove prefix for paritydb and code is not as simple as I wanted, so I am not sure anymore if it is a good idea (paritytech/parity-db@master...cheme:remove_range). |
Let's wait for the results of https://github.com/paritytech/devops/issues/1423#issuecomment-1047852355 and then merge it if successful. |
bot merge |
This PR remove rocksdb usage for users that are using paritydb.
Note that users that are currently using paritydb would need to purgedb and resync.
Few things that could be added/change:
Parity-db do not use the cache parameter. This ae177bc could add a simple keyvalue cache , not sure if needed, not even sure it would really help performance.
avstore meta an chain selection column are fully switched to ordered, 8b66d0a could also move content that requires ordering to their own collection (paritydb only) for better performances.
Using a specific trait for the database is not strictly mandatory, can remove it and just use plain
KeyValueDb
, but the trait could be use for future changes (keyvaluedb trait for instance misses errors for iterator).write_lock may not be necessary, but I do not know polkadot internal enough to assume there is no concurrent writes (would be strange).
bridge code, I started updated it, but revert the changes in ccc0c8f as the content is not really up to date, probably recent code is in https://github.com/paritytech/parity-bridges-common
the directories are looking like this : chains/polkadot/paritydb/full for all substrate db file chains/polkadot/paritydb/parachains for all polkadot db files.
So purge-db command in substrate should be extended with a
--parachains
arguments (see test).