ChenSammi commented on code in PR #6444:
URL: https://github.com/apache/ozone/pull/6444#discussion_r1547258300
##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockInputStream.java:
##########
@@ -217,18 +218,27 @@ private boolean isConnectivityIssue(IOException ex) {
}
private void refreshBlockInfo(IOException cause) throws IOException {
- LOG.info("Unable to read information for block {} from pipeline {}: {}",
+ LOG.info("Attempting to update pipeline and block token for block {} from
pipeline {}: {}",
blockID, pipelineRef.get().getId(), cause.getMessage());
if (refreshFunction != null) {
LOG.debug("Re-fetching pipeline and block token for block {}", blockID);
BlockLocationInfo blockLocationInfo = refreshFunction.apply(blockID);
if (blockLocationInfo == null) {
- LOG.debug("No new block location info for block {}", blockID);
+ LOG.warn("No new block location info for block {}", blockID);
} else {
- LOG.debug("New pipeline for block {}: {}", blockID,
- blockLocationInfo.getPipeline());
setPipeline(blockLocationInfo.getPipeline());
- tokenRef.set(blockLocationInfo.getToken());
+ LOG.info("New pipeline for block {}: {}", blockID,
+ blockLocationInfo.getPipeline());
+
+ if (blockLocationInfo.getToken() != null) {
+ tokenRef.set(blockLocationInfo.getToken());
+ OzoneBlockTokenIdentifier tokenId = new OzoneBlockTokenIdentifier();
+ tokenId.readFromByteArray(tokenRef.get().getIdentifier());
+ LOG.info("A new token is added for block {}. Expiry: {}",
+ blockID, Instant.ofEpochMilli(tokenId.getExpiryDate()));
+ } else {
+ LOG.warn("Unable to add a new block token for block {}", blockID);
Review Comment:
If security is not enabled, then token will be null, this WARN log will be
confusing, I would suggest remove it.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]