xichen01 opened a new pull request, #3953: URL: https://github.com/apache/ozone/pull/3953
## What changes were proposed in this pull request? FSO bucket `rename` supports change modification time of parent dir instead of the renamed file. To enable this feature set `ozone.om.fso.filesystem.modification.time.enabled` to `true` (default `false`) For Filesystem. rename will change renamed file parent directory modification time but not change its modification time. For Object. rename will change renamed file modification time only. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-7382 ## How was this patch tested? 1. Create bucket and directory ```bash [root@linux /root/ozone]% ozone sh bucket create s3v/bucketfso -t FILE_SYSTEM_OPTIMIZED [root@linux /root/ozone]% ozone fs -mkdir ofs://localhost/s3v/bucketfso/dir1 [root@linux /root/ozone]% ozone fs -mkdir ofs://localhost/s3v/bucketfso/dir2 [root@linux /root/ozone]% ozone fs -touch ofs://localhost/s3v/bucketfso/dir2/file1 ``` 2. by default, only renamed file modification time will be change ```bash [root@linux /root/ozone]% ozone fs -lsr ofs://localhost/s3v/bucketfso/ drwxrwxrwx - root root 0 2022-11-14 13:19 ofs://localhost/s3v/bucketfso/dir1 drwxrwxrwx - root root 0 2022-11-14 13:19 ofs://localhost/s3v/bucketfso/dir2 -rw-rw-rw- 3 root root 0 2022-11-14 13:18 ofs://localhost/s3v/bucketfso/dir2/file1 [root@linux /root/ozone]% ozone fs -mv ofs://localhost/s3v/bucketfso/dir2/file1 ofs://localhost/s3v/bucketfso/dir1/file1 [root@linux /root/ozone]% ozone fs -lsr ofs://localhost/s3v/bucketfso/ drwxrwxrwx - root root 0 2022-11-14 13:19 ofs://localhost/s3v/bucketfso/dir1 drwxrwxrwx - root root 0 2022-11-14 13:22 ofs://localhost/s3v/bucketfso/dir1/file1 -rw-rw-rw- 3 root root 0 2022-11-14 13:19 ofs://localhost/s3v/bucketfso/dir2 ``` 3. set `ozone.om.fso.filesystem.modification.time.enabled` to `true`, restart Ozone OM 4. `rename` will change renamed file parent directory modification time only ```bash [root@linux /root/ozone]% cat ozone-site.xml| grep modification -A 2 -B 1 <property> <name>ozone.om.fso.filesystem.modification.time.enabled</name> <value>true</value> </property> [root@linux /root/ozone]% [root@linux /root/ozone]% ozone fs -ls -R ofs://localhost/s3v/bucketfso/ drwxrwxrwx - root root 0 2022-11-14 13:17 ofs://localhost/s3v/bucketfso/dir1 -rw-rw-rw- 3 root root 0 2022-11-14 13:18 ofs://localhost/s3v/bucketfso/dir1/file1 drwxrwxrwx - root root 0 2022-11-14 13:18 ofs://localhost/s3v/bucketfso/dir2 [root@linux /root/ozone]% ozone fs -mv ofs://localhost/s3v/bucketfso/dir1/file1 ofs://localhost/s3v/bucketfso/dir2/file1 [root@linux /root/ozone]% ozone fs -lsr ofs://localhost/s3v/bucketfso/ drwxrwxrwx - root root 0 2022-11-14 13:19 ofs://localhost/s3v/bucketfso/dir1 drwxrwxrwx - root root 0 2022-11-14 13:19 ofs://localhost/s3v/bucketfso/dir2 -rw-rw-rw- 3 root root 0 2022-11-14 13:18 ofs://localhost/s3v/bucketfso/dir2/file1 ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
