Skip to content

Commit da417ce

Browse files
committed
Compare contents directly when possible
1 parent a46ed7a commit da417ce

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

server/src/main/java/org/elasticsearch/index/store/StoreFileMetadata.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ public boolean isSame(StoreFileMetadata other) {
141141
// we can't tell if either or is null so we return false in this case! this is why we don't use equals for this!
142142
return false;
143143
}
144+
145+
if (hashEqualsContents()) {
146+
return hash.equals(other.hash);
147+
}
148+
144149
if (writerUuid.length > 0 && other.writerUuid.length > 0) {
145150
// if the writer ID is missing on one of the files then we ignore this field and just rely on the checksum and hash, but if
146151
// it's present on both files then it must be identical

0 commit comments

Comments
 (0)