mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 18:35:25 +00:00
[TEST] add more debug output when engine / store are closed
This commit is contained in:
parent
7bd389de61
commit
fdac110368
@ -183,7 +183,7 @@ public class InternalEngine extends AbstractIndexShardComponent implements Engin
|
|||||||
private final AtomicInteger flushing = new AtomicInteger();
|
private final AtomicInteger flushing = new AtomicInteger();
|
||||||
private final Lock flushLock = new ReentrantLock();
|
private final Lock flushLock = new ReentrantLock();
|
||||||
|
|
||||||
private final RecoveryCounter onGoingRecoveries = new RecoveryCounter();
|
protected final RecoveryCounter onGoingRecoveries = new RecoveryCounter();
|
||||||
|
|
||||||
|
|
||||||
// A uid (in the form of BytesRef) to the version map
|
// A uid (in the form of BytesRef) to the version map
|
||||||
@ -1677,10 +1677,10 @@ public class InternalEngine extends AbstractIndexShardComponent implements Engin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private final class RecoveryCounter implements Releasable {
|
protected final class RecoveryCounter implements Releasable {
|
||||||
private final AtomicInteger onGoingRecoveries = new AtomicInteger();
|
private final AtomicInteger onGoingRecoveries = new AtomicInteger();
|
||||||
|
|
||||||
public void startRecovery() {
|
void startRecovery() {
|
||||||
store.incRef();
|
store.incRef();
|
||||||
onGoingRecoveries.incrementAndGet();
|
onGoingRecoveries.incrementAndGet();
|
||||||
}
|
}
|
||||||
@ -1689,7 +1689,7 @@ public class InternalEngine extends AbstractIndexShardComponent implements Engin
|
|||||||
return onGoingRecoveries.get();
|
return onGoingRecoveries.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void endRecovery() throws ElasticsearchException {
|
void endRecovery() throws ElasticsearchException {
|
||||||
store.decRef();
|
store.decRef();
|
||||||
onGoingRecoveries.decrementAndGet();
|
onGoingRecoveries.decrementAndGet();
|
||||||
assert onGoingRecoveries.get() >= 0 : "ongoingRecoveries must be >= 0 but was: " + onGoingRecoveries.get();
|
assert onGoingRecoveries.get() >= 0 : "ongoingRecoveries must be >= 0 but was: " + onGoingRecoveries.get();
|
||||||
|
@ -552,7 +552,7 @@ public class InternalIndexService extends AbstractIndexComponent implements Inde
|
|||||||
@Override
|
@Override
|
||||||
public void onShardCloseFailed(ShardId shardId, Throwable t) {
|
public void onShardCloseFailed(ShardId shardId, Throwable t) {
|
||||||
assert countDown.isCountedDown() == false;
|
assert countDown.isCountedDown() == false;
|
||||||
assert shardIds.contains(shardId.getId()) : "Unkown shard id";
|
assert shardIds.contains(shardId.getId()) : "Unknown shard id";
|
||||||
listener.onShardCloseFailed(shardId, t);
|
listener.onShardCloseFailed(shardId, t);
|
||||||
failures.add(t);
|
failures.add(t);
|
||||||
if (countDown.countDown()) {
|
if (countDown.countDown()) {
|
||||||
|
@ -54,6 +54,7 @@ import org.elasticsearch.index.store.distributor.Distributor;
|
|||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.file.NoSuchFileException;
|
import java.nio.file.NoSuchFileException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.ConcurrentMap;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||||
import java.util.zip.Adler32;
|
import java.util.zip.Adler32;
|
||||||
@ -350,6 +351,7 @@ public class Store extends AbstractIndexShardComponent implements CloseableIndex
|
|||||||
this.onClose = onClose;
|
this.onClose = onClose;
|
||||||
// only do this once!
|
// only do this once!
|
||||||
decRef();
|
decRef();
|
||||||
|
logger.debug("store reference count on close: " + refCounter.refCount());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ public class SearchWhileCreatingIndexTests extends ElasticsearchIntegrationTest
|
|||||||
int shardsNo = numberOfReplicas + 1;
|
int shardsNo = numberOfReplicas + 1;
|
||||||
int neededNodes = shardsNo <= 2 ? 1 : shardsNo / 2 + 1;
|
int neededNodes = shardsNo <= 2 ? 1 : shardsNo / 2 + 1;
|
||||||
internalCluster().ensureAtLeastNumDataNodes(randomIntBetween(neededNodes, shardsNo));
|
internalCluster().ensureAtLeastNumDataNodes(randomIntBetween(neededNodes, shardsNo));
|
||||||
for (int i = 0; i < 20; i++) {
|
for (int i = 0; i < 200; i++) {
|
||||||
logger.info("running iteration {}", i);
|
logger.info("running iteration {}", i);
|
||||||
if (createIndex) {
|
if (createIndex) {
|
||||||
createIndex("test");
|
createIndex("test");
|
||||||
|
@ -95,6 +95,7 @@ public final class MockInternalEngine extends InternalEngine implements Engine {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
logger.debug("Ongoing recoveries after engine close: " + onGoingRecoveries.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user