Skip to content

Commit

Permalink
Unload shard when ownership lost (#2355)
Browse files Browse the repository at this point in the history
  • Loading branch information
yiminc committed Jan 7, 2022
1 parent 9ca8598 commit 5efdf07
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion service/history/shard/controller_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,10 @@ func (c *ControllerImpl) acquireShards() {
c.contextTaggedLogger.Error("Unable to create history shard context", tag.Error(err), tag.OperationFailed, tag.ShardID(shardID))
}
cancel()
} else {
// current host is not owner of shard, unload it if it is already loaded.
c.CloseShardByID(shardID)
}
// TODO: If we're _not_ the owner for this shard, and we have it loaded, we should unload it.
}
}
}
Expand Down

0 comments on commit 5efdf07

Please sign in to comment.