-
Notifications
You must be signed in to change notification settings - Fork 707
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
Delete full db directory with purge-chain
subcommand
#1786
Conversation
It would be better to pass |
If we nuke the entire |
That's a good point. Still, in addition to the main database and the parachain db, there is other stuff that needs to be deleted. The statement store database added in paritytech/substrate#13701 in particular. |
Hmm, this would then also mean that we delete the keystore. I don't think we should do this. We could maybe introduce a new cli command |
Alright, then this is good for now. |
There was actually a test that was testing that parachains db survived. It mentioned one should use |
I remember deleting the parachain db being useful in some cases, at the time the point was that this could be safely deleted and would be restored from peers while keeping the substrate db. |
In general, it's not safe for more than 1/3 of validators to delete parachains db folder (or at least not used to be), but deleting the substrate db should be ok as long as there's one (full) node with the latest block. This is probably the reason why we had this |
Closes paritytech#1767 Until now the `purge-chain` command would only remove the `full` subfolder of the db folder. However there is also the `parachains` db that currently remains and can cause problems on node restart. Example wiht old code: ``` polkadot purge-chain --database paritydb --base-path /tmp/some-folder Are you sure to remove "/tmp/some-folder/chains/polkadot/paritydb/full"? [y/N]: y "/tmp/some-folder/chains/polkadot/paritydb/full" removed. ``` In this case `/tmp/some-folder/chains/polkadot/paritydb/parachains` would remain and might cause problem on node restart because of version conflicts as described in paritytech#1767. After this PR the whole `/tmp/some-folder/chains/polkadot/paritydb` folder will be deleted.
Closes #1767
Until now the
purge-chain
command would only remove thefull
subfolder of the db folder. However there is also theparachains
db that currently remains and can cause problems on node restart.Example wiht old code:
In this case
/tmp/some-folder/chains/polkadot/paritydb/parachains
would remain and might cause problem on node restart because of version conflicts as described in #1767. After this PR the whole/tmp/some-folder/chains/polkadot/paritydb
folder will be deleted.