You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#4718 Introduces Redb as another database implementation for the beacon node. According to most metrics we've seen so far, its performance is on-par with leveldb in most cases. One case in which it is drastically underperforming is at temp state cleanup during a node restart. The latest restart on holesky took roughly 1.5 hours!
let _timer = metrics::start_timer(&metrics::DISK_DB_DELETE_TIMES);
let table_definition:TableDefinition<'_,&[u8],&[u8]> =
TableDefinition::new(&column);
letmut table = tx.open_table(table_definition)?;
table.remove(key.as_slice())?;
drop(table);
}
}
}
tx.commit()?;
Ok(())
}
The way this function is structured, we are constantly opening and closing write transactions during each iteration. Since Redb only allows for one open write transaction at a time, and write transactions can only be opened against individual tables, we will need to refactor our garbage collection logic to conform to Redb functionality.
My best idea so far is to make the garbage collection logic atomic on a per table basis. Instead of passing in an ops vec that contains transactions across multiple tables, we create a vec for each table. We can then pass each vec into a new function that keeps a single write transaction open across the full vec of ops. As long as we're ok with garbage collection only being atomic across individual tables, this should help us get to the performance were looking for.
I think Michael also mentioned that tree-states will help us reduce the amount of temp states being stored in general.
The text was updated successfully, but these errors were encountered:
Description
#4718 Introduces Redb as another database implementation for the beacon node. According to most metrics we've seen so far, its performance is on-par with leveldb in most cases. One case in which it is drastically underperforming is at temp state cleanup during a node restart. The latest restart on holesky took roughly 1.5 hours!
The issue can be found in
do_atomically
lighthouse/beacon_node/store/src/database/redb_impl.rs
Lines 166 to 203 in 06490d4
The way this function is structured, we are constantly opening and closing write transactions during each iteration. Since Redb only allows for one open write transaction at a time, and write transactions can only be opened against individual tables, we will need to refactor our garbage collection logic to conform to Redb functionality.
My best idea so far is to make the garbage collection logic atomic on a per table basis. Instead of passing in an
ops
vec that contains transactions across multiple tables, we create a vec for each table. We can then pass each vec into a new function that keeps a single write transaction open across the full vec ofops
. As long as we're ok with garbage collection only being atomic across individual tables, this should help us get to the performance were looking for.I think Michael also mentioned that tree-states will help us reduce the amount of temp states being stored in general.
The text was updated successfully, but these errors were encountered: