mirror of https://github.com/apache/lucene.git
LUCENE-9047: Write checksum as big endian in NRT replicator
This commit is contained in:
parent
b84e0c272b
commit
a91bde5104
|
@ -20,6 +20,7 @@ package org.apache.lucene.replicator.nrt;
|
|||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.util.Locale;
|
||||
import org.apache.lucene.codecs.CodecUtil;
|
||||
import org.apache.lucene.store.DataInput;
|
||||
import org.apache.lucene.store.IOContext;
|
||||
import org.apache.lucene.store.IndexOutput;
|
||||
|
@ -111,7 +112,7 @@ public class CopyOneFile implements Closeable {
|
|||
// Paranoia: make sure the primary node is not smoking crack, by somehow sending us an
|
||||
// already corrupted file whose checksum (in its
|
||||
// footer) disagrees with reality:
|
||||
long actualChecksumIn = in.readLong();
|
||||
long actualChecksumIn = CodecUtil.readBELong(in);
|
||||
if (actualChecksumIn != checksum) {
|
||||
dest.message(
|
||||
"file "
|
||||
|
@ -122,7 +123,7 @@ public class CopyOneFile implements Closeable {
|
|||
+ actualChecksumIn);
|
||||
throw new IOException("file " + name + ": checksum mismatch after file copy");
|
||||
}
|
||||
out.writeLong(checksum);
|
||||
CodecUtil.writeBELong(out, checksum);
|
||||
bytesCopied += Long.BYTES;
|
||||
close();
|
||||
|
||||
|
|
Loading…
Reference in New Issue