Benoit Perroud created HDFS-5902: ------------------------------------ Summary: Atomic Directory Swapping Operation Key: HDFS-5902 URL: https://issues.apache.org/jira/browse/HDFS-5902 Project: Hadoop HDFS Issue Type: New Feature Components: namenode Affects Versions: 2.2.0 Reporter: Benoit Perroud Priority: Minor
With snapshots, we can already start to have a consistent view of the data over time. One missing primitive to do one more step in the direction of a transactional FS is the ability to swap atomically two folders: {code} swapFolders(src, dst) {code} As of today, we need to: 1. move the destination folder to a temporary name, 2. rename the source folder in destination's name 3. rename the dst folder with the temporary name in the source name. This can leads to race conditions where the data is not found. An operation inside the namenode achieving folders swapping, with the appropriate checks and locking to ensure atomicity, would be really useful to perform maintenance tasks like folder compation, format conversion, etc... (and lot of other use cases). -- This message was sent by Atlassian JIRA (v6.1.5#6160)