[jira] [Updated] (HDFS-7645) Rolling upgrade is restoring blocks from trash multiple times
[ https://issues.apache.org/jira/browse/HDFS-7645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Junping Du updated HDFS-7645: - Fix Version/s: 2.8.0 > Rolling upgrade is restoring blocks from trash multiple times > - > > Key: HDFS-7645 > URL: https://issues.apache.org/jira/browse/HDFS-7645 > Project: Hadoop HDFS > Issue Type: Improvement > Components: datanode >Affects Versions: 2.6.0 >Reporter: Nathan Roberts >Assignee: Keisuke Ogiwara > Fix For: 2.8.0, 2.7.2, 3.0.0-alpha1 > > Attachments: HDFS-7645.01.patch, HDFS-7645.02.patch, > HDFS-7645.03.patch, HDFS-7645.04.patch, HDFS-7645.05.patch, > HDFS-7645.06.patch, HDFS-7645.07.patch > > > When performing an HDFS rolling upgrade, the trash directory is getting > restored twice when under normal circumstances it shouldn't need to be > restored at all. iiuc, the only time these blocks should be restored is if we > need to rollback a rolling upgrade. > On a busy cluster, this can cause significant and unnecessary block churn > both on the datanodes, and more importantly in the namenode. > The two times this happens are: > 1) restart of DN onto new software > {code} > private void doTransition(DataNode datanode, StorageDirectory sd, > NamespaceInfo nsInfo, StartupOption startOpt) throws IOException { > if (startOpt == StartupOption.ROLLBACK && sd.getPreviousDir().exists()) { > Preconditions.checkState(!getTrashRootDir(sd).exists(), > sd.getPreviousDir() + " and " + getTrashRootDir(sd) + " should not > " + > " both be present."); > doRollback(sd, nsInfo); // rollback if applicable > } else { > // Restore all the files in the trash. The restored files are retained > // during rolling upgrade rollback. They are deleted during rolling > // upgrade downgrade. > int restored = restoreBlockFilesFromTrash(getTrashRootDir(sd)); > LOG.info("Restored " + restored + " block files from trash."); > } > {code} > 2) When heartbeat response no longer indicates a rollingupgrade is in progress > {code} > /** >* Signal the current rolling upgrade status as indicated by the NN. >* @param inProgress true if a rolling upgrade is in progress >*/ > void signalRollingUpgrade(boolean inProgress) throws IOException { > String bpid = getBlockPoolId(); > if (inProgress) { > dn.getFSDataset().enableTrash(bpid); > dn.getFSDataset().setRollingUpgradeMarker(bpid); > } else { > dn.getFSDataset().restoreTrash(bpid); > dn.getFSDataset().clearRollingUpgradeMarker(bpid); > } > } > {code} > HDFS-6800 and HDFS-6981 were modifying this behavior making it not completely > clear whether this is somehow intentional. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Updated] (HDFS-7645) Rolling upgrade is restoring blocks from trash multiple times
[ https://issues.apache.org/jira/browse/HDFS-7645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrew Wang updated HDFS-7645: -- Hadoop Flags: Reviewed (was: Incompatible change,Reviewed) > Rolling upgrade is restoring blocks from trash multiple times > - > > Key: HDFS-7645 > URL: https://issues.apache.org/jira/browse/HDFS-7645 > Project: Hadoop HDFS > Issue Type: Improvement > Components: datanode >Affects Versions: 2.6.0 >Reporter: Nathan Roberts >Assignee: Keisuke Ogiwara > Fix For: 2.7.2, 3.0.0-alpha1 > > Attachments: HDFS-7645.01.patch, HDFS-7645.02.patch, > HDFS-7645.03.patch, HDFS-7645.04.patch, HDFS-7645.05.patch, > HDFS-7645.06.patch, HDFS-7645.07.patch > > > When performing an HDFS rolling upgrade, the trash directory is getting > restored twice when under normal circumstances it shouldn't need to be > restored at all. iiuc, the only time these blocks should be restored is if we > need to rollback a rolling upgrade. > On a busy cluster, this can cause significant and unnecessary block churn > both on the datanodes, and more importantly in the namenode. > The two times this happens are: > 1) restart of DN onto new software > {code} > private void doTransition(DataNode datanode, StorageDirectory sd, > NamespaceInfo nsInfo, StartupOption startOpt) throws IOException { > if (startOpt == StartupOption.ROLLBACK && sd.getPreviousDir().exists()) { > Preconditions.checkState(!getTrashRootDir(sd).exists(), > sd.getPreviousDir() + " and " + getTrashRootDir(sd) + " should not > " + > " both be present."); > doRollback(sd, nsInfo); // rollback if applicable > } else { > // Restore all the files in the trash. The restored files are retained > // during rolling upgrade rollback. They are deleted during rolling > // upgrade downgrade. > int restored = restoreBlockFilesFromTrash(getTrashRootDir(sd)); > LOG.info("Restored " + restored + " block files from trash."); > } > {code} > 2) When heartbeat response no longer indicates a rollingupgrade is in progress > {code} > /** >* Signal the current rolling upgrade status as indicated by the NN. >* @param inProgress true if a rolling upgrade is in progress >*/ > void signalRollingUpgrade(boolean inProgress) throws IOException { > String bpid = getBlockPoolId(); > if (inProgress) { > dn.getFSDataset().enableTrash(bpid); > dn.getFSDataset().setRollingUpgradeMarker(bpid); > } else { > dn.getFSDataset().restoreTrash(bpid); > dn.getFSDataset().clearRollingUpgradeMarker(bpid); > } > } > {code} > HDFS-6800 and HDFS-6981 were modifying this behavior making it not completely > clear whether this is somehow intentional. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Updated] (HDFS-7645) Rolling upgrade is restoring blocks from trash multiple times
[ https://issues.apache.org/jira/browse/HDFS-7645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Vinod Kumar Vavilapalli updated HDFS-7645: -- Fix Version/s: (was: 3.0.0) > Rolling upgrade is restoring blocks from trash multiple times > - > > Key: HDFS-7645 > URL: https://issues.apache.org/jira/browse/HDFS-7645 > Project: Hadoop HDFS > Issue Type: Improvement > Components: datanode >Affects Versions: 2.6.0 >Reporter: Nathan Roberts >Assignee: Keisuke Ogiwara > Fix For: 2.7.2 > > Attachments: HDFS-7645.01.patch, HDFS-7645.02.patch, > HDFS-7645.03.patch, HDFS-7645.04.patch, HDFS-7645.05.patch, > HDFS-7645.06.patch, HDFS-7645.07.patch > > > When performing an HDFS rolling upgrade, the trash directory is getting > restored twice when under normal circumstances it shouldn't need to be > restored at all. iiuc, the only time these blocks should be restored is if we > need to rollback a rolling upgrade. > On a busy cluster, this can cause significant and unnecessary block churn > both on the datanodes, and more importantly in the namenode. > The two times this happens are: > 1) restart of DN onto new software > {code} > private void doTransition(DataNode datanode, StorageDirectory sd, > NamespaceInfo nsInfo, StartupOption startOpt) throws IOException { > if (startOpt == StartupOption.ROLLBACK && sd.getPreviousDir().exists()) { > Preconditions.checkState(!getTrashRootDir(sd).exists(), > sd.getPreviousDir() + " and " + getTrashRootDir(sd) + " should not > " + > " both be present."); > doRollback(sd, nsInfo); // rollback if applicable > } else { > // Restore all the files in the trash. The restored files are retained > // during rolling upgrade rollback. They are deleted during rolling > // upgrade downgrade. > int restored = restoreBlockFilesFromTrash(getTrashRootDir(sd)); > LOG.info("Restored " + restored + " block files from trash."); > } > {code} > 2) When heartbeat response no longer indicates a rollingupgrade is in progress > {code} > /** >* Signal the current rolling upgrade status as indicated by the NN. >* @param inProgress true if a rolling upgrade is in progress >*/ > void signalRollingUpgrade(boolean inProgress) throws IOException { > String bpid = getBlockPoolId(); > if (inProgress) { > dn.getFSDataset().enableTrash(bpid); > dn.getFSDataset().setRollingUpgradeMarker(bpid); > } else { > dn.getFSDataset().restoreTrash(bpid); > dn.getFSDataset().clearRollingUpgradeMarker(bpid); > } > } > {code} > HDFS-6800 and HDFS-6981 were modifying this behavior making it not completely > clear whether this is somehow intentional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HDFS-7645) Rolling upgrade is restoring blocks from trash multiple times
[ https://issues.apache.org/jira/browse/HDFS-7645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kihwal Lee updated HDFS-7645: - Fix Version/s: (was: 2.8.0) 2.7.2 3.0.0 > Rolling upgrade is restoring blocks from trash multiple times > - > > Key: HDFS-7645 > URL: https://issues.apache.org/jira/browse/HDFS-7645 > Project: Hadoop HDFS > Issue Type: Improvement > Components: datanode >Affects Versions: 2.6.0 >Reporter: Nathan Roberts >Assignee: Keisuke Ogiwara > Fix For: 3.0.0, 2.7.2 > > Attachments: HDFS-7645.01.patch, HDFS-7645.02.patch, > HDFS-7645.03.patch, HDFS-7645.04.patch, HDFS-7645.05.patch, > HDFS-7645.06.patch, HDFS-7645.07.patch > > > When performing an HDFS rolling upgrade, the trash directory is getting > restored twice when under normal circumstances it shouldn't need to be > restored at all. iiuc, the only time these blocks should be restored is if we > need to rollback a rolling upgrade. > On a busy cluster, this can cause significant and unnecessary block churn > both on the datanodes, and more importantly in the namenode. > The two times this happens are: > 1) restart of DN onto new software > {code} > private void doTransition(DataNode datanode, StorageDirectory sd, > NamespaceInfo nsInfo, StartupOption startOpt) throws IOException { > if (startOpt == StartupOption.ROLLBACK && sd.getPreviousDir().exists()) { > Preconditions.checkState(!getTrashRootDir(sd).exists(), > sd.getPreviousDir() + " and " + getTrashRootDir(sd) + " should not > " + > " both be present."); > doRollback(sd, nsInfo); // rollback if applicable > } else { > // Restore all the files in the trash. The restored files are retained > // during rolling upgrade rollback. They are deleted during rolling > // upgrade downgrade. > int restored = restoreBlockFilesFromTrash(getTrashRootDir(sd)); > LOG.info("Restored " + restored + " block files from trash."); > } > {code} > 2) When heartbeat response no longer indicates a rollingupgrade is in progress > {code} > /** >* Signal the current rolling upgrade status as indicated by the NN. >* @param inProgress true if a rolling upgrade is in progress >*/ > void signalRollingUpgrade(boolean inProgress) throws IOException { > String bpid = getBlockPoolId(); > if (inProgress) { > dn.getFSDataset().enableTrash(bpid); > dn.getFSDataset().setRollingUpgradeMarker(bpid); > } else { > dn.getFSDataset().restoreTrash(bpid); > dn.getFSDataset().clearRollingUpgradeMarker(bpid); > } > } > {code} > HDFS-6800 and HDFS-6981 were modifying this behavior making it not completely > clear whether this is somehow intentional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HDFS-7645) Rolling upgrade is restoring blocks from trash multiple times
[ https://issues.apache.org/jira/browse/HDFS-7645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrew Wang updated HDFS-7645: -- Hadoop Flags: Incompatible change,Reviewed (was: Reviewed) This change is incompatible since we expose RollingUpgradeInfo in the NN's JMX (a public API). As discussed above, rather than being null on finalization, it now sets the finalization time. Have we thought about other ways of solving this issue? Else we can change the JMX method to still return null on finalization. > Rolling upgrade is restoring blocks from trash multiple times > - > > Key: HDFS-7645 > URL: https://issues.apache.org/jira/browse/HDFS-7645 > Project: Hadoop HDFS > Issue Type: Improvement > Components: datanode >Affects Versions: 2.6.0 >Reporter: Nathan Roberts >Assignee: Keisuke Ogiwara > Fix For: 2.8.0 > > Attachments: HDFS-7645.01.patch, HDFS-7645.02.patch, > HDFS-7645.03.patch, HDFS-7645.04.patch, HDFS-7645.05.patch, > HDFS-7645.06.patch, HDFS-7645.07.patch > > > When performing an HDFS rolling upgrade, the trash directory is getting > restored twice when under normal circumstances it shouldn't need to be > restored at all. iiuc, the only time these blocks should be restored is if we > need to rollback a rolling upgrade. > On a busy cluster, this can cause significant and unnecessary block churn > both on the datanodes, and more importantly in the namenode. > The two times this happens are: > 1) restart of DN onto new software > {code} > private void doTransition(DataNode datanode, StorageDirectory sd, > NamespaceInfo nsInfo, StartupOption startOpt) throws IOException { > if (startOpt == StartupOption.ROLLBACK && sd.getPreviousDir().exists()) { > Preconditions.checkState(!getTrashRootDir(sd).exists(), > sd.getPreviousDir() + " and " + getTrashRootDir(sd) + " should not > " + > " both be present."); > doRollback(sd, nsInfo); // rollback if applicable > } else { > // Restore all the files in the trash. The restored files are retained > // during rolling upgrade rollback. They are deleted during rolling > // upgrade downgrade. > int restored = restoreBlockFilesFromTrash(getTrashRootDir(sd)); > LOG.info("Restored " + restored + " block files from trash."); > } > {code} > 2) When heartbeat response no longer indicates a rollingupgrade is in progress > {code} > /** >* Signal the current rolling upgrade status as indicated by the NN. >* @param inProgress true if a rolling upgrade is in progress >*/ > void signalRollingUpgrade(boolean inProgress) throws IOException { > String bpid = getBlockPoolId(); > if (inProgress) { > dn.getFSDataset().enableTrash(bpid); > dn.getFSDataset().setRollingUpgradeMarker(bpid); > } else { > dn.getFSDataset().restoreTrash(bpid); > dn.getFSDataset().clearRollingUpgradeMarker(bpid); > } > } > {code} > HDFS-6800 and HDFS-6981 were modifying this behavior making it not completely > clear whether this is somehow intentional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HDFS-7645) Rolling upgrade is restoring blocks from trash multiple times
[ https://issues.apache.org/jira/browse/HDFS-7645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Arpit Agarwal updated HDFS-7645: Resolution: Fixed Fix Version/s: 2.8.0 Hadoop Flags: Reviewed Status: Resolved (was: Patch Available) I committed it to trunk and branch-2. Thanks for the contribution [~vinayrpet] and [~ogikei]. I credited you both for the patch. > Rolling upgrade is restoring blocks from trash multiple times > - > > Key: HDFS-7645 > URL: https://issues.apache.org/jira/browse/HDFS-7645 > Project: Hadoop HDFS > Issue Type: Improvement > Components: datanode >Affects Versions: 2.6.0 >Reporter: Nathan Roberts >Assignee: Keisuke Ogiwara > Fix For: 2.8.0 > > Attachments: HDFS-7645.01.patch, HDFS-7645.02.patch, > HDFS-7645.03.patch, HDFS-7645.04.patch, HDFS-7645.05.patch, > HDFS-7645.06.patch, HDFS-7645.07.patch > > > When performing an HDFS rolling upgrade, the trash directory is getting > restored twice when under normal circumstances it shouldn't need to be > restored at all. iiuc, the only time these blocks should be restored is if we > need to rollback a rolling upgrade. > On a busy cluster, this can cause significant and unnecessary block churn > both on the datanodes, and more importantly in the namenode. > The two times this happens are: > 1) restart of DN onto new software > {code} > private void doTransition(DataNode datanode, StorageDirectory sd, > NamespaceInfo nsInfo, StartupOption startOpt) throws IOException { > if (startOpt == StartupOption.ROLLBACK && sd.getPreviousDir().exists()) { > Preconditions.checkState(!getTrashRootDir(sd).exists(), > sd.getPreviousDir() + " and " + getTrashRootDir(sd) + " should not > " + > " both be present."); > doRollback(sd, nsInfo); // rollback if applicable > } else { > // Restore all the files in the trash. The restored files are retained > // during rolling upgrade rollback. They are deleted during rolling > // upgrade downgrade. > int restored = restoreBlockFilesFromTrash(getTrashRootDir(sd)); > LOG.info("Restored " + restored + " block files from trash."); > } > {code} > 2) When heartbeat response no longer indicates a rollingupgrade is in progress > {code} > /** >* Signal the current rolling upgrade status as indicated by the NN. >* @param inProgress true if a rolling upgrade is in progress >*/ > void signalRollingUpgrade(boolean inProgress) throws IOException { > String bpid = getBlockPoolId(); > if (inProgress) { > dn.getFSDataset().enableTrash(bpid); > dn.getFSDataset().setRollingUpgradeMarker(bpid); > } else { > dn.getFSDataset().restoreTrash(bpid); > dn.getFSDataset().clearRollingUpgradeMarker(bpid); > } > } > {code} > HDFS-6800 and HDFS-6981 were modifying this behavior making it not completely > clear whether this is somehow intentional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HDFS-7645) Rolling upgrade is restoring blocks from trash multiple times
[ https://issues.apache.org/jira/browse/HDFS-7645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Arpit Agarwal updated HDFS-7645: Issue Type: Improvement (was: Bug) > Rolling upgrade is restoring blocks from trash multiple times > - > > Key: HDFS-7645 > URL: https://issues.apache.org/jira/browse/HDFS-7645 > Project: Hadoop HDFS > Issue Type: Improvement > Components: datanode >Affects Versions: 2.6.0 >Reporter: Nathan Roberts >Assignee: Keisuke Ogiwara > Attachments: HDFS-7645.01.patch, HDFS-7645.02.patch, > HDFS-7645.03.patch, HDFS-7645.04.patch, HDFS-7645.05.patch, > HDFS-7645.06.patch, HDFS-7645.07.patch > > > When performing an HDFS rolling upgrade, the trash directory is getting > restored twice when under normal circumstances it shouldn't need to be > restored at all. iiuc, the only time these blocks should be restored is if we > need to rollback a rolling upgrade. > On a busy cluster, this can cause significant and unnecessary block churn > both on the datanodes, and more importantly in the namenode. > The two times this happens are: > 1) restart of DN onto new software > {code} > private void doTransition(DataNode datanode, StorageDirectory sd, > NamespaceInfo nsInfo, StartupOption startOpt) throws IOException { > if (startOpt == StartupOption.ROLLBACK && sd.getPreviousDir().exists()) { > Preconditions.checkState(!getTrashRootDir(sd).exists(), > sd.getPreviousDir() + " and " + getTrashRootDir(sd) + " should not > " + > " both be present."); > doRollback(sd, nsInfo); // rollback if applicable > } else { > // Restore all the files in the trash. The restored files are retained > // during rolling upgrade rollback. They are deleted during rolling > // upgrade downgrade. > int restored = restoreBlockFilesFromTrash(getTrashRootDir(sd)); > LOG.info("Restored " + restored + " block files from trash."); > } > {code} > 2) When heartbeat response no longer indicates a rollingupgrade is in progress > {code} > /** >* Signal the current rolling upgrade status as indicated by the NN. >* @param inProgress true if a rolling upgrade is in progress >*/ > void signalRollingUpgrade(boolean inProgress) throws IOException { > String bpid = getBlockPoolId(); > if (inProgress) { > dn.getFSDataset().enableTrash(bpid); > dn.getFSDataset().setRollingUpgradeMarker(bpid); > } else { > dn.getFSDataset().restoreTrash(bpid); > dn.getFSDataset().clearRollingUpgradeMarker(bpid); > } > } > {code} > HDFS-6800 and HDFS-6981 were modifying this behavior making it not completely > clear whether this is somehow intentional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HDFS-7645) Rolling upgrade is restoring blocks from trash multiple times
[ https://issues.apache.org/jira/browse/HDFS-7645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Vinayakumar B updated HDFS-7645: Attachment: HDFS-7645.07.patch Fixed failure > Rolling upgrade is restoring blocks from trash multiple times > - > > Key: HDFS-7645 > URL: https://issues.apache.org/jira/browse/HDFS-7645 > Project: Hadoop HDFS > Issue Type: Bug > Components: datanode >Affects Versions: 2.6.0 >Reporter: Nathan Roberts >Assignee: Keisuke Ogiwara > Attachments: HDFS-7645.01.patch, HDFS-7645.02.patch, > HDFS-7645.03.patch, HDFS-7645.04.patch, HDFS-7645.05.patch, > HDFS-7645.06.patch, HDFS-7645.07.patch > > > When performing an HDFS rolling upgrade, the trash directory is getting > restored twice when under normal circumstances it shouldn't need to be > restored at all. iiuc, the only time these blocks should be restored is if we > need to rollback a rolling upgrade. > On a busy cluster, this can cause significant and unnecessary block churn > both on the datanodes, and more importantly in the namenode. > The two times this happens are: > 1) restart of DN onto new software > {code} > private void doTransition(DataNode datanode, StorageDirectory sd, > NamespaceInfo nsInfo, StartupOption startOpt) throws IOException { > if (startOpt == StartupOption.ROLLBACK && sd.getPreviousDir().exists()) { > Preconditions.checkState(!getTrashRootDir(sd).exists(), > sd.getPreviousDir() + " and " + getTrashRootDir(sd) + " should not > " + > " both be present."); > doRollback(sd, nsInfo); // rollback if applicable > } else { > // Restore all the files in the trash. The restored files are retained > // during rolling upgrade rollback. They are deleted during rolling > // upgrade downgrade. > int restored = restoreBlockFilesFromTrash(getTrashRootDir(sd)); > LOG.info("Restored " + restored + " block files from trash."); > } > {code} > 2) When heartbeat response no longer indicates a rollingupgrade is in progress > {code} > /** >* Signal the current rolling upgrade status as indicated by the NN. >* @param inProgress true if a rolling upgrade is in progress >*/ > void signalRollingUpgrade(boolean inProgress) throws IOException { > String bpid = getBlockPoolId(); > if (inProgress) { > dn.getFSDataset().enableTrash(bpid); > dn.getFSDataset().setRollingUpgradeMarker(bpid); > } else { > dn.getFSDataset().restoreTrash(bpid); > dn.getFSDataset().clearRollingUpgradeMarker(bpid); > } > } > {code} > HDFS-6800 and HDFS-6981 were modifying this behavior making it not completely > clear whether this is somehow intentional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HDFS-7645) Rolling upgrade is restoring blocks from trash multiple times
[ https://issues.apache.org/jira/browse/HDFS-7645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Vinayakumar B updated HDFS-7645: Attachment: HDFS-7645.06.patch bq. Two successive rolling upgrades. Done bq. Regular upgrade initiated immediately after the rolling upgrade is completed to make sure we correctly handle RollingUpgradeStatus.finalized and DNA_FINALIZE together. I have added a test for this. But didn't understand how "RollingUpgradeStatus.finalized and DNA_FINALIZE" will come. So didnt add any assertions. After restart RollingUpgradeStatus will be non-null after finalize only till NN is restarted. Once its restarted it will be null. > Rolling upgrade is restoring blocks from trash multiple times > - > > Key: HDFS-7645 > URL: https://issues.apache.org/jira/browse/HDFS-7645 > Project: Hadoop HDFS > Issue Type: Bug > Components: datanode >Affects Versions: 2.6.0 >Reporter: Nathan Roberts >Assignee: Keisuke Ogiwara > Attachments: HDFS-7645.01.patch, HDFS-7645.02.patch, > HDFS-7645.03.patch, HDFS-7645.04.patch, HDFS-7645.05.patch, HDFS-7645.06.patch > > > When performing an HDFS rolling upgrade, the trash directory is getting > restored twice when under normal circumstances it shouldn't need to be > restored at all. iiuc, the only time these blocks should be restored is if we > need to rollback a rolling upgrade. > On a busy cluster, this can cause significant and unnecessary block churn > both on the datanodes, and more importantly in the namenode. > The two times this happens are: > 1) restart of DN onto new software > {code} > private void doTransition(DataNode datanode, StorageDirectory sd, > NamespaceInfo nsInfo, StartupOption startOpt) throws IOException { > if (startOpt == StartupOption.ROLLBACK && sd.getPreviousDir().exists()) { > Preconditions.checkState(!getTrashRootDir(sd).exists(), > sd.getPreviousDir() + " and " + getTrashRootDir(sd) + " should not > " + > " both be present."); > doRollback(sd, nsInfo); // rollback if applicable > } else { > // Restore all the files in the trash. The restored files are retained > // during rolling upgrade rollback. They are deleted during rolling > // upgrade downgrade. > int restored = restoreBlockFilesFromTrash(getTrashRootDir(sd)); > LOG.info("Restored " + restored + " block files from trash."); > } > {code} > 2) When heartbeat response no longer indicates a rollingupgrade is in progress > {code} > /** >* Signal the current rolling upgrade status as indicated by the NN. >* @param inProgress true if a rolling upgrade is in progress >*/ > void signalRollingUpgrade(boolean inProgress) throws IOException { > String bpid = getBlockPoolId(); > if (inProgress) { > dn.getFSDataset().enableTrash(bpid); > dn.getFSDataset().setRollingUpgradeMarker(bpid); > } else { > dn.getFSDataset().restoreTrash(bpid); > dn.getFSDataset().clearRollingUpgradeMarker(bpid); > } > } > {code} > HDFS-6800 and HDFS-6981 were modifying this behavior making it not completely > clear whether this is somehow intentional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HDFS-7645) Rolling upgrade is restoring blocks from trash multiple times
[ https://issues.apache.org/jira/browse/HDFS-7645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Vinayakumar B updated HDFS-7645: Attachment: HDFS-7645.05.patch Attaching patch for keeping the {{RollingUpgradeStatus}} in NN after finalization. On top of [~ogikei]'s work. > Rolling upgrade is restoring blocks from trash multiple times > - > > Key: HDFS-7645 > URL: https://issues.apache.org/jira/browse/HDFS-7645 > Project: Hadoop HDFS > Issue Type: Bug > Components: datanode >Affects Versions: 2.6.0 >Reporter: Nathan Roberts >Assignee: Keisuke Ogiwara > Attachments: HDFS-7645.01.patch, HDFS-7645.02.patch, > HDFS-7645.03.patch, HDFS-7645.04.patch, HDFS-7645.05.patch > > > When performing an HDFS rolling upgrade, the trash directory is getting > restored twice when under normal circumstances it shouldn't need to be > restored at all. iiuc, the only time these blocks should be restored is if we > need to rollback a rolling upgrade. > On a busy cluster, this can cause significant and unnecessary block churn > both on the datanodes, and more importantly in the namenode. > The two times this happens are: > 1) restart of DN onto new software > {code} > private void doTransition(DataNode datanode, StorageDirectory sd, > NamespaceInfo nsInfo, StartupOption startOpt) throws IOException { > if (startOpt == StartupOption.ROLLBACK && sd.getPreviousDir().exists()) { > Preconditions.checkState(!getTrashRootDir(sd).exists(), > sd.getPreviousDir() + " and " + getTrashRootDir(sd) + " should not > " + > " both be present."); > doRollback(sd, nsInfo); // rollback if applicable > } else { > // Restore all the files in the trash. The restored files are retained > // during rolling upgrade rollback. They are deleted during rolling > // upgrade downgrade. > int restored = restoreBlockFilesFromTrash(getTrashRootDir(sd)); > LOG.info("Restored " + restored + " block files from trash."); > } > {code} > 2) When heartbeat response no longer indicates a rollingupgrade is in progress > {code} > /** >* Signal the current rolling upgrade status as indicated by the NN. >* @param inProgress true if a rolling upgrade is in progress >*/ > void signalRollingUpgrade(boolean inProgress) throws IOException { > String bpid = getBlockPoolId(); > if (inProgress) { > dn.getFSDataset().enableTrash(bpid); > dn.getFSDataset().setRollingUpgradeMarker(bpid); > } else { > dn.getFSDataset().restoreTrash(bpid); > dn.getFSDataset().clearRollingUpgradeMarker(bpid); > } > } > {code} > HDFS-6800 and HDFS-6981 were modifying this behavior making it not completely > clear whether this is somehow intentional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HDFS-7645) Rolling upgrade is restoring blocks from trash multiple times
[ https://issues.apache.org/jira/browse/HDFS-7645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Keisuke Ogiwara updated HDFS-7645: -- Attachment: HDFS-7645.04.patch I have attached a new patch. Please review it when you are free. Thank you very much. > Rolling upgrade is restoring blocks from trash multiple times > - > > Key: HDFS-7645 > URL: https://issues.apache.org/jira/browse/HDFS-7645 > Project: Hadoop HDFS > Issue Type: Bug > Components: datanode >Affects Versions: 2.6.0 >Reporter: Nathan Roberts >Assignee: Keisuke Ogiwara > Attachments: HDFS-7645.01.patch, HDFS-7645.02.patch, > HDFS-7645.03.patch, HDFS-7645.04.patch > > > When performing an HDFS rolling upgrade, the trash directory is getting > restored twice when under normal circumstances it shouldn't need to be > restored at all. iiuc, the only time these blocks should be restored is if we > need to rollback a rolling upgrade. > On a busy cluster, this can cause significant and unnecessary block churn > both on the datanodes, and more importantly in the namenode. > The two times this happens are: > 1) restart of DN onto new software > {code} > private void doTransition(DataNode datanode, StorageDirectory sd, > NamespaceInfo nsInfo, StartupOption startOpt) throws IOException { > if (startOpt == StartupOption.ROLLBACK && sd.getPreviousDir().exists()) { > Preconditions.checkState(!getTrashRootDir(sd).exists(), > sd.getPreviousDir() + " and " + getTrashRootDir(sd) + " should not > " + > " both be present."); > doRollback(sd, nsInfo); // rollback if applicable > } else { > // Restore all the files in the trash. The restored files are retained > // during rolling upgrade rollback. They are deleted during rolling > // upgrade downgrade. > int restored = restoreBlockFilesFromTrash(getTrashRootDir(sd)); > LOG.info("Restored " + restored + " block files from trash."); > } > {code} > 2) When heartbeat response no longer indicates a rollingupgrade is in progress > {code} > /** >* Signal the current rolling upgrade status as indicated by the NN. >* @param inProgress true if a rolling upgrade is in progress >*/ > void signalRollingUpgrade(boolean inProgress) throws IOException { > String bpid = getBlockPoolId(); > if (inProgress) { > dn.getFSDataset().enableTrash(bpid); > dn.getFSDataset().setRollingUpgradeMarker(bpid); > } else { > dn.getFSDataset().restoreTrash(bpid); > dn.getFSDataset().clearRollingUpgradeMarker(bpid); > } > } > {code} > HDFS-6800 and HDFS-6981 were modifying this behavior making it not completely > clear whether this is somehow intentional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HDFS-7645) Rolling upgrade is restoring blocks from trash multiple times
[ https://issues.apache.org/jira/browse/HDFS-7645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Keisuke Ogiwara updated HDFS-7645: -- Attachment: HDFS-7645.03.patch Hi Vinayakumar B, Thanks for the review.Your advice is great. I attached new patch. Please review it, thank you. And I have searched that trash will be deleted for finalize/downgrade. But after I updated the code, assertion errors happened in testWithLayoutChangeAndFinalize() method, testDatanodeRollingUpgradeWithFinalize() method and testWithLayoutChangeAndRollback() method of class TestDataNodeRollingUpgrade. Is the updated code related with these errors? > Rolling upgrade is restoring blocks from trash multiple times > - > > Key: HDFS-7645 > URL: https://issues.apache.org/jira/browse/HDFS-7645 > Project: Hadoop HDFS > Issue Type: Bug > Components: datanode >Affects Versions: 2.6.0 >Reporter: Nathan Roberts >Assignee: Keisuke Ogiwara > Attachments: HDFS-7645.01.patch, HDFS-7645.02.patch, > HDFS-7645.03.patch > > > When performing an HDFS rolling upgrade, the trash directory is getting > restored twice when under normal circumstances it shouldn't need to be > restored at all. iiuc, the only time these blocks should be restored is if we > need to rollback a rolling upgrade. > On a busy cluster, this can cause significant and unnecessary block churn > both on the datanodes, and more importantly in the namenode. > The two times this happens are: > 1) restart of DN onto new software > {code} > private void doTransition(DataNode datanode, StorageDirectory sd, > NamespaceInfo nsInfo, StartupOption startOpt) throws IOException { > if (startOpt == StartupOption.ROLLBACK && sd.getPreviousDir().exists()) { > Preconditions.checkState(!getTrashRootDir(sd).exists(), > sd.getPreviousDir() + " and " + getTrashRootDir(sd) + " should not > " + > " both be present."); > doRollback(sd, nsInfo); // rollback if applicable > } else { > // Restore all the files in the trash. The restored files are retained > // during rolling upgrade rollback. They are deleted during rolling > // upgrade downgrade. > int restored = restoreBlockFilesFromTrash(getTrashRootDir(sd)); > LOG.info("Restored " + restored + " block files from trash."); > } > {code} > 2) When heartbeat response no longer indicates a rollingupgrade is in progress > {code} > /** >* Signal the current rolling upgrade status as indicated by the NN. >* @param inProgress true if a rolling upgrade is in progress >*/ > void signalRollingUpgrade(boolean inProgress) throws IOException { > String bpid = getBlockPoolId(); > if (inProgress) { > dn.getFSDataset().enableTrash(bpid); > dn.getFSDataset().setRollingUpgradeMarker(bpid); > } else { > dn.getFSDataset().restoreTrash(bpid); > dn.getFSDataset().clearRollingUpgradeMarker(bpid); > } > } > {code} > HDFS-6800 and HDFS-6981 were modifying this behavior making it not completely > clear whether this is somehow intentional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HDFS-7645) Rolling upgrade is restoring blocks from trash multiple times
[ https://issues.apache.org/jira/browse/HDFS-7645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Keisuke Ogiwara updated HDFS-7645: -- Attachment: HDFS-7645.02.patch > Rolling upgrade is restoring blocks from trash multiple times > - > > Key: HDFS-7645 > URL: https://issues.apache.org/jira/browse/HDFS-7645 > Project: Hadoop HDFS > Issue Type: Bug > Components: datanode >Affects Versions: 2.6.0 >Reporter: Nathan Roberts >Assignee: Keisuke Ogiwara > Attachments: HDFS-7645.01.patch, HDFS-7645.02.patch > > > When performing an HDFS rolling upgrade, the trash directory is getting > restored twice when under normal circumstances it shouldn't need to be > restored at all. iiuc, the only time these blocks should be restored is if we > need to rollback a rolling upgrade. > On a busy cluster, this can cause significant and unnecessary block churn > both on the datanodes, and more importantly in the namenode. > The two times this happens are: > 1) restart of DN onto new software > {code} > private void doTransition(DataNode datanode, StorageDirectory sd, > NamespaceInfo nsInfo, StartupOption startOpt) throws IOException { > if (startOpt == StartupOption.ROLLBACK && sd.getPreviousDir().exists()) { > Preconditions.checkState(!getTrashRootDir(sd).exists(), > sd.getPreviousDir() + " and " + getTrashRootDir(sd) + " should not > " + > " both be present."); > doRollback(sd, nsInfo); // rollback if applicable > } else { > // Restore all the files in the trash. The restored files are retained > // during rolling upgrade rollback. They are deleted during rolling > // upgrade downgrade. > int restored = restoreBlockFilesFromTrash(getTrashRootDir(sd)); > LOG.info("Restored " + restored + " block files from trash."); > } > {code} > 2) When heartbeat response no longer indicates a rollingupgrade is in progress > {code} > /** >* Signal the current rolling upgrade status as indicated by the NN. >* @param inProgress true if a rolling upgrade is in progress >*/ > void signalRollingUpgrade(boolean inProgress) throws IOException { > String bpid = getBlockPoolId(); > if (inProgress) { > dn.getFSDataset().enableTrash(bpid); > dn.getFSDataset().setRollingUpgradeMarker(bpid); > } else { > dn.getFSDataset().restoreTrash(bpid); > dn.getFSDataset().clearRollingUpgradeMarker(bpid); > } > } > {code} > HDFS-6800 and HDFS-6981 were modifying this behavior making it not completely > clear whether this is somehow intentional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HDFS-7645) Rolling upgrade is restoring blocks from trash multiple times
[ https://issues.apache.org/jira/browse/HDFS-7645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Keisuke Ogiwara updated HDFS-7645: -- Status: Patch Available (was: Open) > Rolling upgrade is restoring blocks from trash multiple times > - > > Key: HDFS-7645 > URL: https://issues.apache.org/jira/browse/HDFS-7645 > Project: Hadoop HDFS > Issue Type: Bug > Components: datanode >Affects Versions: 2.6.0 >Reporter: Nathan Roberts >Assignee: Keisuke Ogiwara > Attachments: HDFS-7645.01.patch, HDFS-7645.02.patch > > > When performing an HDFS rolling upgrade, the trash directory is getting > restored twice when under normal circumstances it shouldn't need to be > restored at all. iiuc, the only time these blocks should be restored is if we > need to rollback a rolling upgrade. > On a busy cluster, this can cause significant and unnecessary block churn > both on the datanodes, and more importantly in the namenode. > The two times this happens are: > 1) restart of DN onto new software > {code} > private void doTransition(DataNode datanode, StorageDirectory sd, > NamespaceInfo nsInfo, StartupOption startOpt) throws IOException { > if (startOpt == StartupOption.ROLLBACK && sd.getPreviousDir().exists()) { > Preconditions.checkState(!getTrashRootDir(sd).exists(), > sd.getPreviousDir() + " and " + getTrashRootDir(sd) + " should not > " + > " both be present."); > doRollback(sd, nsInfo); // rollback if applicable > } else { > // Restore all the files in the trash. The restored files are retained > // during rolling upgrade rollback. They are deleted during rolling > // upgrade downgrade. > int restored = restoreBlockFilesFromTrash(getTrashRootDir(sd)); > LOG.info("Restored " + restored + " block files from trash."); > } > {code} > 2) When heartbeat response no longer indicates a rollingupgrade is in progress > {code} > /** >* Signal the current rolling upgrade status as indicated by the NN. >* @param inProgress true if a rolling upgrade is in progress >*/ > void signalRollingUpgrade(boolean inProgress) throws IOException { > String bpid = getBlockPoolId(); > if (inProgress) { > dn.getFSDataset().enableTrash(bpid); > dn.getFSDataset().setRollingUpgradeMarker(bpid); > } else { > dn.getFSDataset().restoreTrash(bpid); > dn.getFSDataset().clearRollingUpgradeMarker(bpid); > } > } > {code} > HDFS-6800 and HDFS-6981 were modifying this behavior making it not completely > clear whether this is somehow intentional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HDFS-7645) Rolling upgrade is restoring blocks from trash multiple times
[ https://issues.apache.org/jira/browse/HDFS-7645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Keisuke Ogiwara updated HDFS-7645: -- Attachment: (was: HDFS-7645.02.patch) > Rolling upgrade is restoring blocks from trash multiple times > - > > Key: HDFS-7645 > URL: https://issues.apache.org/jira/browse/HDFS-7645 > Project: Hadoop HDFS > Issue Type: Bug > Components: datanode >Affects Versions: 2.6.0 >Reporter: Nathan Roberts >Assignee: Keisuke Ogiwara > Attachments: HDFS-7645.01.patch > > > When performing an HDFS rolling upgrade, the trash directory is getting > restored twice when under normal circumstances it shouldn't need to be > restored at all. iiuc, the only time these blocks should be restored is if we > need to rollback a rolling upgrade. > On a busy cluster, this can cause significant and unnecessary block churn > both on the datanodes, and more importantly in the namenode. > The two times this happens are: > 1) restart of DN onto new software > {code} > private void doTransition(DataNode datanode, StorageDirectory sd, > NamespaceInfo nsInfo, StartupOption startOpt) throws IOException { > if (startOpt == StartupOption.ROLLBACK && sd.getPreviousDir().exists()) { > Preconditions.checkState(!getTrashRootDir(sd).exists(), > sd.getPreviousDir() + " and " + getTrashRootDir(sd) + " should not > " + > " both be present."); > doRollback(sd, nsInfo); // rollback if applicable > } else { > // Restore all the files in the trash. The restored files are retained > // during rolling upgrade rollback. They are deleted during rolling > // upgrade downgrade. > int restored = restoreBlockFilesFromTrash(getTrashRootDir(sd)); > LOG.info("Restored " + restored + " block files from trash."); > } > {code} > 2) When heartbeat response no longer indicates a rollingupgrade is in progress > {code} > /** >* Signal the current rolling upgrade status as indicated by the NN. >* @param inProgress true if a rolling upgrade is in progress >*/ > void signalRollingUpgrade(boolean inProgress) throws IOException { > String bpid = getBlockPoolId(); > if (inProgress) { > dn.getFSDataset().enableTrash(bpid); > dn.getFSDataset().setRollingUpgradeMarker(bpid); > } else { > dn.getFSDataset().restoreTrash(bpid); > dn.getFSDataset().clearRollingUpgradeMarker(bpid); > } > } > {code} > HDFS-6800 and HDFS-6981 were modifying this behavior making it not completely > clear whether this is somehow intentional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HDFS-7645) Rolling upgrade is restoring blocks from trash multiple times
[ https://issues.apache.org/jira/browse/HDFS-7645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Keisuke Ogiwara updated HDFS-7645: -- Status: Open (was: Patch Available) > Rolling upgrade is restoring blocks from trash multiple times > - > > Key: HDFS-7645 > URL: https://issues.apache.org/jira/browse/HDFS-7645 > Project: Hadoop HDFS > Issue Type: Bug > Components: datanode >Affects Versions: 2.6.0 >Reporter: Nathan Roberts >Assignee: Keisuke Ogiwara > Attachments: HDFS-7645.01.patch > > > When performing an HDFS rolling upgrade, the trash directory is getting > restored twice when under normal circumstances it shouldn't need to be > restored at all. iiuc, the only time these blocks should be restored is if we > need to rollback a rolling upgrade. > On a busy cluster, this can cause significant and unnecessary block churn > both on the datanodes, and more importantly in the namenode. > The two times this happens are: > 1) restart of DN onto new software > {code} > private void doTransition(DataNode datanode, StorageDirectory sd, > NamespaceInfo nsInfo, StartupOption startOpt) throws IOException { > if (startOpt == StartupOption.ROLLBACK && sd.getPreviousDir().exists()) { > Preconditions.checkState(!getTrashRootDir(sd).exists(), > sd.getPreviousDir() + " and " + getTrashRootDir(sd) + " should not > " + > " both be present."); > doRollback(sd, nsInfo); // rollback if applicable > } else { > // Restore all the files in the trash. The restored files are retained > // during rolling upgrade rollback. They are deleted during rolling > // upgrade downgrade. > int restored = restoreBlockFilesFromTrash(getTrashRootDir(sd)); > LOG.info("Restored " + restored + " block files from trash."); > } > {code} > 2) When heartbeat response no longer indicates a rollingupgrade is in progress > {code} > /** >* Signal the current rolling upgrade status as indicated by the NN. >* @param inProgress true if a rolling upgrade is in progress >*/ > void signalRollingUpgrade(boolean inProgress) throws IOException { > String bpid = getBlockPoolId(); > if (inProgress) { > dn.getFSDataset().enableTrash(bpid); > dn.getFSDataset().setRollingUpgradeMarker(bpid); > } else { > dn.getFSDataset().restoreTrash(bpid); > dn.getFSDataset().clearRollingUpgradeMarker(bpid); > } > } > {code} > HDFS-6800 and HDFS-6981 were modifying this behavior making it not completely > clear whether this is somehow intentional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HDFS-7645) Rolling upgrade is restoring blocks from trash multiple times
[ https://issues.apache.org/jira/browse/HDFS-7645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Keisuke Ogiwara updated HDFS-7645: -- Attachment: HDFS-7645.02.patch I attached new patch.Please review it.Thank you. > Rolling upgrade is restoring blocks from trash multiple times > - > > Key: HDFS-7645 > URL: https://issues.apache.org/jira/browse/HDFS-7645 > Project: Hadoop HDFS > Issue Type: Bug > Components: datanode >Affects Versions: 2.6.0 >Reporter: Nathan Roberts >Assignee: Keisuke Ogiwara > Attachments: HDFS-7645.01.patch, HDFS-7645.02.patch > > > When performing an HDFS rolling upgrade, the trash directory is getting > restored twice when under normal circumstances it shouldn't need to be > restored at all. iiuc, the only time these blocks should be restored is if we > need to rollback a rolling upgrade. > On a busy cluster, this can cause significant and unnecessary block churn > both on the datanodes, and more importantly in the namenode. > The two times this happens are: > 1) restart of DN onto new software > {code} > private void doTransition(DataNode datanode, StorageDirectory sd, > NamespaceInfo nsInfo, StartupOption startOpt) throws IOException { > if (startOpt == StartupOption.ROLLBACK && sd.getPreviousDir().exists()) { > Preconditions.checkState(!getTrashRootDir(sd).exists(), > sd.getPreviousDir() + " and " + getTrashRootDir(sd) + " should not > " + > " both be present."); > doRollback(sd, nsInfo); // rollback if applicable > } else { > // Restore all the files in the trash. The restored files are retained > // during rolling upgrade rollback. They are deleted during rolling > // upgrade downgrade. > int restored = restoreBlockFilesFromTrash(getTrashRootDir(sd)); > LOG.info("Restored " + restored + " block files from trash."); > } > {code} > 2) When heartbeat response no longer indicates a rollingupgrade is in progress > {code} > /** >* Signal the current rolling upgrade status as indicated by the NN. >* @param inProgress true if a rolling upgrade is in progress >*/ > void signalRollingUpgrade(boolean inProgress) throws IOException { > String bpid = getBlockPoolId(); > if (inProgress) { > dn.getFSDataset().enableTrash(bpid); > dn.getFSDataset().setRollingUpgradeMarker(bpid); > } else { > dn.getFSDataset().restoreTrash(bpid); > dn.getFSDataset().clearRollingUpgradeMarker(bpid); > } > } > {code} > HDFS-6800 and HDFS-6981 were modifying this behavior making it not completely > clear whether this is somehow intentional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HDFS-7645) Rolling upgrade is restoring blocks from trash multiple times
[ https://issues.apache.org/jira/browse/HDFS-7645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Keisuke Ogiwara updated HDFS-7645: -- Status: Patch Available (was: Open) > Rolling upgrade is restoring blocks from trash multiple times > - > > Key: HDFS-7645 > URL: https://issues.apache.org/jira/browse/HDFS-7645 > Project: Hadoop HDFS > Issue Type: Bug > Components: datanode >Affects Versions: 2.6.0 >Reporter: Nathan Roberts >Assignee: Keisuke Ogiwara > Attachments: HDFS-7645.01.patch, HDFS-7645.02.patch > > > When performing an HDFS rolling upgrade, the trash directory is getting > restored twice when under normal circumstances it shouldn't need to be > restored at all. iiuc, the only time these blocks should be restored is if we > need to rollback a rolling upgrade. > On a busy cluster, this can cause significant and unnecessary block churn > both on the datanodes, and more importantly in the namenode. > The two times this happens are: > 1) restart of DN onto new software > {code} > private void doTransition(DataNode datanode, StorageDirectory sd, > NamespaceInfo nsInfo, StartupOption startOpt) throws IOException { > if (startOpt == StartupOption.ROLLBACK && sd.getPreviousDir().exists()) { > Preconditions.checkState(!getTrashRootDir(sd).exists(), > sd.getPreviousDir() + " and " + getTrashRootDir(sd) + " should not > " + > " both be present."); > doRollback(sd, nsInfo); // rollback if applicable > } else { > // Restore all the files in the trash. The restored files are retained > // during rolling upgrade rollback. They are deleted during rolling > // upgrade downgrade. > int restored = restoreBlockFilesFromTrash(getTrashRootDir(sd)); > LOG.info("Restored " + restored + " block files from trash."); > } > {code} > 2) When heartbeat response no longer indicates a rollingupgrade is in progress > {code} > /** >* Signal the current rolling upgrade status as indicated by the NN. >* @param inProgress true if a rolling upgrade is in progress >*/ > void signalRollingUpgrade(boolean inProgress) throws IOException { > String bpid = getBlockPoolId(); > if (inProgress) { > dn.getFSDataset().enableTrash(bpid); > dn.getFSDataset().setRollingUpgradeMarker(bpid); > } else { > dn.getFSDataset().restoreTrash(bpid); > dn.getFSDataset().clearRollingUpgradeMarker(bpid); > } > } > {code} > HDFS-6800 and HDFS-6981 were modifying this behavior making it not completely > clear whether this is somehow intentional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HDFS-7645) Rolling upgrade is restoring blocks from trash multiple times
[ https://issues.apache.org/jira/browse/HDFS-7645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Keisuke Ogiwara updated HDFS-7645: -- Attachment: HDFS-7645.01.patch I attached patch, thank you. > Rolling upgrade is restoring blocks from trash multiple times > - > > Key: HDFS-7645 > URL: https://issues.apache.org/jira/browse/HDFS-7645 > Project: Hadoop HDFS > Issue Type: Bug > Components: datanode >Affects Versions: 2.6.0 >Reporter: Nathan Roberts >Assignee: Keisuke Ogiwara > Attachments: HDFS-7645.01.patch > > > When performing an HDFS rolling upgrade, the trash directory is getting > restored twice when under normal circumstances it shouldn't need to be > restored at all. iiuc, the only time these blocks should be restored is if we > need to rollback a rolling upgrade. > On a busy cluster, this can cause significant and unnecessary block churn > both on the datanodes, and more importantly in the namenode. > The two times this happens are: > 1) restart of DN onto new software > {code} > private void doTransition(DataNode datanode, StorageDirectory sd, > NamespaceInfo nsInfo, StartupOption startOpt) throws IOException { > if (startOpt == StartupOption.ROLLBACK && sd.getPreviousDir().exists()) { > Preconditions.checkState(!getTrashRootDir(sd).exists(), > sd.getPreviousDir() + " and " + getTrashRootDir(sd) + " should not > " + > " both be present."); > doRollback(sd, nsInfo); // rollback if applicable > } else { > // Restore all the files in the trash. The restored files are retained > // during rolling upgrade rollback. They are deleted during rolling > // upgrade downgrade. > int restored = restoreBlockFilesFromTrash(getTrashRootDir(sd)); > LOG.info("Restored " + restored + " block files from trash."); > } > {code} > 2) When heartbeat response no longer indicates a rollingupgrade is in progress > {code} > /** >* Signal the current rolling upgrade status as indicated by the NN. >* @param inProgress true if a rolling upgrade is in progress >*/ > void signalRollingUpgrade(boolean inProgress) throws IOException { > String bpid = getBlockPoolId(); > if (inProgress) { > dn.getFSDataset().enableTrash(bpid); > dn.getFSDataset().setRollingUpgradeMarker(bpid); > } else { > dn.getFSDataset().restoreTrash(bpid); > dn.getFSDataset().clearRollingUpgradeMarker(bpid); > } > } > {code} > HDFS-6800 and HDFS-6981 were modifying this behavior making it not completely > clear whether this is somehow intentional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (HDFS-7645) Rolling upgrade is restoring blocks from trash multiple times
[ https://issues.apache.org/jira/browse/HDFS-7645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Arpit Agarwal updated HDFS-7645: Assignee: Keisuke Ogiwara > Rolling upgrade is restoring blocks from trash multiple times > - > > Key: HDFS-7645 > URL: https://issues.apache.org/jira/browse/HDFS-7645 > Project: Hadoop HDFS > Issue Type: Bug > Components: datanode >Affects Versions: 2.6.0 >Reporter: Nathan Roberts >Assignee: Keisuke Ogiwara > > When performing an HDFS rolling upgrade, the trash directory is getting > restored twice when under normal circumstances it shouldn't need to be > restored at all. iiuc, the only time these blocks should be restored is if we > need to rollback a rolling upgrade. > On a busy cluster, this can cause significant and unnecessary block churn > both on the datanodes, and more importantly in the namenode. > The two times this happens are: > 1) restart of DN onto new software > {code} > private void doTransition(DataNode datanode, StorageDirectory sd, > NamespaceInfo nsInfo, StartupOption startOpt) throws IOException { > if (startOpt == StartupOption.ROLLBACK && sd.getPreviousDir().exists()) { > Preconditions.checkState(!getTrashRootDir(sd).exists(), > sd.getPreviousDir() + " and " + getTrashRootDir(sd) + " should not > " + > " both be present."); > doRollback(sd, nsInfo); // rollback if applicable > } else { > // Restore all the files in the trash. The restored files are retained > // during rolling upgrade rollback. They are deleted during rolling > // upgrade downgrade. > int restored = restoreBlockFilesFromTrash(getTrashRootDir(sd)); > LOG.info("Restored " + restored + " block files from trash."); > } > {code} > 2) When heartbeat response no longer indicates a rollingupgrade is in progress > {code} > /** >* Signal the current rolling upgrade status as indicated by the NN. >* @param inProgress true if a rolling upgrade is in progress >*/ > void signalRollingUpgrade(boolean inProgress) throws IOException { > String bpid = getBlockPoolId(); > if (inProgress) { > dn.getFSDataset().enableTrash(bpid); > dn.getFSDataset().setRollingUpgradeMarker(bpid); > } else { > dn.getFSDataset().restoreTrash(bpid); > dn.getFSDataset().clearRollingUpgradeMarker(bpid); > } > } > {code} > HDFS-6800 and HDFS-6981 were modifying this behavior making it not completely > clear whether this is somehow intentional. -- This message was sent by Atlassian JIRA (v6.3.4#6332)