Skip to content

Commit

Permalink
avoid false positives for background length check on tmp files
Browse files Browse the repository at this point in the history
  • Loading branch information
magibney committed Mar 5, 2024
1 parent ed1999e commit 3715143
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions solr/core/src/java/org/apache/solr/storage/TeeDirectory.java
Original file line number Diff line number Diff line change
Expand Up @@ -571,9 +571,12 @@ public void rename(String source, String dest) throws IOException {
@Override
public IndexInput openInput(String name, IOContext context) throws IOException {
IndexInput ret = access.openInput(name, context);
persistentLengthVerificationQueue.offer(
new TeeDirectoryFactory.PersistentLengthVerification(
access, persistent, name, ret.length()));
if (!name.endsWith(".tmp")) {
// we do not expect tmp files to be present in persistent directory
persistentLengthVerificationQueue.offer(
new TeeDirectoryFactory.PersistentLengthVerification(
access, persistent, name, ret.length()));
}
return ret;
}

Expand Down

0 comments on commit 3715143

Please sign in to comment.