cheeeee commented on PR #23832:
URL: https://github.com/apache/kafka/pull/23832#issuecomment-6199313266

   Two tests in `SslTransportLayerTest` set up a TLS connection, then call 
`transferFrom` with a file channel whose
   first 32 KiB read, recording what `transferFrom` writes instead of sending 
it. In
   `testTransferFromDoesNotSendStaleBytesAfterFailedRead` reads past that fail; 
in
   `testTransferFromDoesNotSendStaleBytesAtEndOfFile` the file ends there. 
Without the fix both fail for TLSv1.2 and
   TLSv1.3: the second call sends the first chunk again instead of throwing, or 
instead of returning 0.
   
   End to end, one controller and three brokers in Docker on a Linux 6.8 host, 
the leader's log directory on `dm-dust`,
   the tail of a 10 MiB segment made unreadable, a consumer reading the 
partition from the beginning over the SSL
   listener. Apart from this change, `SslTransportLayer` is the same in all 
three builds:
   
   | | trunk (03e6606430) | trunk (b9b0c909c6) + this PR | #23445 (0bb8dfc452) 
+ this PR |
   |---|---|---|---|
   | `pread64` `-EIO` | 169 | 718 | 3 (2 on the network thread, 1 the re-read 
on the scheduler) |
   | read error logged by the broker | no | 359 x `disconnected` with 
`IOException: Input/output error` | `ERROR` from `LogDirFailureChannel` |
   | corrupt batch sent to the consumer | yes | no | no |
   | log directory / leader afterwards | online / 1 | online / 1 | offline / 2 |
   | records consumed | 5456, then `Record is corrupt` | 0 of 20000, the fetch 
fails | 20000 of 20000 |
   
   With this PR alone the read error surfaces as it does over PLAINTEXT (each 
failed send logs it and closes the
   connection) instead of turning into a corrupt batch. Offlining the directory 
on it is #23445; with both, the SSL run
   behaves like the PLAINTEXT one: the directory goes offline, leadership moves 
and the consumer reads everything.
   
   Ran the full `clients`, `storage`, `raft`, `server` and `core` test suites, 
as a non-root user, on a shared host under
   heavy load: `clients` passes; 5 integration test classes in `storage` and 
`core` timed out and pass when re-run.
   Checkstyle and spotless pass for `clients`.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to