Skip to content

Commit cfcd17f

Browse files
committed
HDFS-15751. Add documentation for msync() API to filesystem.md. Contributed by Konstantin V Shvachko.
Reviewed-by: He Xiaoqiao <hexiaoqiao@apache.org> Reviewed-by: Chao Sun <sunchao@apache.org>
1 parent 0605942 commit cfcd17f

File tree

1 file changed

+30
-0
lines changed
  • hadoop-common-project/hadoop-common/src/site/markdown/filesystem

1 file changed

+30
-0
lines changed

hadoop-common-project/hadoop-common/src/site/markdown/filesystem/filesystem.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,36 @@ for both files and directories, MUST always return `true` to the `isEncrypted()`
116116
predicate. This can be done by setting the `encrypted` flag to true when creating
117117
the `FileStatus` instance.
118118

119+
120+
### `msync()`
121+
122+
Synchronize metadata state of the client with the latest state of the metadata
123+
service of the FileSystem.
124+
125+
In highly available FileSystems standby service can be used as a read-only
126+
metadata replica. This call is essential to guarantee consistency of
127+
reads from the standby replica and to avoid stale reads.
128+
129+
It is currently only implemented for HDFS and others will just throw
130+
`UnsupportedOperationException`.
131+
132+
#### Preconditions
133+
134+
135+
#### Postconditions
136+
137+
This call internally records the state of the metadata service at the time of
138+
the call. This guarantees consistency of subsequent reads from any metadata
139+
replica. It assures the client will never access the state of the metadata that
140+
preceded the recorded state.
141+
142+
#### HDFS implementation notes
143+
144+
HDFS supports `msync()` in HA mode by calling the Active NameNode and requesting
145+
its latest journal transaction ID. For more details see HDFS documentation
146+
[Consistent Reads from HDFS Observer NameNode](https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/ObserverNameNode.html)
147+
148+
119149
### `Path getHomeDirectory()`
120150

121151
The function `getHomeDirectory` returns the home directory for the FileSystem

0 commit comments

Comments
 (0)