Skip to content

Commit

Permalink
Fix cache shutdown order (facebookincubator#10239)
Browse files Browse the repository at this point in the history
Summary:
Currently, ssd cache shutdown happens after shard shutdown where entries are cleared. If there is any pending write, the ssd write will fail as the entry no longer exists. Therefore, the shutdown order needs to be reversed.

Pull Request resolved: facebookincubator#10239

Reviewed By: xiaoxmeng

Differential Revision: D58709223

Pulled By: zacw7

fbshipit-source-id: 56e61db69b08743004a99c93fd84006e5772cd63
  • Loading branch information
zacw7 authored and facebook-github-bot committed Jun 18, 2024
1 parent e29f598 commit db287c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions velox/common/caching/AsyncDataCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -676,12 +676,12 @@ AsyncDataCache** AsyncDataCache::getInstancePtr() {
}

void AsyncDataCache::shutdown() {
for (auto& shard : shards_) {
shard->shutdown();
}
if (ssdCache_) {
ssdCache_->shutdown();
}
for (auto& shard : shards_) {
shard->shutdown();
}
}

void CacheShard::shutdown() {
Expand Down

0 comments on commit db287c9

Please sign in to comment.