Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print out mount path when replica token file fail to deserialize #2746

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public void serializeTokens(List<ReplicaTokenInfo> tokenInfoList, OutputStream o
}
}

public List<ReplicaTokenInfo> deserializeTokens(InputStream inputStream) throws IOException, ReplicationException {
public List<ReplicaTokenInfo> deserializeTokens(InputStream inputStream) throws IOException {
CrcInputStream crcStream = new CrcInputStream(inputStream);
DataInputStream stream = new DataInputStream(crcStream);
List<ReplicaTokenInfo> tokenInfoList = new ArrayList<>();
Expand Down Expand Up @@ -225,12 +225,14 @@ public List<ReplicaTokenInfo> deserializeTokens(InputStream inputStream) throws
long computedCrc = crcStream.getValue();
long readCrc = stream.readLong();
if (computedCrc != readCrc) {
throw new ReplicationException(
throw new IOException(
"Crc mismatch during replica token deserialization, computed " + computedCrc + ", read " + readCrc);
}
return tokenInfoList;
} catch (IOException e) {
throw new ReplicationException("IO error deserializing replica tokens", e);
throw e;
} catch (Exception e) {
throw new IOException("Fail to deserialize replica tokens", e);
} finally {
stream.close();
}
Expand Down