[
https://issues.apache.org/jira/browse/HDFS-16748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17598829#comment-17598829
]
ASF GitHub Bot commented on HDFS-16748:
---------------------------------------
ayushtkn commented on code in PR #4813:
URL: https://github.com/apache/hadoop/pull/4813#discussion_r960384696
##########
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSOutputStream.java:
##########
@@ -197,6 +198,11 @@ private DFSOutputStream(DFSClient dfsClient, String src,
this.src = src;
this.fileId = stat.getFileId();
this.namespace = stat.getNamespace();
+ if (this.namespace == null) {
+ this.renewLeaseKey = "DEFAULT" + "_" + this.fileId;
+ } else {
+ this.renewLeaseKey = this.namespace + "_" + this.fileId;
+ }
Review Comment:
The "DEFAULT" needs to be configurable, someone can have a namespace with
name DEFAULT as well
> DFSClient should uniquely identify writing files by namespace id and iNodeId
> ----------------------------------------------------------------------------
>
> Key: HDFS-16748
> URL: https://issues.apache.org/jira/browse/HDFS-16748
> Project: Hadoop HDFS
> Issue Type: Bug
> Reporter: ZanderXu
> Assignee: ZanderXu
> Priority: Critical
> Labels: pull-request-available
>
> DFSClient should diff the writing files with namespaceId and iNodeId, because
> the writing files may belongs to different namespace with the same iNodeId.
> And the related code as bellows:
> {code:java}
> public void putFileBeingWritten(final long inodeId,
> final DFSOutputStream out) {
> synchronized(filesBeingWritten) {
> filesBeingWritten.put(inodeId, out);
> // update the last lease renewal time only when there was no
> // writes. once there is one write stream open, the lease renewer
> // thread keeps it updated well with in anyone's expiration time.
> if (lastLeaseRenewal == 0) {
> updateLastLeaseRenewal();
> }
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]