mirror of
https://github.com/apache/activemq.git
synced 2025-02-17 07:24:51 +00:00
leveldb replication: Lets always download the current append log just to be safe
This commit is contained in:
parent
2824a94af4
commit
dea38e62f8
@ -332,20 +332,11 @@ class SlaveLevelDBStore extends LevelDBStore with ReplicatedLevelDBStoreTrait {
|
|||||||
if (stashed_file.length() == x.length )
|
if (stashed_file.length() == x.length )
|
||||||
return stashed_file.cached_crc32 == x.crc32
|
return stashed_file.cached_crc32 == x.crc32
|
||||||
|
|
||||||
if ( stashed_file.crc32(x.length) == x.crc32 ) {
|
if( x.file == state.append_log ) {
|
||||||
// we don't want to truncate the log file currently being appended to.
|
return false;
|
||||||
if( x.file != state.append_log ) {
|
|
||||||
// Our log file might be longer. lets truncate to match.
|
|
||||||
val raf = new RandomAccessFile(stashed_file, "rw")
|
|
||||||
try {
|
|
||||||
raf.setLength(x.length)
|
|
||||||
} finally {
|
|
||||||
raf.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return false
|
|
||||||
|
return stashed_file.cached_crc32 == x.crc32
|
||||||
}
|
}
|
||||||
|
|
||||||
// We don't have to transfer log files that have been previously transferred.
|
// We don't have to transfer log files that have been previously transferred.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user