Attila Doroszlai created HDDS-15623:
---------------------------------------
Summary: Disk check may not completely read test file
Key: HDDS-15623
URL: https://issues.apache.org/jira/browse/HDDS-15623
Project: Apache Ozone
Issue Type: Sub-task
Components: Ozone Datanode
Reporter: Attila Doroszlai
Assignee: Attila Doroszlai
Disk read/write check may not completely read the test file with
{{InputStream.read()}}.
{code:title=https://github.com/apache/ozone/blob/9649e0ee3b653c96cb58aaa0dd2eea6c42026979/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/utils/DiskCheckUtil.java#L167-L175}
// Read data back from the test file.
byte[] readBytes = new byte[numBytesToWrite];
try (InputStream fis = Files.newInputStream(testFile.toPath())) {
int numBytesRead = fis.read(readBytes);
if (numBytesRead != numBytesToWrite) {
logError(storageDir, String.format("%d bytes written to file %s " +
"but %d bytes were read back.", numBytesToWrite,
testFile.getAbsolutePath(), numBytesRead));
return false;
{code}
Also, test file is not cleaned up if read check fails for any reason.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]