Xuanwo opened a new pull request, #8819: URL: https://github.com/apache/opendal/pull/8819
# Which issue does this PR close? No existing issue. This was found during an audit of the current `main`. # Rationale for this change `FoyerLayer` shares an invalidation history across every deleter. A successful delete, rename, copy, or oversized write inserts each invalidated key, and only a later write through the layer removes it. A long-lived layer therefore retained every deleted path forever, even though the corresponding cache entry was already removed. The invalidation history is now bounded. A tombstone is still kept alive while reads that started before the invalidation are in flight, so a racing cache fill cannot leave stale data behind. Once those reads finish, the layer removes any entry they may have inserted and releases the tombstone. Invalidations without in-flight reads remain recorded up to a fixed limit so recently mutated paths continue to bypass the cache until a write repopulates them. # What changes are included in this PR? - Bound the invalidation history to 1024 keys and release tombstones once pre-invalidation reads finish. - Preserve the existing delete, recursive delete, retry, copy, rename, and write invalidation semantics. - Add regression tests for bounded tombstone growth and for an invalidation that races a cache fill. # Are there any user-facing changes? Memory use for long-running layers is bounded. Recently invalidated paths still bypass the cache, but entries older than the bounded history can be cached again after a read. # Breaking changes # AI Usage Statement - Harness: Pi - Model: group/deepseek - Effort: max - Role: Investigated the tombstone lifecycle, added the regression tests, implemented the bounded invalidation history, and ran the validation checks. -- 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]
