HDFS-11966. [SPS] Correct the log in BlockStorageMovementAttemptedItems#blockStorageMovementResultCheck. Contributed by Surendra Singh Lilhore.
This commit is contained in:
parent
20f9c62336
commit
46f7523eb8
@ -296,19 +296,17 @@ void blockStorageMovementResultCheck() throws IOException {
|
|||||||
.next();
|
.next();
|
||||||
synchronized (storageMovementAttemptedItems) {
|
synchronized (storageMovementAttemptedItems) {
|
||||||
Status status = storageMovementAttemptedResult.getStatus();
|
Status status = storageMovementAttemptedResult.getStatus();
|
||||||
|
long trackId = storageMovementAttemptedResult.getTrackId();
|
||||||
ItemInfo itemInfo;
|
ItemInfo itemInfo;
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case FAILURE:
|
case FAILURE:
|
||||||
blockStorageMovementNeeded
|
blockStorageMovementNeeded.add(trackId);
|
||||||
.add(storageMovementAttemptedResult.getTrackId());
|
|
||||||
LOG.warn("Blocks storage movement results for the tracking id: {}"
|
LOG.warn("Blocks storage movement results for the tracking id: {}"
|
||||||
+ " is reported from co-ordinating datanode, but result"
|
+ " is reported from co-ordinating datanode, but result"
|
||||||
+ " status is FAILURE. So, added for retry",
|
+ " status is FAILURE. So, added for retry", trackId);
|
||||||
storageMovementAttemptedResult.getTrackId());
|
|
||||||
break;
|
break;
|
||||||
case SUCCESS:
|
case SUCCESS:
|
||||||
itemInfo = storageMovementAttemptedItems
|
itemInfo = storageMovementAttemptedItems.get(trackId);
|
||||||
.get(storageMovementAttemptedResult.getTrackId());
|
|
||||||
|
|
||||||
// ItemInfo could be null. One case is, before the blocks movements
|
// ItemInfo could be null. One case is, before the blocks movements
|
||||||
// result arrives the attempted trackID became timed out and then
|
// result arrives the attempted trackID became timed out and then
|
||||||
@ -318,20 +316,23 @@ void blockStorageMovementResultCheck() throws IOException {
|
|||||||
// following condition. If all the block locations under the trackID
|
// following condition. If all the block locations under the trackID
|
||||||
// are attempted and failed to find matching target nodes to satisfy
|
// are attempted and failed to find matching target nodes to satisfy
|
||||||
// storage policy in previous SPS iteration.
|
// storage policy in previous SPS iteration.
|
||||||
if (itemInfo != null
|
String msg = "Blocks storage movement is SUCCESS for the track id: "
|
||||||
&& !itemInfo.isAllBlockLocsAttemptedToSatisfy()) {
|
+ trackId + " reported from co-ordinating datanode.";
|
||||||
blockStorageMovementNeeded
|
if (itemInfo != null) {
|
||||||
.add(storageMovementAttemptedResult.getTrackId());
|
if (!itemInfo.isAllBlockLocsAttemptedToSatisfy()) {
|
||||||
LOG.warn("Blocks storage movement is SUCCESS for the track id: {}"
|
blockStorageMovementNeeded.add(trackId);
|
||||||
+ " reported from co-ordinating datanode. But adding trackID"
|
LOG.warn("{} But adding trackID back to retry queue as some of"
|
||||||
+ " back to retry queue as some of the blocks couldn't find"
|
+ " the blocks couldn't find matching target nodes in"
|
||||||
+ " matching target nodes in previous SPS iteration.",
|
+ " previous SPS iteration.", msg);
|
||||||
storageMovementAttemptedResult.getTrackId());
|
} else {
|
||||||
|
LOG.info(msg);
|
||||||
|
// Remove xattr for the track id.
|
||||||
|
this.sps.postBlkStorageMovementCleanup(
|
||||||
|
storageMovementAttemptedResult.getTrackId());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
LOG.info("Blocks storage movement is SUCCESS for the track id: {}"
|
LOG.info("{} But the trackID doesn't exists in "
|
||||||
+ " reported from co-ordinating datanode. But the trackID "
|
+ "storageMovementAttemptedItems list", msg);
|
||||||
+ "doesn't exists in storageMovementAttemptedItems list",
|
|
||||||
storageMovementAttemptedResult.getTrackId());
|
|
||||||
// Remove xattr for the track id.
|
// Remove xattr for the track id.
|
||||||
this.sps.postBlkStorageMovementCleanup(
|
this.sps.postBlkStorageMovementCleanup(
|
||||||
storageMovementAttemptedResult.getTrackId());
|
storageMovementAttemptedResult.getTrackId());
|
||||||
|
Loading…
Reference in New Issue
Block a user