mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-22 15:52:13 +00:00
s3_storage::make_source previously ignored its file f parameter and constructed a fresh s3::client::readable_file per call. The new file's _stats cache was empty, so the first dma_read_bulk issued a HEAD via maybe_update_stats just to learn the object size before the ranged GET -- one ~50 ms RTT per uncached read. The file f passed in by the two callers (sstable::data_stream for Data.db reads and index_reader::make_context for Index.db reads) already wraps the sstable's _data_file or _index_file. Those file objects had their stats populated at sstable open time by update_info_for_opened_data, and they were wrapped with the configured file_io_extensions when opened via open_component. Reusing them is exactly what filesystem_storage::make_source does (one-line make_file_data_source over f), so the s3 path simply matches it. readable_file::size() is also updated to route through maybe_update_stats(), so a .size() call populates the _stats cache the same way .stat() does -- preventing a redundant HEAD on the first subsequent read of components opened with .size() (Index, Partitions, Rows in update_info_for_opened_data). Closes scylladb/scylladb#29766 Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
50 KiB
50 KiB