Limits of Automatic Cache Invalidation in HDFS After File Modifications
0 reputation · 01 Aug 2020, 11:50 UTC
When a file stored in HDFS is truncated, overwritten, or replaced, the DataNode block replicas that have been loaded into the off‑heap cache via hdfs cacheadmin remain unchanged unless the cached path is explicitly removed or uncached.
Consequently, read requests that hit the cached block may return stale data, and the cache does not self‑heal even though the underlying file has been modified. Documentation states that cache coherence is the responsibility of the application or administrator, and no automatic invalidation mechanism is currently implemented in either the 2.x or 3.x release lines.
Given this behavior, what options exist for applications that require up‑to‑date reads without incurring the operational overhead of manual cache management? Are there any configuration flags or auxiliary services that can trigger cache invalidation on file modification events? Is there a roadmap for introducing automatic cache coherence in future HDFS versions?