Details
Description
FileSystem.truncate returns false (no exception) but the file is never closed and not writable after this.
It seems to be because of copy on truncate which is used because the system is in upgrade state. In this case a rename between devices is attempted.
See attached log and repro code.
Probably also affects truncate snapshotted file when copy on truncate is also used.
Possibly it affects not only truncate but any block recovery.
I think the problem is in updateReplicaUnderRecovery
ReplicaBeingWritten newReplicaInfo = new ReplicaBeingWritten(
newBlockId, recoveryId, rur.getVolume(), blockFile.getParentFile(),
newlength);
blockFile is created with copyReplicaWithNewBlockIdAndGS which is allowed to choose any volume so rur.getVolume() is not where the block is located.
Attachments
Attachments
Issue Links
- is related to
-
HDFS-3107 HDFS truncate
- Closed