zxealous opened a new issue, #17638: URL: https://github.com/apache/doris/issues/17638
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no similar issues. ### Version master ### What's Wrong? Query id, ReaderType, FileCacheStatistics and so on are saved in IOContext,CachedRemoteFileReader save the IOContext in class. The call stack for creating CachedRemoteFileReader is as follows: ``` #7 0x00007f9ad9e29d89 in doris::io::RemoteFileSystem::open_file_impl (this=0x7f9946225000, path=..., reader_options=..., reader=0x7f98a7f855a0, io_ctx=0x0) at /home/disk2/doris/be/src/io/fs/remote_file_system.cpp:60 #8 0x00007f9ad9e29658 in doris::io::RemoteFileSystem::open_file (this=0x7f9946225000, path=..., reader_options=..., reader=0x7f98a7f855a0, io_ctx=0x0) at /home/disk2/doris/be/src/io/fs/remote_file_system.cpp:32 #9 0x00007f9ada7c9ac4 in doris::segment_v2::Segment::open (fs=..., path=..., segment_id=0, rowset_id=..., tablet_schema=..., reader_options=..., output=0x7f98a7f856d0) at /home/disk2/doris/be/src/olap/rowset/segment_v2/segment.cpp:53 #10 0x00007f9adacdecf7 in doris::BetaRowset::load_segments (this=0x7f99e4343b80, seg_id_begin=0, seg_id_end=1, segments=0x7f98a7f85890) at /home/disk2/doris/be/src/olap/rowset/beta_rowset.cpp:146 #11 0x00007f9adacde54e in doris::BetaRowset::load_segments (this=0x7f99e4343b80, segments=0x7f98a7f85890) at /home/disk2/doris/be/src/olap/rowset/beta_rowset.cpp:127 #12 0x00007f9adac6e545 in doris::SegmentLoader::load_segments (this=0x7f9b1e1a5be0 <doris::SegmentLoader::create_global_instance(unsigned long)::instance>, rowset=..., cache_handle=0x7f9a65e6cc20, use_cache=true) at /home/disk2/doris/be/src/olap/segment_loader.cpp:76 ``` This cause if use segment cache in memory, may be multi query use the same CachedRemoteFileReader, and IOContext may be not true, may be multi query calculate cache statistic base on the same FileCacheStatistics object. So I don't think we need to save IOContext in class CachedRemoteFileReader. ### What You Expected? Remove IOContext in class CachedRemoteFileReader, and pass IOContext when calling the function CachedRemoteFileReader::read_at(). ### How to Reproduce? _No response_ ### Anything Else? _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- 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]
