[
https://issues.apache.org/jira/browse/HDFS-6727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14139311#comment-14139311
]
Colin Patrick McCabe commented on HDFS-6727:
--------------------------------------------
Thanks for addressing my comments about addVolumes.
Can you add a comment to the declaration of DataNode#dataDirs explaining that
it must be accessed while holding the DataNode lock?
{code}
void recoverTransitionRead(DataNode datanode, String bpID, NamespaceInfo
nsInfo,
- Collection<StorageLocation> dataDirs, StartupOption startOpt) throws
IOException {
+ final Collection<StorageLocation> dataDirs, StartupOption startOpt)
throws IOException {
{code}
It seems like the patch would be smaller without this...
In this comment:
{code}
+ * It should only be used for deactivating disks.
{code}
I think "It should only be used when deactivating disks" would be clearer.
This method doesn't itself deactivate the disk... it's just used when
deactivating disks.
{code}
+ // If IOException raises from FsVolumeImpl() or getVolumeMap(), there is
+ // nothing needed to be rolled back to make various data structures, e.g.,
+ // storageMap and asyncDiskService, consistent.
+ final FsVolumeImpl fsVolume = new FsVolumeImpl(
+ this, sd.getStorageUuid(), dir, this.conf, storageType);
+ final ReplicaMap tempVolumeMap = new ReplicaMap(fsVolume);
+
+ List<IOException> exceptions = Lists.newArrayList();
+ for (final String bpid : bpids) {
+ try {
+ fsVolume.addBlockPool(bpid, this.conf);
+ fsVolume.getVolumeMap(bpid, volumeMap);
+ } catch (IOException e) {
{code}
I like the idea behind this comment, but maybe putting it inside the "catch"
block would make things clearer. Also, maybe it could be shortened to
something like "no rollback is needed here"
+1 once those changes are addressed. Thanks, Eddy.
> Refresh data volumes on DataNode based on configuration changes
> ---------------------------------------------------------------
>
> Key: HDFS-6727
> URL: https://issues.apache.org/jira/browse/HDFS-6727
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: datanode
> Affects Versions: 2.5.0, 2.4.1
> Reporter: Lei (Eddy) Xu
> Assignee: Lei (Eddy) Xu
> Labels: datanode
> Attachments: HDFS-6727.000.delta-HDFS-6775.txt, HDFS-6727.001.patch,
> HDFS-6727.002.patch, HDFS-6727.003.patch, HDFS-6727.004.patch,
> HDFS-6727.005.patch, HDFS-6727.006.patch, HDFS-6727.006.patch,
> HDFS-6727.007.patch, HDFS-6727.combo.patch, patchFindBugsOutputhadoop-hdfs.txt
>
>
> HDFS-1362 requires DataNode to reload configuration file during the runtime,
> so that DN can change the data volumes dynamically. This JIRA reuses the
> reconfiguration framework introduced by HADOOP-7001 to enable DN to
> reconfigure at runtime.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)