mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-26 18:08:36 +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() {
|
public int indexRecoveryProgress() {
|
||||||
if (recoveredIndexSize == 0) {
|
if (recoveredIndexSize == 0) {
|
||||||
|
if (indexSize == reusedIndexSize) {
|
||||||
|
return 100;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return (int) (((double) recoveredIndexSize) / expectedRecoveredIndexSize().bytes() * 100);
|
return (int) (((double) recoveredIndexSize) / expectedRecoveredIndexSize().bytes() * 100);
|
||||||
|
@ -160,6 +160,9 @@ public class PeerRecoveryStatus {
|
|||||||
|
|
||||||
public int indexRecoveryProgress() {
|
public int indexRecoveryProgress() {
|
||||||
if (recoveredIndexSize == 0) {
|
if (recoveredIndexSize == 0) {
|
||||||
|
if (indexSize == reusedIndexSize) {
|
||||||
|
return 100;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return (int) (((double) recoveredIndexSize) / expectedRecoveredIndexSize().bytes() * 100);
|
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())) {
|
if (storeMd != null && storeMd.md5().equals(virtualMd.md5())) {
|
||||||
numberOfExistingFiles++;
|
numberOfExistingFiles++;
|
||||||
existingTotalSize += virtualMd.sizeInBytes();
|
existingTotalSize += virtualMd.sizeInBytes();
|
||||||
|
totalSize += virtualMd.sizeInBytes();
|
||||||
if (logger.isTraceEnabled()) {
|
if (logger.isTraceEnabled()) {
|
||||||
logger.trace("not_recovering [{}], exists in local store and has same md5 [{}]", virtualMd.name(), virtualMd.md5());
|
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);
|
recoveryStatus.index().files(numberOfFiles, totalSize, numberOfExistingFiles, existingTotalSize);
|
||||||
|
|
||||||
if (logger.isTraceEnabled()) {
|
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());
|
final CountDownLatch latch = new CountDownLatch(filesToRecover.size());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user