Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion store/postgres/src/block_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,27 @@ impl BlockStore {
const CHAIN_HEAD_CACHE_TTL: Duration = Duration::from_secs(2);

let mirror = PrimaryMirror::new(&pools);
let existing_chains = mirror.read_async(primary::load_chains).await?;
// Treat a chain whose shard has no connection pool (i.e. a shard
// configured with `pool_size = 0`, which `store_builder` drops) as if it
// doesn't exist: skip it here so we neither create a chain store for it
// nor fail startup. See issue #6195.
let existing_chains: Vec<_> = mirror
.read_async(primary::load_chains)
.await?
.into_iter()
.filter(|chain| {
let has_pool = pools.contains_key(&chain.shard);
if !has_pool {
warn!(
&logger,
"Ignoring chain `{}`: its shard `{}` has no connection pool (pool_size = 0)",
chain.name,
chain.shard,
);
}
has_pool
})
.collect();
let chain_head_cache = TimedCache::new(CHAIN_HEAD_CACHE_TTL);
let chains = shards.clone();

Expand Down