30.77% (20/65) Uncovered changed code (with context): ================================================================================ src/IO/CachedInMemoryReadBufferFromFile.cpp ================================================================================ --- uncovered block 245-245 --- 243 | block_range.offset = first_block_start + i * block_size; 244 | block_range.size = std::min(block_size, file_size.value() - block_range.offset); >> 245 | cells[i] = cache->get(block_range.hash(cache_key_base_hash), inject_eviction); 246 | } 247 | --- uncovered block 258-258 --- 256 | /// bound transient memory under parallel cold reads. A run longer than the cap is split. 257 | /// Single-block misses bypass the buffer and read directly into the cache cell. >> 258 | const size_t max_blocks_per_fetch = std::max(1, settings.page_cache_max_coalesced_bytes / block_size); 259 | 260 | size_t i = 0; --- uncovered block 260-261 --- 258 | const size_t max_blocks_per_fetch = std::max(1, settings.page_cache_max_coalesced_bytes / block_size); 259 | >> 260 | size_t i = 0; >> 261 | while (i < num_blocks) 262 | { 263 | if (cells[i]) --- uncovered block 263-263 --- 261 | while (i < num_blocks) 262 | { >> 263 | if (cells[i]) 264 | { 265 | if (block_callback && block_callback(cells[i])) --- uncovered block 265-268 --- 263 | if (cells[i]) 264 | { >> 265 | if (block_callback && block_callback(cells[i])) >> 266 | return cells; >> 267 | ++i; >> 268 | continue; 269 | } 270 | --- uncovered block 271-274 --- 269 | } 270 | >> 271 | const size_t miss_begin = i; >> 272 | while (i < num_blocks && !cells[i] && (i - miss_begin) < max_blocks_per_fetch) >> 273 | ++i; >> 274 | const size_t miss_end = i; 275 | 276 | if (miss_end - miss_begin == 1) --- uncovered block 276-276 --- 274 | const size_t miss_end = i; 275 | >> 276 | if (miss_end - miss_begin == 1) 277 | { 278 | /// Single-block miss: read directly into the cache cell (no temp buffer). --- uncovered block 279-281 --- 277 | { 278 | /// Single-block miss: read directly into the cache cell (no temp buffer). >> 279 | block_range.offset = first_block_start + miss_begin * block_size; >> 280 | block_range.size = std::min(block_size, file_size.value() - block_range.offset); >> 281 | UInt128 key_hash = block_range.hash(cache_key_base_hash); 282 | 283 | cells[miss_begin] = cache->getOrSet( --- uncovered block 283-285 --- 281 | UInt128 key_hash = block_range.hash(cache_key_base_hash); 282 | >> 283 | cells[miss_begin] = cache->getOrSet( >> 284 | cache_file, block_range, detached_if_missing, inject_eviction, >> 285 | [&](const auto & c) 286 | { 287 | size_t bytes_read = in->readBigAt(c->data(), block_range.size, block_range.offset, nullptr); --- uncovered block 291-292 --- 289 | throw Exception(ErrorCodes::UNEXPECTED_END_OF_FILE, "File {} ended after {} bytes, but we expected {}", 290 | cache_file.path, block_range.offset + bytes_read, file_size.value()); >> 291 | }, >> 292 | key_hash); 293 | } 294 | else --- uncovered block 297-299 --- 295 | { 296 | /// Multi-block miss: fetch the whole run with one `readBigAt`, then distribute into cells. >> 297 | const size_t range_start = first_block_start + miss_begin * block_size; >> 298 | const size_t range_end = std::min(first_block_start + miss_end * block_size, file_size.value()); >> 299 | const size_t range_size = range_end - range_start; 300 | 301 | PODArray buf(range_size); --- uncovered block 301-305 --- 299 | const size_t range_size = range_end - range_start; 300 | >> 301 | PODArray buf(range_size); >> 302 | size_t bytes_read = in->readBigAt(buf.data(), range_size, range_start, nullptr); >> 303 | if (bytes_read < range_size) >> 304 | throw Exception(ErrorCodes::UNEXPECTED_END_OF_FILE, "File {} ended after {} bytes, but we expected {}", >> 305 | cache_file.path, range_start + bytes_read, file_size.value()); 306 | 307 | for (size_t j = miss_begin; j < miss_end; ++j) --- uncovered block 307-307 --- 305 | cache_file.path, range_start + bytes_read, file_size.value()); 306 | >> 307 | for (size_t j = miss_begin; j < miss_end; ++j) 308 | { 309 | block_range.offset = first_block_start + j * block_size; --- uncovered block 309-312 --- 307 | for (size_t j = miss_begin; j < miss_end; ++j) 308 | { >> 309 | block_range.offset = first_block_start + j * block_size; >> 310 | block_range.size = std::min(block_size, file_size.value() - block_range.offset); >> 311 | const size_t buf_offset = block_range.offset - range_start; >> 312 | UInt128 key_hash = block_range.hash(cache_key_base_hash); 313 | 314 | cells[j] = cache->getOrSet( --- uncovered block 314-316 --- 312 | UInt128 key_hash = block_range.hash(cache_key_base_hash); 313 | >> 314 | cells[j] = cache->getOrSet( >> 315 | cache_file, block_range, detached_if_missing, inject_eviction, >> 316 | [&](const auto & c) 317 | { 318 | memcpy(c->data(), buf.data() + buf_offset, block_range.size); --- uncovered block 318-320 --- 316 | [&](const auto & c) 317 | { >> 318 | memcpy(c->data(), buf.data() + buf_offset, block_range.size); >> 319 | }, >> 320 | key_hash); 321 | } 322 | } --- uncovered block 324-324 --- 322 | } 323 | >> 324 | for (size_t j = miss_begin; j < miss_end; ++j) 325 | { 326 | if (block_callback && block_callback(cells[j])) --- uncovered block 326-327 --- 324 | for (size_t j = miss_begin; j < miss_end; ++j) 325 | { >> 326 | if (block_callback && block_callback(cells[j])) >> 327 | return cells; 328 | } 329 | } --- uncovered block 331-331 --- 329 | } 330 | >> 331 | return cells; 332 | } 333 | No lost baseline coverage found. WARNING: Failed to get start time for [Print Uncovered Code] - start time and duration won't be set --- Coverage counts --- Lines : baseline 756,401/899,597 -> current 756,299/899,645 (delta -102 / +48) Functions : baseline 830,458/911,557 -> current 830,519/911,562 (delta +61 / +5) Branches : baseline 245,708/320,892 -> current 245,683/320,910 (delta -25 / +18)