Skip to content

Commit 9aaff62

Browse files
committed
wip: aggressive location prune for QT_PREFIX_MATCH simplified logic v3
1 parent f702af0 commit 9aaff62

1 file changed

Lines changed: 4 additions & 14 deletions

File tree

kv_cache_manager/manager/meta_searcher.cc

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -119,33 +119,23 @@ ErrorCode MetaSearcher::PrefixMatchBestLocationImpl(RequestContext *request_cont
119119
if (!prune_keys.empty()) {
120120
for (; i != keys.size(); ++i) {
121121
if (result.error_codes[i] != ErrorCode::EC_OK) {
122-
break;
122+
continue;
123123
}
124-
125124
int64_t begin_deserialize_time = TimestampUtil::GetCurrentTimeUs();
126125
BlockCacheLocationsMeta meta;
127126
if (!meta.FromJsonString(uris[i])) {
128-
break;
127+
continue;
129128
}
130129
index_deserialize_time_us += (TimestampUtil::GetCurrentTimeUs() - begin_deserialize_time);
131-
132130
auto &location_map = meta.location_map();
133131
if (location_map.empty()) {
134-
break;
132+
continue;
135133
}
136-
137134
std::vector<std::string> prune_loc_ids;
138-
const CacheLocation *best_location =
139-
policy->SelectForMatch(location_map, check_loc_data_exist_func_, prune_loc_ids);
135+
policy->SelectForMatch(location_map, check_loc_data_exist_func_, prune_loc_ids);
140136
if (!prune_loc_ids.empty()) {
141137
prune_keys.emplace_back(keys[i]);
142138
prune_loc_ids_vec.emplace_back(prune_loc_ids);
143-
if (best_location == nullptr) {
144-
continue;
145-
}
146-
}
147-
if (best_location == nullptr) {
148-
break;
149139
}
150140
}
151141
}

0 commit comments

Comments
 (0)