Files
seaweedfs/weed
chrislu 2bc29f93d3 feat: Add comprehensive broker-side logging for disk read debugging
Phase 6: Root Cause Debugging - Broker Disk Read Path

Added extensive logging to trace disk read failures:
  - FetchMessage: Logs every read attempt with full details
  - ReadMessagesAtOffset: Tracks which code path (memory/disk)
  - readHistoricalDataFromDisk: Logs cache hits/misses
  - extractMessagesFromCache: Traces extraction logic

Changes:
  - broker_grpc_fetch.go: Added CRITICAL detection for empty reads
  - log_read_stateless.go: Comprehensive PATH and state logging

Test Results:
  - 87.9% delivery (consistent)
  - FOUND THE BUG: Cache hit but extraction returns empty!

Root Cause Identified:
  [DiskCache] Cache HIT: cachedMessages=572
  [StatelessRead] WARNING: Disk read returned 0 messages

The Problem:
  - Request offset 1572
  - Chunk start: 1000
  - Position in chunk: 572
  - Chunk has messages 0-571 (572 total)
  - Check: positionInChunk (572) >= len(chunkMessages) (572) → TRUE
  - Returns empty!

This is an OFF-BY-ONE ERROR in extractMessagesFromCache:
  The chunk contains offsets 1000-1571, but request for 1572 is out of range.
  The real issue: chunk was only read up to 1571, but HWM says 1572+ exist.

Next: Fix the chunk reading logic or offset calculation
2025-10-17 12:30:01 -07:00
..
2025-10-13 18:05:17 -07:00
2025-10-14 13:04:33 -07:00
2025-10-13 18:05:17 -07:00
2025-10-13 18:05:17 -07:00
2025-10-15 22:56:47 -07:00
2025-10-13 18:05:17 -07:00
2025-08-31 23:31:28 -07:00
2025-08-22 01:15:42 -07:00
2025-10-15 16:08:21 -07:00
2025-10-13 18:05:17 -07:00
2024-06-25 09:18:11 -07:00
2025-10-13 18:05:17 -07:00
2025-08-30 11:15:48 -07:00
2025-10-13 18:05:17 -07:00
2024-02-14 08:26:38 -08:00
2025-10-13 18:05:17 -07:00
2025-10-13 18:05:17 -07:00
2025-10-13 18:05:17 -07:00
2025-10-13 18:05:17 -07:00
2025-07-19 21:43:34 -07:00
2025-03-17 23:13:27 -07:00