-
Notifications
You must be signed in to change notification settings - Fork 690
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
Switch to ParityDB by default; deprecate RocksDB #1792
base: master
Are you sure you want to change the base?
Conversation
The CI pipeline was cancelled due to failure one of the required jobs. |
) | ||
.map(|_| ()) | ||
.map_err(|e| sp_blockchain::Error::Backend(e.to_string())) | ||
crate::utils::open_kvdb_rocksdb::<Block>(db_path, db_type, true, 128) |
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.
Why not use parity db in this test?
let blob = std::io::Cursor::new(include_bytes!("rocksdb_test_database.zip")); | ||
zip::read::ZipArchive::new(blob).unwrap().extract(&tmpdir).unwrap(); |
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.
Why not just use open_kvdb_rocksdb
?
fn main() -> sc_cli::Result<()> { | ||
command::run() | ||
fn main() { | ||
if let Err(error) = command::run() { |
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.
Why? To use the Display
implementation? Can we not make Debug
use Display
internally?
Thank you for taking action ;-) We're currently working on a major feature in paritydb that will change how state data is stored. That might affect stability. I still think we can make the switch now and roll out this new storage method in a fail safe or experimental manner.
This seems a bit harsh. It will break existing setups that people may have for testing, automation, etc. |
I think it is fine. We want to discourage creating new dbs. You can still use |
took me a month(september) to sync kusama on paritydb with archive mode on 7950x3d + ecc ram + nvme:s in Bangkok, db constantly stopping sync and sync files being. rocksdb syncs in a day or two. that major feature update is said to fix this, but might be something to consider. |
Can you explain more how it is efficient? RocksDB imo much more stable compared to ParityDB and it shouldn't be removed or deprecated at this stage unless all these issues are fixed first. |
@hitchhooker @gituser please open issues in the parity db repo. We need to fix them. However, rocksdb has its own downsides and we don't want to continue to maintain it. |
Are you sure this was due to ParityDB and not a generic syncing issue related to networking? (I have seen e.g. syncing stopping myself too in the past, but that was also on RocksDB and was unrelated to the database used.)
Last time I checked the difference was visibly in favor of ParityDB, unless something changed since that time. From time to time I run performance stress tests where I run a testnet composed of hundreds of nodes on a single machine, and in that test I can run many more nodes when using ParityDB before I hit the memory limit and everything crashes. Anyway, thank you for your feedback. If you see any problems with ParityDB please make sure to open an issue! If people don't report the problems they see we can't fix them. @bkchr Perhaps we should go with a little bit softer deprecation here, just in case there are actually still some showstopper problems related to ParityDB? How about we add a temporary escape hatch, e.g. (So people will have to have And if there will be no new issues reported we can just nuke this parameter in the next release or two. I will also do some testing myself syncing my archive node under ParityDB from scratch a couple of times, just in case. |
@bkchr Big DBs can't sync at all if they have a big gap of unsynchronized in the blocks. I met this a lot of times. It is a little bit dangerous in some cases. ref:
|
recently we had had some cases when we needed to sync new DBs from scratch. We couldn't do it using ParityDB. We were forced to use binary DB snapshots. |
I am absolutely sure that the problem is not in the network or in the machines. We use large instances with huge bandwidth with the fastest disks that the large cloud providers can offer. The issue looks like an overloaded disk subsystem. You can check the screenshots of the load charts in my issue. |
Archive DBs are indeed slower at the moment on most VPC/VPS machines. This is mostly because there's a lot of small random writes going on. The database hits VPC or hardware IOPS limit. Every inserted trie node results in a random write |
GCP SSD PD (that I used in the issue) has performance parameters:
Also, I used my own bare-metal instances with local nvme SSD disks. It doesn't matter. Parity DB can not sync current Polkadot and Kusama state archive DBs from scratch. I feel that the ParityDB database is not stable enough to disable RocksDB. |
Also, I created the feature request #219 that is related to the ParityDB snapshots. It is also relevant because we cannot synchronize the database from scratch and cannot quickly load it from a snapshot in a predictable time at the same time. It's why we are switching from ParityDB to RocksDB for some of our critical nodes right now. |
My setup is designed to reach 250k IOPS read/write per TB at hardware level, but I think ZFS as a filesystem might be the limiting factor for random writes(about 2.5x slower performance than lvm/ext4 for random writes in benchmark). |
ZFS uses 128k IO pages by default, which is suboptimal for DB workloads, especially ones involving small random writes. |
I think main issue for poor performance is just copy on write. Have been running with 16k recordsize for paritydb without really improving benchmarks. Will give 4k a try.
|
I started a Kusama archive sync on GCP server |
Good idea! But just let's do it by |
what I have noticed that zfs is really terrible.
so I doubt that actually the issues with syncing archive paritydb databases are related to use of zfs/btrfs instead just lvm/ext4. I guess copy on write slows down random writes, so probably good idea to recommend to avoid usage of zfs/btrfs for database disks. I think @kogeler had also some alternative filesystem in use. |
11279 ± ./scripts/test_bootnodes.sh [0m]! ✹ ✭ Initialized output directory and JSON file. relaychain: kusama /usr/local/bin/polkadot-parachain --no-hardware-benchmarks --no-mdns -d /tmp/bootnode_data --chain ./chain-spec/people-kusama.json --relay-chain-rpc-urls wss://rpc.ibp.network/kusama --bootnodes /dns/boot-node.helikon.io/tcp/7510/p2p/12D3KooWM1X4setrMWjwnV8iDkAtYhqFHNkGozdWdq6sawWh5Yhv 2024-06-10 12:41:21 [Parachain] ⚙️ Syncing 115.2 bps, target=#175337 (3 peers), best: paritytech#1792 (0x8e56…b18a), finalized #0 (0xc1af…8b3f), ⬇ 943.9kiB/s ⬆ 10.7kiB/s helikon people-kusama peer_count: 3 relaychain: kusama /usr/local/bin/polkadot-parachain --no-hardware-benchmarks --no-mdns -d /tmp/bootnode_data --chain ./chain-spec/people-kusama.json --relay-chain-rpc-urls wss://rpc.ibp.network/kusama --bootnodes /dns/boot-node.helikon.io/tcp/7512/wss/p2p/12D3KooWM1X4setrMWjwnV8iDkAtYhqFHNkGozdWdq6sawWh5Yhv 2024-06-10 12:41:47 [Parachain] ⚙️ Syncing 115.2 bps, target=#175339 (2 peers), best: #1024 (0x2970…7678), finalized #0 (0xc1af…8b3f), ⬇ 541.6kiB/s ⬆ 14.4kiB/s helikon people-kusama peer_count: 2 All data has been fetched and saved.
11279 ± ./scripts/test_bootnodes.sh [0m]! ✹ ✭ Initialized output directory and JSON file. relaychain: kusama /usr/local/bin/polkadot-parachain --no-hardware-benchmarks --no-mdns -d /tmp/bootnode_data --chain ./chain-spec/people-kusama.json --relay-chain-rpc-urls wss://rpc.ibp.network/kusama --bootnodes /dns/boot-node.helikon.io/tcp/7510/p2p/12D3KooWM1X4setrMWjwnV8iDkAtYhqFHNkGozdWdq6sawWh5Yhv 2024-06-10 12:41:21 [Parachain] ⚙️ Syncing 115.2 bps, target=#175337 (3 peers), best: paritytech#1792 (0x8e56…b18a), finalized #0 (0xc1af…8b3f), ⬇ 943.9kiB/s ⬆ 10.7kiB/s helikon people-kusama peer_count: 3 relaychain: kusama /usr/local/bin/polkadot-parachain --no-hardware-benchmarks --no-mdns -d /tmp/bootnode_data --chain ./chain-spec/people-kusama.json --relay-chain-rpc-urls wss://rpc.ibp.network/kusama --bootnodes /dns/boot-node.helikon.io/tcp/7512/wss/p2p/12D3KooWM1X4setrMWjwnV8iDkAtYhqFHNkGozdWdq6sawWh5Yhv 2024-06-10 12:41:47 [Parachain] ⚙️ Syncing 115.2 bps, target=#175339 (2 peers), best: #1024 (0x2970…7678), finalized #0 (0xc1af…8b3f), ⬇ 541.6kiB/s ⬆ 14.4kiB/s helikon people-kusama peer_count: 2 All data has been fetched and saved.
Hi, is making ParityDB default something you are still working on? If so, when would you expect this to be done? We are wondering which DB we should use, and knowing what your plans related to this PR are would be helpful. |
We are still waiting for this. |
The parity-db feature is complete and the integration into substrate was pending testing with this PR: #4176 |
So I assume #4176 is the sole blocker here – do you have an (approximate ofc) expected date of delivery? Asking mostly since the last activity there is from a couple months ago. |
ParityDB seems to be stable and work pretty well, and it's significantly more efficient than RocksDB, so let's finally switch to it by default and get rid of RocksDB.
This PR disables the ability to create new RocksDB databases and makes ParityDB the default database used.
Existing RocksDB databases are still supported and will still work, but will emit a warning about its deprecation.
Here's how the error looks like when starting a Polkadot node with a
--database rocksdb
where there's no existing RocksDB database present:And here's the deprecation warning if a RocksDB database already exists: