Skip to content

Commit

Permalink
chore: increase max dbs
Browse files Browse the repository at this point in the history
  • Loading branch information
onbjerg committed Aug 28, 2023
1 parent 72b211e commit aa50e96
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/storage/db/src/implementation/mdbx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ impl<E: EnvironmentKind> Env<E> {
};

let mut inner_env = Environment::new();
inner_env.set_max_dbs(Tables::ALL.len());

// Note: We set max dbs to 256 here to allow for custom tables. This needs to be set on environment creation.
debug_assert!(Tables::ALL.len() <= 256, "number of tables exceed max dbs");
inner_env.set_max_dbs(256);
inner_env.set_geometry(Geometry {
// Maximum database size of 4 terabytes
size: Some(0..(4 * TERABYTE)),
Expand Down Expand Up @@ -116,7 +119,7 @@ impl<E: EnvironmentKind> Env<E> {
LogLevel::Extra => 7,
});
} else {
return Err(DatabaseError::LogLevelUnavailable(log_level))
return Err(DatabaseError::LogLevelUnavailable(log_level));
}
}

Expand Down

0 comments on commit aa50e96

Please sign in to comment.