hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arpit Agarwal (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HDFS-6981) DN upgrade with layout version change should not use trash
Date Thu, 04 Sep 2014 02:54:52 GMT

     [ https://issues.apache.org/jira/browse/HDFS-6981?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Arpit Agarwal updated HDFS-6981:
    Attachment: HDFS-6981.01.patch

Patch to skip using trash if a layout upgrade is in progress (detected by the presence of
the 'previous' directory).

Thus during rolling upgrade with layout change we'll see the following sequence of steps:
# Rolling upgrade is started on the NN via dfsadmin command.
# NN sends 'rolling upgrade command in progress' status to the DNs via heartbeat responses.
# The DNs now start moving deleted block files to trash.
# At some point a given DN is restarted with '-upgrade'.
# The DN first restores all files from trash. Next it detects that there is a change in the
layout version so it creates hard links under 'previous'.
# Deleted block files that were in trash are now reported to NN via block reports. The NN
again asks the DN to delete these block files. However a hard link remains under 'previous'.

>From here we proceed as before:
# If the upgrade is finalized, the 'previous' directory is deleted.
# If the upgrade is rolled back, then the 'previous' directory contents are restored.

The patch looks large but the majority of the changes are for test infrastructure to support
testing DN layout version changes via unit tests. I also added a unit test that runs through
the above steps.

> DN upgrade with layout version change should not use trash
> ----------------------------------------------------------
>                 Key: HDFS-6981
>                 URL: https://issues.apache.org/jira/browse/HDFS-6981
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: datanode
>    Affects Versions: 3.0.0
>            Reporter: James Thomas
>            Assignee: Arpit Agarwal
>         Attachments: HDFS-6981.01.patch
> Post HDFS-6800, we can encounter the following scenario:
> # We start with DN software version -55 and initiate a rolling upgrade to version -56
> # We delete some blocks, and they are moved to trash
> # We roll back to DN software version -55 using the -rollback flag – since we are running
the old code (prior to this patch), we will restore the previous directory but will not delete
the trash
> # We append to some of the blocks that were deleted in step 2
> # We then restart a DN that contains blocks that were appended to – since the trash
still exists, it will be restored at this point, the appended-to blocks will be overwritten,
and we will lose the appended data
> So I think we need to avoid writing anything to the trash directory if we have a previous
> Thanks to [~james.thomas] for reporting this.

This message was sent by Atlassian JIRA

View raw message