stinger1206 commented on code in PR #67720:
URL: https://github.com/apache/doris/pull/67720#discussion_r4182174702
##########
be/src/storage/segment/segment.cpp:
##########
@@ -1379,7 +1387,10 @@ Status
Segment::_get_segment_footer(std::shared_ptr<SegmentFooterPB>& footer_pb,
_file_reader->size() - 12);
}
footer_pb_shared = cache_handle.get<std::shared_ptr<SegmentFooterPB>>();
- _footer_pb = footer_pb_shared;
+ {
+ std::lock_guard<std::mutex> lock(_footer_pb_lock);
+ _footer_pb = footer_pb_shared;
Review Comment:
Hi, thanks for the review!
I removed `_footer_pb` completely. The footer is now always read through
StoragePageCache, and `get_metadata_size()` doesn't read it anymore. The footer
memory is already tracked by the page cache, and doing a lookup there just for
size accounting would bump LRU recency on every memory sweep. `_open()` already
excluded the footer from `_meta_mem_usage` for the same reason.
Also updated the `page_cache.h` comment that still recommended keeping a
weak_ptr.
This code is running on our prod cluster since Oct 2, no crashes of this
family since then.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]