Skip to content

Commit

Permalink
DOSE-1076 [Backport of DOSE-1075 to 6.0.13.0] zoa zettacache::block_a…
Browse files Browse the repository at this point in the history
…llocator::Slab:free panic, zoa restarts every 4 min during stress/scale test (openzfs#247)
  • Loading branch information
Prakash Surya authored Feb 25, 2022
1 parent e35b890 commit cf30636
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions cmd/zfs_object_agent/zettacache/src/zettacache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,22 @@ impl MergeState {
/// When an old index entry already exists for a newly inserted key, the new entry will
/// replace the old, so "evict" the old entry: if the entry is a ghost, then there is
/// nothing to do, otherwise, add the entry to the free list.
async fn evict(&mut self, entry: IndexEntry) {
async fn evict(&mut self, state: &MergeState, entry: IndexEntry) {
if let Some(extent) = entry.value.extent() {
self.frees.push(extent);
match &state.rebalance {
Some(rebalance) => {
// If remap() is None, the data was evicted by the rebalance, so there's
// nothing to free here.
if let Some(location) = rebalance.remap(extent) {
self.frees.push(Extent {
location,
size: extent.size,
});
}
}
None => self.frees.push(extent),
}

if self.entries.len() >= *MERGE_PROGRESS_CHUNK
|| self.frees.len() >= *MERGE_PROGRESS_CHUNK
|| self.cache_updates.len() >= *MERGE_PROGRESS_CHUNK
Expand Down Expand Up @@ -608,7 +621,7 @@ impl MergeState {
if entry.value.location().is_some() {
debug!("Insert of {:?} replaces {:?}", pc_value, entry);
}
progress.evict(entry).await;
progress.evict(self, entry).await;
progress
.ingest(
self,
Expand Down

0 comments on commit cf30636

Please sign in to comment.