full node validation
This commit is contained in:
parent
6737c6f602
commit
91d4bc2f1c
@ -3577,34 +3577,26 @@ void FileManager::memory_cleanup() {
|
|||||||
|
|
||||||
/* DESTROY INVALID file_hash_to_file_id_ */
|
/* DESTROY INVALID file_hash_to_file_id_ */
|
||||||
for (const auto &pair : file_hash_to_file_id_) {
|
for (const auto &pair : file_hash_to_file_id_) {
|
||||||
if (pair.second.fast_get() != 0) {
|
auto &file = file_id_info_[pair.second.fast_get()];
|
||||||
auto &file = file_id_info_[pair.second.fast_get()];
|
|
||||||
|
|
||||||
if (file.node_id_ == 0) {
|
if (file_nodes_[file.node_id_] == nullptr) {
|
||||||
file_hash_to_file_id_.erase(pair.first);
|
file_hash_to_file_id_.erase(pair.first);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* DESTROY INVALID local_location_to_file_id_ */
|
/* DESTROY INVALID local_location_to_file_id_ */
|
||||||
for (const auto &pair : local_location_to_file_id_) {
|
for (const auto &pair : local_location_to_file_id_) {
|
||||||
if (pair.second.fast_get() != 0) {
|
auto &file = file_id_info_[pair.second.fast_get()];
|
||||||
auto &file = file_id_info_[pair.second.fast_get()];
|
if (file_nodes_[file.node_id_] == nullptr) {
|
||||||
|
local_location_to_file_id_.erase(pair.first);
|
||||||
if (file.node_id_ == 0) {
|
|
||||||
local_location_to_file_id_.erase(pair.first);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* DESTROY INVALID generate_location_to_file_id_ */
|
/* DESTROY INVALID generate_location_to_file_id_ */
|
||||||
for (const auto &pair : generate_location_to_file_id_) {
|
for (const auto &pair : generate_location_to_file_id_) {
|
||||||
if (pair.second.fast_get() != 0) {
|
auto &file = file_id_info_[pair.second.fast_get()];
|
||||||
auto &file = file_id_info_[pair.second.fast_get()];
|
if (file_nodes_[file.node_id_] == nullptr) {
|
||||||
|
generate_location_to_file_id_.erase(pair.first);
|
||||||
if (file.node_id_ == 0) {
|
|
||||||
generate_location_to_file_id_.erase(pair.first);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user