[Logging] added trace logging to TransportShardSingleOperationAction
And enabled them on SimpleRecoveryTests.testSimpleRecovery
This commit is contained in:
parent
54790eea10
commit
536930c751
|
@ -305,6 +305,6 @@ public class GetRequest extends SingleShardOperationRequest<GetRequest> {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "[" + index + "][" + type + "][" + id + "]: routing [" + routing + "]";
|
||||
return "get [" + index + "][" + type + "][" + id + "]: routing [" + routing + "]";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -107,6 +107,9 @@ public abstract class TransportShardSingleOperationAction<Request extends Single
|
|||
this.listener = listener;
|
||||
|
||||
ClusterState clusterState = clusterService.state();
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("executing [{}] based on cluster state version [{}]", request, clusterState.version());
|
||||
}
|
||||
nodes = clusterState.nodes();
|
||||
ClusterBlockException blockException = checkGlobalBlock(clusterState, request);
|
||||
if (blockException != null) {
|
||||
|
@ -151,8 +154,10 @@ public abstract class TransportShardSingleOperationAction<Request extends Single
|
|||
listener.onFailure(failure);
|
||||
return;
|
||||
}
|
||||
|
||||
if (shardRouting.currentNodeId().equals(nodes.localNodeId())) {
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("executing [{}] on shard [{}]", request, shardRouting.shardId());
|
||||
}
|
||||
try {
|
||||
if (request.operationThreaded()) {
|
||||
request.beforeLocalFork();
|
||||
|
@ -260,6 +265,9 @@ public abstract class TransportShardSingleOperationAction<Request extends Single
|
|||
|
||||
@Override
|
||||
public void messageReceived(final ShardSingleOperationRequest request, final TransportChannel channel) throws Exception {
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("executing [{}] on shard [{}]", request.request(), request.shardId());
|
||||
}
|
||||
Response response = shardOperation(request.request(), request.shardId());
|
||||
channel.sendResponse(response);
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ import org.elasticsearch.action.get.GetResponse;
|
|||
import org.elasticsearch.common.settings.ImmutableSettings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.test.ElasticsearchIntegrationTest;
|
||||
import org.elasticsearch.test.junit.annotations.TestLogging;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.elasticsearch.client.Requests.*;
|
||||
|
@ -49,6 +50,7 @@ public class SimpleRecoveryTests extends ElasticsearchIntegrationTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@TestLogging(value = "cluster.service:TRACE,action.get:TRACE")
|
||||
public void testSimpleRecovery() throws Exception {
|
||||
assertAcked(prepareCreate("test", 1).execute().actionGet(5000));
|
||||
|
||||
|
|
Loading…
Reference in New Issue