[ 
https://issues.apache.org/jira/browse/HDFS-5749?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13872538#comment-13872538
 ] 

Yongjun Zhang commented on HDFS-5749:
-------------------------------------

I found the reason that the access time stays at 1969-12-31 is that it was 
initialized to "0" (which is interpretated to be 1969-12-31) and never got 
updated.

I researched and  found that HADOOP-1869 which introduced access time of files 
explicitly stated "Directories do not have access times". And I checked that 
the patch for this bug set access time of directories to "0" which remains in 
latest code.

Quote from HADOOP-1869:
dhruba borthakur added a comment - 22/Aug/08 07:46
This patch does the following:
1. Implements access time for files. Directories do not have access times.
2. The access times of files is precise upto an hour boundary. This means that 
all accesses to a file between 2Pm and 2:59PM will have an access time of 2PM.
3. The transaction to write access time to edits is not synced. It is assumed 
that it will get synced as part of other transactions.
4. There is a configuration parameter to switch off access-times. By default, 
it is on.
5. There is a new FileSystem API setAccessTime() to set the access time on a 
file.

Release Note of HADOOP-1869:
Added HDFS file access times. By default, access times will be precise to the 
most recent hour boundary. A configuration parameter dfs.access.time.precision 
(milliseconds) is used to control this precision. Setting a value of 0 will 
disable persisting access times for HDFS files.

I'm closing this bug.


> Access time of HDFS directories stays at 1969-12-31
> ---------------------------------------------------
>
>                 Key: HDFS-5749
>                 URL: https://issues.apache.org/jira/browse/HDFS-5749
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 2.4.0
>            Reporter: Yongjun Zhang
>            Assignee: Yongjun Zhang
>
> Modify FsShell so that "fs -lsr" can show access time in addition to 
> modification time, the access time stays at 1969-12-31. This means the access 
> time is not set up initially. Filing this jira to fix this issue.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to