You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "taklwu (via GitHub)" <gi...@apache.org> on 2026/09/15 20:22:21 UTC

[PR] HDDS-16400. Make positional read thread-safe for OzoneCryptoInputStre… [ozone]

taklwu opened a new pull request, #11245:
URL: https://github.com/apache/ozone/pull/11245

   …am and ECBlockInputStream
   
   ## What changes were proposed in this pull request?
   followup by HDDS-15424, we have created HDDS-16400 that implements the thread-safe positional read for OzoneCryptoInputStream and ECBlockInputStream.
   
   Please describe your PR in detail:
   
   1. OzoneCryptoInputStream itself is not an ExtendedInputStream, so we add the synchronized lock for positional read. 
   2. ECBlockInputStream#readFully return false (use the default ExtendedInputStream#readFully), so it fail back to use the new additional synchronized lock for readSeekRestore. 
   
   ## What is the link to the Apache JIRA
   - https://issues.apache.org/jira/browse/HDDS-16400
   
   ## How was this patch tested?
   
   unit tests.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-16400. Fix thread-safety of positioned reads in OzoneFSInputStream [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #11245:
URL: https://github.com/apache/ozone/pull/11245#issuecomment-5781273756

   Thanks @taklwu for the patch, @szetszwo for the review.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-16400. Fix thread-safety of positioned reads in OzoneFSInputStream [ozone]

Posted by "taklwu (via GitHub)" <gi...@apache.org>.
taklwu commented on PR #11245:
URL: https://github.com/apache/ozone/pull/11245#issuecomment-5779592644

   `TestOzoneManagerHASnapshot.testSnapshotDiffWhenOmLeaderRestart` failure is not related. 
   
   ```
   [ERROR] org.apache.hadoop.ozone.om.snapshot.TestOzoneManagerHASnapshot.testSnapshotDiffWhenOmLeaderRestart -- Time elapsed: 8.106 s <<< FAILURE!
   org.opentest4j.AssertionFailedError: expected: <DONE> but was: <IN_PROGRESS>
   	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-16400. Fix thread-safety of positioned reads in OzoneFSInputStream [ozone]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #11245:
URL: https://github.com/apache/ozone/pull/11245#discussion_r4020867234


##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneFSInputStream.java:
##########
@@ -211,4 +222,75 @@ public void readFully(long position, ByteBuffer buf) throws IOException {
       }
     }
   }
+
+  /**
+   * Byte-array positioned read. Tries the native stateless {@link ExtendedInputStream#readFully}
+   * path first (via a zero-copy {@link ByteBuffer#wrap}). Falls back to a synchronized
+   * seek-read-restore using byte-array {@link #read(byte[], int, int)} so that the fallback
+   * works for any {@link Seekable} stream, not just those that also implement
+   * {@link org.apache.hadoop.fs.ByteBufferReadable}.
+   * <p>
+   * {@link FSInputStream} synchronizes its inherited implementation on {@code this}, a different
+   * monitor from {@code positionedReadLock}; without this override the two APIs can interleave.
+   */
+  @Override
+  public int read(long position, byte[] buffer, int offset, int length) throws IOException {
+    if (inputStream instanceof ExtendedInputStream) {

Review Comment:
   This override bypasses `FSInputStream.validatePositionedReadArgs` on the fallback path. Consequently invalid slices can mutate the cursor before failing, and a zero-length read can return `-1` at EOF if the wrapped stream does so (the new `SeekableOnlyInputStream` has exactly that behavior). Preserve the inherited validation and empty-read contract before selecting a path.
   
   This issue also appears on line 254 of the same file.



##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneFSInputStream.java:
##########
@@ -211,4 +222,75 @@ public void readFully(long position, ByteBuffer buf) throws IOException {
       }
     }
   }
+
+  /**
+   * Byte-array positioned read. Tries the native stateless {@link ExtendedInputStream#readFully}
+   * path first (via a zero-copy {@link ByteBuffer#wrap}). Falls back to a synchronized
+   * seek-read-restore using byte-array {@link #read(byte[], int, int)} so that the fallback
+   * works for any {@link Seekable} stream, not just those that also implement
+   * {@link org.apache.hadoop.fs.ByteBufferReadable}.
+   * <p>
+   * {@link FSInputStream} synchronizes its inherited implementation on {@code this}, a different
+   * monitor from {@code positionedReadLock}; without this override the two APIs can interleave.
+   */
+  @Override
+  public int read(long position, byte[] buffer, int offset, int length) throws IOException {
+    if (inputStream instanceof ExtendedInputStream) {
+      final ByteBuffer buf = ByteBuffer.wrap(buffer, offset, length);
+      try {
+        if (((ExtendedInputStream) inputStream).readFully(position, buf)) {
+          return length - buf.remaining();
+        }

Review Comment:
   The native branch bypasses this wrapper's byte-read accounting. Before this override, `FSInputStream.read(position, ...)` called the virtual `read(byte[], ...)`, which increments `FileSystem.Statistics`; now successful replicated positioned reads disappear from `bytesRead`. Increment the statistic by the buffer advancement before returning.



##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneFSInputStream.java:
##########
@@ -37,7 +37,9 @@
  * The input stream for Ozone file system.
  *
  * TODO: Make inputStream generic for both rest and rpc clients
- * This class is not thread safe.
+ * Sequential reads are not thread safe. Positioned reads use a native
+ * stateless path when the underlying {@link ExtendedInputStream} supports it;
+ * otherwise they fall back to a synchronized seek-read-restore sequence.

Review Comment:
   This description is inaccurate for supported `ExtendedInputStream` implementations: `MultipartInputStream.readFullyStreamBlock` reports support while performing its own synchronized, stateful seek-read-restore. Describe this as delegation to the underlying positioned-read implementation rather than promising that every supported path is stateless.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-16400. Fix thread-safety of positioned reads in OzoneFSInputStream [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai merged PR #11245:
URL: https://github.com/apache/ozone/pull/11245


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-16400. Fix thread-safety of positioned reads in OzoneFSInputStream [ozone]

Posted by "szetszwo (via GitHub)" <gi...@apache.org>.
szetszwo commented on code in PR #11245:
URL: https://github.com/apache/ozone/pull/11245#discussion_r4067722172


##########
hadoop-ozone/ozonefs-common/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFSInputStream.java:
##########
@@ -187,4 +197,294 @@ public int read() {
     };
   }
 
+  @Test
+  public void testByteBufferPositionedReadNegativePositionThrows() throws Exception {
+    // read(long, ByteBuffer) must throw EOFException for negative positions,
+    // aligning with the byte-array PositionedReadable behaviour.
+    final byte[] source = RandomUtils.secure().randomBytes(SOURCE_SIZE);
+    final InterleavingSeekableInputStream underlying =
+        new InterleavingSeekableInputStream(source);
+    try (OzoneFSInputStream subject = new OzoneFSInputStream(underlying,
+        new FileSystem.Statistics("test"))) {
+      ByteBuffer buf = ByteBuffer.allocate(16);
+      assertThrows(EOFException.class, () -> subject.read(-1L, buf));
+    }
+  }
+
+  @Test
+  @Timeout(value = 30)
+  public void testConcurrentPositionedRead() throws Exception {
+    final byte[] source = RandomUtils.secure().randomBytes(SOURCE_SIZE);
+    final InterleavingSeekableInputStream underlying =
+        new InterleavingSeekableInputStream(source);
+    try (OzoneFSInputStream subject = new OzoneFSInputStream(underlying,
+        new FileSystem.Statistics("test"))) {
+      PositionedReadTestHelper.runConcurrentPositionedReads(source,
+          (offset, buf) -> subject.readFully(offset, buf));
+    }
+  }
+
+  @Test
+  @Timeout(value = 30)
+  public void testConcurrentPositionedReadEcFallback() throws Exception {
+    final byte[] source = RandomUtils.secure().randomBytes(SOURCE_SIZE);
+    final EcInterleavingInputStream underlying =
+        new EcInterleavingInputStream(source);
+    try (OzoneFSInputStream subject = new OzoneFSInputStream(underlying,
+        new FileSystem.Statistics("test"))) {
+      PositionedReadTestHelper.runConcurrentPositionedReads(source,
+          (offset, buf) -> subject.readFully(offset, buf));
+    }
+  }
+
+  @Test
+  @Timeout(value = 30)
+  public void testByteArrayFallbackWorksForSeekableOnlyStream() throws Exception {
+    // Regression: the old routing through read(long, ByteBuffer) would cast to
+    // ByteBufferReadable in readAtPositionSeekRestore and throw ClassCastException
+    // for a stream that only implements Seekable (not ByteBufferReadable).
+    final byte[] source = RandomUtils.secure().randomBytes(SOURCE_SIZE);
+    final SeekableOnlyInputStream underlying = new SeekableOnlyInputStream(source);
+    try (OzoneFSInputStream subject = new OzoneFSInputStream(underlying,
+        new FileSystem.Statistics("test"))) {
+      PositionedReadTestHelper.runConcurrentPositionedReads(source, (offset, buf) -> {
+        byte[] arr = new byte[buf.remaining()];
+        subject.readFully(offset, arr);
+        buf.put(arr);
+      });
+    }
+  }
+
+  @Test
+  @Timeout(value = 30)
+  public void testConcurrentByteArrayPositionedReadEcFallback() throws Exception {
+    final byte[] source = RandomUtils.secure().randomBytes(SOURCE_SIZE);
+    final EcInterleavingInputStream underlying =
+        new EcInterleavingInputStream(source);
+    try (OzoneFSInputStream subject = new OzoneFSInputStream(underlying,
+        new FileSystem.Statistics("test"))) {
+      PositionedReadTestHelper.runConcurrentPositionedReads(source, (offset, buf) -> {
+        byte[] arr = new byte[buf.remaining()];
+        subject.readFully(offset, arr);
+        buf.put(arr);
+      });
+    }
+  }
+
+  @Test
+  @Timeout(value = 30)
+  public void testConcurrentMixedApiEcFallback() throws Exception {
+    // ByteBuffer and byte-array callers share positionedReadLock; verify no interleaving.
+    final byte[] source = RandomUtils.secure().randomBytes(SOURCE_SIZE);
+    final EcInterleavingInputStream underlying =
+        new EcInterleavingInputStream(source);
+    try (OzoneFSInputStream subject = new OzoneFSInputStream(underlying,
+        new FileSystem.Statistics("test"))) {
+      PositionedReadTestHelper.runConcurrentPositionedReads(source, (offset, buf) -> {
+        if ((offset & 1) == 0) {
+          subject.readFully(offset, buf);
+        } else {
+          byte[] arr = new byte[buf.remaining()];
+          subject.readFully(offset, arr);
+          buf.put(arr);
+        }
+      });
+    }
+  }
+
+  /**
+   * Mimics KeyInputStream synchronized per-operation seek/read where multi-steps
+   * positioned reads must still be serialized at the FS layer.
+   */
+  private static final class InterleavingSeekableInputStream extends InputStream
+      implements Seekable, org.apache.hadoop.fs.ByteBufferReadable {
+
+    private final InterleavingReadState readState;
+
+    private InterleavingSeekableInputStream(byte[] data) {
+      this.readState = new InterleavingReadState(data);
+    }
+
+    @Override
+    public synchronized void seek(long p) {
+      readState.seek(p);
+    }
+
+    @Override
+    public synchronized long getPos() {
+      return readState.getPos();
+    }
+
+    @Override
+    public synchronized boolean seekToNewSource(long targetPos) {
+      return false;
+    }
+
+    @Override
+    public int read() {
+      return -1;
+    }
+
+    @Override
+    public synchronized int read(ByteBuffer buf) {
+      return readState.read(buf);
+    }
+  }
+
+  /**
+   * Mimics an erasure-coded key stream: {@link ExtendedInputStream#readFully}
+   * returns {@code false}, so {@link OzoneFSInputStream} falls back to
+   * seek-read-restore on the shared cursor. Implements both ByteBuffer and
+   * byte-array reads so both fallback paths can be exercised.
+   */
+  private static final class EcInterleavingInputStream extends ExtendedInputStream {
+
+    private final InterleavingReadState readState;
+
+    private EcInterleavingInputStream(byte[] data) {
+      this.readState = new InterleavingReadState(data);
+    }
+
+    @Override
+    public boolean readFully(long position, ByteBuffer buffer) {
+      return false;
+    }

Review Comment:
   It is the same as the super method.  Let's remove it.



##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneFSInputStream.java:
##########
@@ -211,4 +225,101 @@ public void readFully(long position, ByteBuffer buf) throws IOException {
       }
     }
   }
+
+  /**
+   * Byte-array positioned read. Tries the native stateless {@link ExtendedInputStream#readFully}
+   * path first (via a zero-copy {@link ByteBuffer#wrap}). Falls back to a synchronized
+   * seek-read-restore using byte-array {@link #read(byte[], int, int)} so that the fallback
+   * works for any {@link Seekable} stream, not just those that also implement
+   * {@link org.apache.hadoop.fs.ByteBufferReadable}.
+   * <p>
+   * {@link FSInputStream} synchronizes its inherited implementation on {@code this}, a different
+   * monitor from {@code positionedReadLock}; without this override the two APIs can interleave.
+   */
+  @Override
+  public int read(long position, byte[] buffer, int offset, int length) throws IOException {

Review Comment:
   I see.  Then, we should implement the array version. 
   - Let's make the array and ByteBuffer version look similar. 
   - We should also create private methods and reuse the code; see https://issues.apache.org/jira/secure/attachment/13084654/11245_review.patch



##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneFSInputStream.java:
##########
@@ -211,4 +238,96 @@ public void readFully(long position, ByteBuffer buf) throws IOException {
       }
     }
   }
+
+  /**
+   * Byte-array positioned read. Tries the native stateless {@link ExtendedInputStream#readFully}
+   * path first (via a zero-copy {@link ByteBuffer#wrap}). Falls back to a synchronized
+   * seek-read-restore using byte-array {@link #read(byte[], int, int)} so that the fallback
+   * works for any {@link Seekable} stream, not just those that also implement
+   * {@link org.apache.hadoop.fs.ByteBufferReadable}.
+   * <p>
+   * {@link FSInputStream} synchronizes its inherited implementation on {@code this}, a different
+   * monitor from {@code positionedReadLock}; without this override the two APIs can interleave.
+   */
+  @Override
+  public int read(long position, byte[] buffer, int offset, int length) throws IOException {
+    // Validate before touching ByteBuffer so that null throws IAE (not NPE) and
+    // negative position propagates as EOFException rather than being swallowed.
+    validatePositionedReadArgs(position, buffer, offset, length);
+    if (length == 0) {
+      return 0;
+    }
+    if (inputStream instanceof ExtendedInputStream) {
+      final ByteBuffer buf = ByteBuffer.wrap(buffer, offset, length);
+      try {
+        if (((ExtendedInputStream) inputStream).readFully(position, buf)) {
+          final int bytesRead = length - buf.remaining();
+          // readFullyStateless can return true with bytesRead==0 for pos==length.
+          // Convert that to -1 to comply with PositionedReadable contract.
+          if (bytesRead == 0) {
+            return -1;
+          }
+          if (statistics != null) {
+            statistics.incrementBytesRead(bytesRead);
+          }
+          return bytesRead;
+        }
+      } catch (EOFException e) {
+        // pos < 0 was already rejected by validatePositionedReadArgs above,
+        // so this EOFException means pos >= stream length → return -1.
+        return -1;
+      }
+    }
+    synchronized (positionedReadLock) {
+      return readAtPositionSeekRestoreByteArray(position, buffer, offset, length);
+    }
+  }
+
+  @Override
+  public void readFully(long position, byte[] buffer, int offset, int length) throws IOException {
+    validatePositionedReadArgs(position, buffer, offset, length);
+    if (length == 0) {
+      return;
+    }
+    if (inputStream instanceof ExtendedInputStream) {
+      final ByteBuffer buf = ByteBuffer.wrap(buffer, offset, length);
+      try {
+        if (((ExtendedInputStream) inputStream).readFully(position, buf)) {
+          // readFullyStateless returns true once bytesRead > 0, even if the
+          // buffer is only partially filled. Check that the buffer is full.
+          if (buf.hasRemaining()) {
+            throw new EOFException("End of file reached before reading fully.");
+          }
+          return;
+        }
+      } catch (EOFException e) {
+        throw e;
+      }
+    }
+    synchronized (positionedReadLock) {
+      int remaining = length;
+      int off = offset;
+      while (remaining > 0) {
+        int n = readAtPositionSeekRestoreByteArray(position + (length - remaining), buffer, off, remaining);

Review Comment:
   For position readFully, it should not call position read.  Otherwise, it will keep seeking back and forth.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-16400. Make positional read thread-safe for OzoneCryptoInputStre… [ozone]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #11245:
URL: https://github.com/apache/ozone/pull/11245#discussion_r4019910094


##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/OzoneCryptoInputStream.java:
##########
@@ -136,6 +146,84 @@ keyName, partIndex, getLength(), numBytesToRead,
     return numBytesRead;
   }
 
+  @Override
+  public synchronized int read(ByteBuffer buf) throws IOException {
+    return super.read(buf);
+  }
+
+  @Override
+  public synchronized void seek(long pos) throws IOException {
+    super.seek(pos);
+  }
+
+  @Override
+  public synchronized long getPos() throws IOException {
+    return super.getPos();
+  }
+
+  /**
+   * Positioned read. Decryption can only happen at the Crypto buffer boundaries, so this stream cannot
+   * read at an arbitrary position without moving its cursor. The read is therefore serialized against the
+   * other reads on this stream: the cursor is moved to {@code position}, the data is read through
+   * {@link #read(byte[], int, int)} (which does the Crypto buffer boundary adjustment) and the cursor is
+   * restored before the lock is released.
+   *
+   * @param position the position to read from.
+   * @param dst the buffer to read into.
+   * @return the number of bytes copied into {@code dst}, or -1 if no byte could be read.
+   */
+  @Override
+  public synchronized int read(long position, ByteBuffer dst) throws IOException {

Review Comment:
   These overrides only serialize the ByteBuffer positioned-read overloads. `CryptoInputStream` also exposes the byte-array `PositionedReadable` methods, whose inherited seek/read/restore sequence does not hold this monitor; callers using `read(position, byte[], off, len)` can still interleave and corrupt the shared cursor. Override the byte-array overloads (and `readFully`) or route both APIs through one synchronized helper.



##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneFSInputStream.java:
##########
@@ -180,6 +183,16 @@ public int read(long position, ByteBuffer buf) throws IOException {
       }
     }
 
+    // Fallback: stateful seek-read-restore on the shared cursor. Synchronize the
+    // full sequence so concurrent positioned reads remain thread-safe when the
+    // native stateless path is unavailable (e.g. erasure coded keys).
+    synchronized (positionedReadLock) {
+      return readAtPositionSeekRestore(position, buf);

Review Comment:
   This lock is only acquired by `read(long, ByteBuffer)`, but `OzoneFSInputStream` inherits the byte-array positioned-read methods from `FSInputStream`. A concurrent `FSDataInputStream.read(position, byte[], off, len)` therefore still performs seek/read/restore without `positionedReadLock`, so positional reads can still corrupt the shared cursor. Add byte-array overloads that use the same lock/helper and cover that API in the concurrency test.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-16400. Support concurrent positioned reads in OzoneFSInputStream and OzoneCryptoInputStream [ozone]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #11245:
URL: https://github.com/apache/ozone/pull/11245#discussion_r4020492893


##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/OzoneCryptoInputStream.java:
##########
@@ -73,8 +79,18 @@ public int getBufferSize() {
     return bufferSize;
   }
 
+  /**
+   * {@link CryptoInputStream} does not synchronize its own methods, so every method moving the cursor of
+   * this stream is serialized here on the monitor of this stream. Otherwise a read or a seek could land in
+   * the middle of a positioned read and see (or undo) the cursor move that read does.
+   * This covers both the sequential-read API ({@link #read(byte[], int, int)}, {@link #read(ByteBuffer)},
+   * {@link #seek(long)}, {@link #getPos()}) and all positioned-read overloads
+   * ({@link #read(long, ByteBuffer)}, {@link #readFully(long, ByteBuffer)},
+   * {@link #read(long, byte[], int, int)}, {@link #readFully(long, byte[], int, int)},
+   * {@link #readFully(long, byte[])}).
+   */
   @Override
-  public int read(byte[] b, int off, int len) throws IOException {
+  public synchronized int read(byte[] b, int off, int len) throws IOException {

Review Comment:
   `skip(long)` is still inherited without being serialized on this monitor. A concurrent skip can run between a positioned read's seek and restore, causing that read to consume the wrong range or restore an incorrect cursor; synchronizing only read/seek/getPos does not establish the cursor invariant described above. Override skip under the same monitor (and audit other inherited cursor-moving methods).



##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneFSInputStream.java:
##########
@@ -211,4 +222,19 @@ public void readFully(long position, ByteBuffer buf) throws IOException {
       }
     }
   }
+
+  @Override
+  public int read(long position, byte[] buffer, int offset, int length) throws IOException {
+    return read(position, ByteBuffer.wrap(buffer, offset, length));
+  }
+
+  @Override
+  public void readFully(long position, byte[] buffer, int offset, int length) throws IOException {
+    readFully(position, ByteBuffer.wrap(buffer, offset, length));
+  }
+
+  @Override
+  public void readFully(long position, byte[] buffer) throws IOException {
+    readFully(position, buffer, 0, buffer.length);
+  }

Review Comment:
   This new byte-array overload narrows the positioned-read contract by routing through the ByteBuffer path. For a valid `Seekable` input that does not implement `ByteBufferReadable`, `read(long, byte[])` now reaches the cast in `readAtPositionSeekRestore` and fails instead of using the existing byte-array seek/read/restore behavior; the `readFully` byte-array overloads inherit the same regression. Keep these overloads on a synchronized seek/read/restore byte-array path (while retaining the native `ExtendedInputStream` path where available).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-16400. Fix thread-safety of positioned reads in OzoneFSInputStream [ozone]

Posted by "taklwu (via GitHub)" <gi...@apache.org>.
taklwu commented on code in PR #11245:
URL: https://github.com/apache/ozone/pull/11245#discussion_r4065223839


##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneFSInputStream.java:
##########
@@ -211,4 +225,101 @@ public void readFully(long position, ByteBuffer buf) throws IOException {
       }
     }
   }
+
+  /**
+   * Byte-array positioned read. Tries the native stateless {@link ExtendedInputStream#readFully}
+   * path first (via a zero-copy {@link ByteBuffer#wrap}). Falls back to a synchronized
+   * seek-read-restore using byte-array {@link #read(byte[], int, int)} so that the fallback
+   * works for any {@link Seekable} stream, not just those that also implement
+   * {@link org.apache.hadoop.fs.ByteBufferReadable}.
+   * <p>
+   * {@link FSInputStream} synchronizes its inherited implementation on {@code this}, a different
+   * monitor from {@code positionedReadLock}; without this override the two APIs can interleave.
+   */
+  @Override
+  public int read(long position, byte[] buffer, int offset, int length) throws IOException {
+    // Validate before touching ByteBuffer so that null throws IAE (not NPE) and
+    // negative position propagates as EOFException rather than being swallowed.
+    validatePositionedReadArgs(position, buffer, offset, length);
+    if (length == 0) {
+      return 0;
+    }
+    if (inputStream instanceof ExtendedInputStream) {
+      final ByteBuffer buf = ByteBuffer.wrap(buffer, offset, length);
+      try {
+        if (((ExtendedInputStream) inputStream).readFully(position, buf)) {
+          final int bytesRead = length - buf.remaining();
+          // readFullyStateless can return true with bytesRead==0 for pos==length.
+          // Convert that to -1 to comply with PositionedReadable contract.
+          if (bytesRead == 0) {
+            return -1;
+          }
+          if (statistics != null) {
+            statistics.incrementBytesRead(bytesRead);
+          }

Review Comment:
   let me add it as well.



##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneFSInputStream.java:
##########
@@ -211,4 +225,101 @@ public void readFully(long position, ByteBuffer buf) throws IOException {
       }
     }
   }
+
+  /**
+   * Byte-array positioned read. Tries the native stateless {@link ExtendedInputStream#readFully}
+   * path first (via a zero-copy {@link ByteBuffer#wrap}). Falls back to a synchronized
+   * seek-read-restore using byte-array {@link #read(byte[], int, int)} so that the fallback
+   * works for any {@link Seekable} stream, not just those that also implement
+   * {@link org.apache.hadoop.fs.ByteBufferReadable}.
+   * <p>
+   * {@link FSInputStream} synchronizes its inherited implementation on {@code this}, a different
+   * monitor from {@code positionedReadLock}; without this override the two APIs can interleave.
+   */
+  @Override
+  public int read(long position, byte[] buffer, int offset, int length) throws IOException {

Review Comment:
   I mentioned that in the comment that if the the inner input stream is not child class of `ExtendedInputStream`, we will cannot use `ByteBuffer.wrap` because not all Seekable streams also implement `ByteBufferReadable`, and the casting may fail line#201 with `((ByteBufferReadable) inputStream).read(buf);` .
   
   but if you think we only support `ByteBufferReadable` , then we can reuse those existing method. 
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-16400. Fix thread-safety of positioned reads in OzoneFSInputStream [ozone]

Posted by "szetszwo (via GitHub)" <gi...@apache.org>.
szetszwo commented on code in PR #11245:
URL: https://github.com/apache/ozone/pull/11245#discussion_r4065326381


##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneFSInputStream.java:
##########
@@ -211,4 +225,101 @@ public void readFully(long position, ByteBuffer buf) throws IOException {
       }
     }
   }
+
+  /**
+   * Byte-array positioned read. Tries the native stateless {@link ExtendedInputStream#readFully}
+   * path first (via a zero-copy {@link ByteBuffer#wrap}). Falls back to a synchronized
+   * seek-read-restore using byte-array {@link #read(byte[], int, int)} so that the fallback
+   * works for any {@link Seekable} stream, not just those that also implement
+   * {@link org.apache.hadoop.fs.ByteBufferReadable}.
+   * <p>
+   * {@link FSInputStream} synchronizes its inherited implementation on {@code this}, a different
+   * monitor from {@code positionedReadLock}; without this override the two APIs can interleave.
+   */
+  @Override
+  public int read(long position, byte[] buffer, int offset, int length) throws IOException {

Review Comment:
   > ... we only support ByteBufferReadable , ...
   
   In current code, are the inner input streams always ByteBufferReadable?  If yes, let's only support ByteBufferReadable.  (We may add a assertion in the constructor as  well.)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-16400. Fix thread-safety of positioned reads in OzoneFSInputStream [ozone]

Posted by "szetszwo (via GitHub)" <gi...@apache.org>.
szetszwo commented on code in PR #11245:
URL: https://github.com/apache/ozone/pull/11245#discussion_r4053734967


##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneFSInputStream.java:
##########
@@ -37,7 +37,9 @@
  * The input stream for Ozone file system.
  *
  * TODO: Make inputStream generic for both rest and rpc clients
- * This class is not thread safe.
+ * Sequential reads are not thread safe. Positioned reads delegate to the
+ * underlying {@link ExtendedInputStream} when it supports them; otherwise they
+ * fall back to a synchronized seek-read-restore sequence.
  */

Review Comment:
   Let's remove the TODO and see the suggestions below:
   ```java
   /**
    * The input stream for Ozone file system.
    * <p>
    * Sequential reads are NOT thread safe.
    * <p>
    * Positioned reads are thread safe.
    * When the underlying stream is an {@link ExtendedInputStream} and
    * when it supports {@link ExtendedInputStream#readFully(long, ByteBuffer)},
    * they delegate to it.
    * Otherwise, they fall back to the default synchronized seek-read-restore implementation.
    * <p>
    * Applications must use either sequential reads or position reads at any given time,
    * but not concurrent sequential/position reads
    */
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-16400. Fix thread-safety of positioned reads in OzoneFSInputStream [ozone]

Posted by "taklwu (via GitHub)" <gi...@apache.org>.
taklwu commented on PR #11245:
URL: https://github.com/apache/ozone/pull/11245#issuecomment-5768035869

   ah, sorry, I normally rebase and push everything, I will just push without rebase next time.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-16400. Fix thread-safety of positioned reads in OzoneFSInputStream [ozone]

Posted by "szetszwo (via GitHub)" <gi...@apache.org>.
szetszwo commented on code in PR #11245:
URL: https://github.com/apache/ozone/pull/11245#discussion_r4053839280


##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneFSInputStream.java:
##########
@@ -211,4 +225,101 @@ public void readFully(long position, ByteBuffer buf) throws IOException {
       }
     }
   }
+
+  /**
+   * Byte-array positioned read. Tries the native stateless {@link ExtendedInputStream#readFully}
+   * path first (via a zero-copy {@link ByteBuffer#wrap}). Falls back to a synchronized
+   * seek-read-restore using byte-array {@link #read(byte[], int, int)} so that the fallback
+   * works for any {@link Seekable} stream, not just those that also implement
+   * {@link org.apache.hadoop.fs.ByteBufferReadable}.
+   * <p>
+   * {@link FSInputStream} synchronizes its inherited implementation on {@code this}, a different
+   * monitor from {@code positionedReadLock}; without this override the two APIs can interleave.
+   */
+  @Override
+  public int read(long position, byte[] buffer, int offset, int length) throws IOException {

Review Comment:
   For byte array read and readFully, let's just call the ByteBuffer methods?
   ```java
     @Override
     public int read(long position, byte[] buffer, int offset, int length) throws IOException {
       validatePositionedReadArgs(position, buffer, offset, length);
       return read(position, ByteBuffer.wrap(buffer, offset, length));
     }
   
     @Override
     public void readFully(long position, byte[] buffer, int offset, int length) throws IOException {
       validatePositionedReadArgs(position, buffer, offset, length);
       readFully(position, ByteBuffer.wrap(buffer, offset, length));
     }
   ```



##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneFSInputStream.java:
##########
@@ -37,7 +37,9 @@
  * The input stream for Ozone file system.
  *
  * TODO: Make inputStream generic for both rest and rpc clients
- * This class is not thread safe.
+ * Sequential reads are not thread safe. Positioned reads delegate to the
+ * underlying {@link ExtendedInputStream} when it supports them; otherwise they
+ * fall back to a synchronized seek-read-restore sequence.
  */

Review Comment:
   Let's remove the TODO and some suggestion below:
   ```java
   /**
    * The input stream for Ozone file system.
    * <p>
    * Sequential reads are NOT thread safe.
    * <p>
    * Positioned reads are thread safe.
    * When the underlying stream is an {@link ExtendedInputStream} and
    * when it supports {@link ExtendedInputStream#readFully(long, ByteBuffer)},
    * they delegate to it.
    * Otherwise, they fall back to the default synchronized seek-read-restore implementation.
    * <p>
    * Applications must use either sequential reads or position reads at any given time,
    * but not concurrent sequential/position reads
    */
   ```



##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneFSInputStream.java:
##########
@@ -211,4 +225,101 @@ public void readFully(long position, ByteBuffer buf) throws IOException {
       }
     }
   }
+
+  /**
+   * Byte-array positioned read. Tries the native stateless {@link ExtendedInputStream#readFully}
+   * path first (via a zero-copy {@link ByteBuffer#wrap}). Falls back to a synchronized
+   * seek-read-restore using byte-array {@link #read(byte[], int, int)} so that the fallback
+   * works for any {@link Seekable} stream, not just those that also implement
+   * {@link org.apache.hadoop.fs.ByteBufferReadable}.
+   * <p>
+   * {@link FSInputStream} synchronizes its inherited implementation on {@code this}, a different
+   * monitor from {@code positionedReadLock}; without this override the two APIs can interleave.
+   */
+  @Override
+  public int read(long position, byte[] buffer, int offset, int length) throws IOException {
+    // Validate before touching ByteBuffer so that null throws IAE (not NPE) and
+    // negative position propagates as EOFException rather than being swallowed.
+    validatePositionedReadArgs(position, buffer, offset, length);
+    if (length == 0) {
+      return 0;
+    }
+    if (inputStream instanceof ExtendedInputStream) {
+      final ByteBuffer buf = ByteBuffer.wrap(buffer, offset, length);
+      try {
+        if (((ExtendedInputStream) inputStream).readFully(position, buf)) {
+          final int bytesRead = length - buf.remaining();
+          // readFullyStateless can return true with bytesRead==0 for pos==length.
+          // Convert that to -1 to comply with PositionedReadable contract.
+          if (bytesRead == 0) {
+            return -1;
+          }
+          if (statistics != null) {
+            statistics.incrementBytesRead(bytesRead);
+          }
+          return bytesRead;
+        }
+      } catch (EOFException e) {
+        // pos < 0 was already rejected by validatePositionedReadArgs above,
+        // so this EOFException means pos >= stream length → return -1.
+        return -1;
+      }
+    }
+    synchronized (positionedReadLock) {
+      return readAtPositionSeekRestoreByteArray(position, buffer, offset, length);
+    }
+  }
+
+  @Override
+  public void readFully(long position, byte[] buffer, int offset, int length) throws IOException {
+    validatePositionedReadArgs(position, buffer, offset, length);
+    if (length == 0) {
+      return;
+    }
+    if (inputStream instanceof ExtendedInputStream) {
+      final ByteBuffer buf = ByteBuffer.wrap(buffer, offset, length);
+      try {
+        if (((ExtendedInputStream) inputStream).readFully(position, buf)) {
+          // readFullyStateless returns true once bytesRead > 0, even if the
+          // buffer is only partially filled. Check that the buffer is full.
+          if (buf.hasRemaining()) {
+            throw new EOFException("End of file reached before reading fully.");
+          }
+          return;
+        }
+      } catch (EOFException e) {
+        throw e;
+      }
+    }
+    synchronized (positionedReadLock) {
+      int remaining = length;
+      int off = offset;
+      while (remaining > 0) {
+        int n = readAtPositionSeekRestoreByteArray(position + (length - remaining), buffer, off, remaining);
+        if (n < 0) {
+          throw new EOFException("End of file reached before reading fully.");
+        }
+        off += n;
+        remaining -= n;
+      }
+    }
+  }
+
+  @Override
+  public void readFully(long position, byte[] buffer) throws IOException {
+    readFully(position, buffer, 0, buffer.length);
+  }

Review Comment:
   This is not needed since it is the same as the super method in FSInputStream.



##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneFSInputStream.java:
##########
@@ -211,4 +225,101 @@ public void readFully(long position, ByteBuffer buf) throws IOException {
       }
     }
   }
+
+  /**
+   * Byte-array positioned read. Tries the native stateless {@link ExtendedInputStream#readFully}
+   * path first (via a zero-copy {@link ByteBuffer#wrap}). Falls back to a synchronized
+   * seek-read-restore using byte-array {@link #read(byte[], int, int)} so that the fallback
+   * works for any {@link Seekable} stream, not just those that also implement
+   * {@link org.apache.hadoop.fs.ByteBufferReadable}.
+   * <p>
+   * {@link FSInputStream} synchronizes its inherited implementation on {@code this}, a different
+   * monitor from {@code positionedReadLock}; without this override the two APIs can interleave.
+   */
+  @Override
+  public int read(long position, byte[] buffer, int offset, int length) throws IOException {
+    // Validate before touching ByteBuffer so that null throws IAE (not NPE) and
+    // negative position propagates as EOFException rather than being swallowed.
+    validatePositionedReadArgs(position, buffer, offset, length);
+    if (length == 0) {
+      return 0;
+    }
+    if (inputStream instanceof ExtendedInputStream) {
+      final ByteBuffer buf = ByteBuffer.wrap(buffer, offset, length);
+      try {
+        if (((ExtendedInputStream) inputStream).readFully(position, buf)) {
+          final int bytesRead = length - buf.remaining();
+          // readFullyStateless can return true with bytesRead==0 for pos==length.
+          // Convert that to -1 to comply with PositionedReadable contract.
+          if (bytesRead == 0) {
+            return -1;
+          }
+          if (statistics != null) {
+            statistics.incrementBytesRead(bytesRead);
+          }

Review Comment:
   We seems not updating the statistics in the ByteBuffer methods.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-16400. Fix thread-safety of positioned reads in OzoneFSInputStream [ozone]

Posted by "taklwu (via GitHub)" <gi...@apache.org>.
taklwu commented on code in PR #11245:
URL: https://github.com/apache/ozone/pull/11245#discussion_r4066793227


##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneFSInputStream.java:
##########
@@ -211,4 +225,101 @@ public void readFully(long position, ByteBuffer buf) throws IOException {
       }
     }
   }
+
+  /**
+   * Byte-array positioned read. Tries the native stateless {@link ExtendedInputStream#readFully}
+   * path first (via a zero-copy {@link ByteBuffer#wrap}). Falls back to a synchronized
+   * seek-read-restore using byte-array {@link #read(byte[], int, int)} so that the fallback
+   * works for any {@link Seekable} stream, not just those that also implement
+   * {@link org.apache.hadoop.fs.ByteBufferReadable}.
+   * <p>
+   * {@link FSInputStream} synchronizes its inherited implementation on {@code this}, a different
+   * monitor from {@code positionedReadLock}; without this override the two APIs can interleave.
+   */
+  @Override
+  public int read(long position, byte[] buffer, int offset, int length) throws IOException {

Review Comment:
   for GDPRSymmetricKey aka Non-encrypted GDPR inputstream in [RpcClient line 2680](https://github.com/apache/ozone/blob/master/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java#L2680-L2682),  `RpcClient.createInputStream` -> `new OzoneInputStream(
       new CipherInputStream(lengthInputStream, gk.getCipher()))` where `CipherInputStream` does not support `ByteBufferReadable`
   
   so, should we keep the `readAtPositionSeekRestoreByteArray`?
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-16400. Fix thread-safety of positioned reads in OzoneFSInputStream [ozone]

Posted by "taklwu (via GitHub)" <gi...@apache.org>.
taklwu commented on code in PR #11245:
URL: https://github.com/apache/ozone/pull/11245#discussion_r4020836646


##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/OzoneCryptoInputStream.java:
##########
@@ -73,8 +79,18 @@ public int getBufferSize() {
     return bufferSize;
   }
 
+  /**
+   * {@link CryptoInputStream} does not synchronize its own methods, so every method moving the cursor of
+   * this stream is serialized here on the monitor of this stream. Otherwise a read or a seek could land in
+   * the middle of a positioned read and see (or undo) the cursor move that read does.
+   * This covers both the sequential-read API ({@link #read(byte[], int, int)}, {@link #read(ByteBuffer)},
+   * {@link #seek(long)}, {@link #getPos()}) and all positioned-read overloads
+   * ({@link #read(long, ByteBuffer)}, {@link #readFully(long, ByteBuffer)},
+   * {@link #read(long, byte[], int, int)}, {@link #readFully(long, byte[], int, int)},
+   * {@link #readFully(long, byte[])}).
+   */
   @Override
-  public int read(byte[] b, int off, int len) throws IOException {
+  public synchronized int read(byte[] b, int off, int len) throws IOException {

Review Comment:
   HDDS-16400



##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneFSInputStream.java:
##########
@@ -211,4 +222,19 @@ public void readFully(long position, ByteBuffer buf) throws IOException {
       }
     }
   }
+
+  @Override
+  public int read(long position, byte[] buffer, int offset, int length) throws IOException {
+    return read(position, ByteBuffer.wrap(buffer, offset, length));
+  }
+
+  @Override
+  public void readFully(long position, byte[] buffer, int offset, int length) throws IOException {
+    readFully(position, ByteBuffer.wrap(buffer, offset, length));
+  }
+
+  @Override
+  public void readFully(long position, byte[] buffer) throws IOException {
+    readFully(position, buffer, 0, buffer.length);
+  }

Review Comment:
   fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-16400. Fix thread-safety of positioned reads in OzoneFSInputStream [ozone]

Posted by "taklwu (via GitHub)" <gi...@apache.org>.
taklwu commented on PR #11245:
URL: https://github.com/apache/ozone/pull/11245#issuecomment-5702560175

   @szetszwo This is the first split PR for OzoneFSInputStream, focusing mainly on input streams that do not implement ExtendedInputStream (aka EC). meanwhile we will have `OzoneCryptoInputStream` support thread-safe positional read in next PR. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-16400. Fix thread-safety of positioned reads in OzoneFSInputStream [ozone]

Posted by "szetszwo (via GitHub)" <gi...@apache.org>.
szetszwo commented on PR #11245:
URL: https://github.com/apache/ozone/pull/11245#issuecomment-5765969906

   > taklwu [force-pushed](https://github.com/apache/ozone/compare/f64eb713de7ee74c9c5b359c2edc57670e712a66..8f6617b3b51e33f8cffb97dc77fb2afb52cc2cde) the HDDS-16400 branch from [f64eb71](https://github.com/apache/ozone/commit/f64eb713de7ee74c9c5b359c2edc57670e712a66) to [8f6617b](https://github.com/apache/ozone/commit/8f6617b3b51e33f8cffb97dc77fb2afb52cc2cde) ...
   
   @taklwu , Please don't force pushed since we cannot tell what are the new changes -- it also forces the reviewer to read everything from the beginning.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org