Browse Source

debug: add detailed buffer tracking to identify lost 78 bytes

Issue: Parquet expects 1338 bytes but SeaweedFS only has 1260 bytes (78 missing)

Added logging to track:
- Buffer position before every write
- Bytes submitted for write
- Whether buffer is skipped (position==0)

This will show if:
1. The last 78 bytes never entered the buffer (Parquet bug)
2. The buffer had 78 bytes but weren't written (flush bug)
3. The buffer was written but data was lost (volume server bug)

Next step: Force rebuild in CI to get these logs.
pull/7526/head
chrislu 7 days ago
parent
commit
bdf8d89fbb
  1. 9
      other/java/client/src/main/java/seaweedfs/client/SeaweedOutputStream.java

9
other/java/client/src/main/java/seaweedfs/client/SeaweedOutputStream.java

@ -209,11 +209,16 @@ public class SeaweedOutputStream extends OutputStream {
}
private synchronized void writeCurrentBufferToService() throws IOException {
if (buffer.position() == 0) {
int bufferPos = buffer.position();
LOG.info("writeCurrentBufferToService: path={} buffer.position()={} totalPosition={}", path, bufferPos, position);
if (bufferPos == 0) {
LOG.info(" → Skipping write, buffer is empty");
return;
}
position += submitWriteBufferToService(buffer, position);
int written = submitWriteBufferToService(buffer, position);
position += written;
LOG.info(" → Submitted {} bytes for write, new position={}", written, position);
buffer = ByteBufferPool.request(bufferSize);

Loading…
Cancel
Save