Currently MockDirWrapper always calls delegate.sync() with a comment that we can relax this to not wear out the hardware for tests. The issue, as discussed on this thread http://lucene.markmail.org/thread/eozdsbdahzhjvizj, is related to NRTCachingDirectory and RateLimiter. The improvements I'd like to make under this issue are:
- Call delgeate.sync() if:
- delegate is NRTCachingDir
- delegate is RateLimitedDirWrapper and its delegate is NRTCachingDir
- delegate is TrackingDirWrapper and its delegate is NRTCachingDir
- Also, today the method either fails to sync all files or succeeds. Rather, we can improve this to randomly throw IOE on each file.
Any other Directories that can cause issues when sync() isn't called?