hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Nauroth (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-9319) Make DatanodeInfo thread safe
Date Thu, 29 Oct 2015 23:59:27 GMT

    [ https://issues.apache.org/jira/browse/HDFS-9319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14981603#comment-14981603

Chris Nauroth commented on HDFS-9319:

Hi [~jingzhao].  The patch looks good overall.  There is a small inconsistency in that {{volumeFailures}}
and {{volumeFailureSummary}} are updated outside the lock, whereas all of the other heartbeat
information is captured in {{DatanodeState}} and updated atomically inside the lock.  This
is probably not a big deal in practice, but do you think it makes sense to expand the lock
just a little to cover those 2 pieces of data?  This would guarantee that all state reflects
the outcome of the last processed heartbeat.  For example:

    synchronized(this) {
      this.volumeFailures = volFailures;
      this.volumeFailureSummary = volumeFailureSummary;
      // Update total metrics for the node.
      updateState(totalCapacity, totalDfsUsed, totalRemaining, totalBlockPoolUsed,
          cacheCapacity, cacheUsed, lastUpdate, lastUpdateMonotonic, xceiverCount);

Let me know your thoughts.  Thanks!

> Make DatanodeInfo thread safe
> -----------------------------
>                 Key: HDFS-9319
>                 URL: https://issues.apache.org/jira/browse/HDFS-9319
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Jing Zhao
>            Assignee: Jing Zhao
>         Attachments: HDFS-9319.000.patch
> This jira plans to make DatanodeInfo's internal states independent of external locks.
Note because DatanodeInfo extends DatanodeID, we still need to change DatanodeID as a follow-on

This message was sent by Atlassian JIRA

View raw message