mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-24 17:09:48 +00:00
fix recovery status when all index got reused
This commit is contained in:
parent
7437acfcea
commit
a5c5f65da5
@ -171,6 +171,9 @@ public class GatewayRecoveryStatus {
|
||||
|
||||
public int indexRecoveryProgress() {
|
||||
if (recoveredIndexSize == 0) {
|
||||
if (indexSize == reusedIndexSize) {
|
||||
return 100;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return (int) (((double) recoveredIndexSize) / expectedRecoveredIndexSize().bytes() * 100);
|
||||
|
@ -160,6 +160,9 @@ public class PeerRecoveryStatus {
|
||||
|
||||
public int indexRecoveryProgress() {
|
||||
if (recoveredIndexSize == 0) {
|
||||
if (indexSize == reusedIndexSize) {
|
||||
return 100;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return (int) (((double) recoveredIndexSize) / expectedRecoveredIndexSize().bytes() * 100);
|
||||
|
@ -540,6 +540,7 @@ public abstract class BlobStoreIndexShardGateway extends AbstractIndexShardCompo
|
||||
if (storeMd != null && storeMd.md5().equals(virtualMd.md5())) {
|
||||
numberOfExistingFiles++;
|
||||
existingTotalSize += virtualMd.sizeInBytes();
|
||||
totalSize += virtualMd.sizeInBytes();
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("not_recovering [{}], exists in local store and has same md5 [{}]", virtualMd.name(), virtualMd.md5());
|
||||
}
|
||||
@ -564,7 +565,7 @@ public abstract class BlobStoreIndexShardGateway extends AbstractIndexShardCompo
|
||||
recoveryStatus.index().files(numberOfFiles, totalSize, numberOfExistingFiles, existingTotalSize);
|
||||
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("recovering_files [{}] with total_size [{}], reusing_files [{}] with total_size [{}]", numberOfFiles, new ByteSizeValue(totalSize), numberOfExistingFiles, new ByteSizeValue(existingTotalSize));
|
||||
logger.trace("recovering_files [{}] with total_size [{}], reusing_files [{}] with reused_size [{}]", numberOfFiles, new ByteSizeValue(totalSize), numberOfExistingFiles, new ByteSizeValue(existingTotalSize));
|
||||
}
|
||||
|
||||
final CountDownLatch latch = new CountDownLatch(filesToRecover.size());
|
||||
|
Loading…
x
Reference in New Issue
Block a user