Browse Source

debug: add logging to SeaweedFileSystemStore.createFile()

Critical diagnostic: Our FSDataOutputStream.getPos() override is NOT being called!

Adding WARN logs to SeaweedFileSystemStore.createFile() to determine:
1. Is createFile() being called at all?
2. If yes, but FSDataOutputStream override not called, then streams are
   being returned WITHOUT going through SeaweedFileSystem.create/append
3. This would explain why our position tracking fix has no effect

Hypothesis: SeaweedFileSystemStore.createFile() returns SeaweedHadoopOutputStream
directly, and it gets wrapped by something else (not our custom FSDataOutputStream).
pull/7526/head
chrislu 1 week ago
parent
commit
c834e30a72
  1. 4
      other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java
  2. 4
      other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedHadoopOutputStream.java

4
other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java

@ -179,6 +179,8 @@ public class SeaweedFileSystemStore {
permission = permission == null ? FsPermission.getFileDefault() : permission;
LOG.warn("[DEBUG-2024] SeaweedFileSystemStore.createFile CALLED: path={} overwrite={} bufferSize={}",
path, overwrite, bufferSize);
LOG.debug("createFile path: {} overwrite: {} permission: {}",
path,
overwrite,
@ -216,6 +218,8 @@ public class SeaweedFileSystemStore {
SeaweedWrite.writeMeta(filerClient, getParentDirectory(path), entry);
}
LOG.warn("[DEBUG-2024] SeaweedFileSystemStore.createFile RETURNING SeaweedHadoopOutputStream: path={} bufferSize={}",
path, bufferSize);
return new SeaweedHadoopOutputStream(filerClient, path.toString(), entry, writePosition, bufferSize, replication);
}

4
other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedHadoopOutputStream.java

@ -18,9 +18,9 @@ public class SeaweedHadoopOutputStream extends SeaweedOutputStream implements Sy
private static final Logger LOG = LoggerFactory.getLogger(SeaweedHadoopOutputStream.class);
public SeaweedHadoopOutputStream(FilerClient filerClient, final String path, FilerProto.Entry.Builder entry,
final long position, final int bufferSize, final String replication) {
final long position, final int bufferSize, final String replication) {
super(filerClient, path, entry, position, bufferSize, replication);
LOG.warn("[DEBUG-2024] SeaweedHadoopOutputStream created: path={} position={} bufferSize={} replication={}",
LOG.warn("[DEBUG-2024] SeaweedHadoopOutputStream created: path={} position={} bufferSize={} replication={}",
path, position, bufferSize, replication);
}

Loading…
Cancel
Save