Index / Delete API when causing auto index creation can cause buffer data overrun, closes #1122.
This commit is contained in:
parent
e98860dc29
commit
848638d53c
|
@ -71,24 +71,25 @@ public class TransportDeleteAction extends TransportShardReplicationOperationAct
|
||||||
return ThreadPool.Names.INDEX;
|
return ThreadPool.Names.INDEX;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected void doExecute(final DeleteRequest deleteRequest, final ActionListener<DeleteResponse> listener) {
|
@Override protected void doExecute(final DeleteRequest request, final ActionListener<DeleteResponse> listener) {
|
||||||
if (autoCreateIndex && !clusterService.state().metaData().hasConcreteIndex(deleteRequest.index())) {
|
if (autoCreateIndex && !clusterService.state().metaData().hasConcreteIndex(request.index())) {
|
||||||
createIndexAction.execute(new CreateIndexRequest(deleteRequest.index()), new ActionListener<CreateIndexResponse>() {
|
request.beforeLocalFork();
|
||||||
|
createIndexAction.execute(new CreateIndexRequest(request.index()), new ActionListener<CreateIndexResponse>() {
|
||||||
@Override public void onResponse(CreateIndexResponse result) {
|
@Override public void onResponse(CreateIndexResponse result) {
|
||||||
innerExecute(deleteRequest, listener);
|
innerExecute(request, listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void onFailure(Throwable e) {
|
@Override public void onFailure(Throwable e) {
|
||||||
if (ExceptionsHelper.unwrapCause(e) instanceof IndexAlreadyExistsException) {
|
if (ExceptionsHelper.unwrapCause(e) instanceof IndexAlreadyExistsException) {
|
||||||
// we have the index, do it
|
// we have the index, do it
|
||||||
innerExecute(deleteRequest, listener);
|
innerExecute(request, listener);
|
||||||
} else {
|
} else {
|
||||||
listener.onFailure(e);
|
listener.onFailure(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
innerExecute(deleteRequest, listener);
|
innerExecute(request, listener);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -99,6 +99,7 @@ public class TransportIndexAction extends TransportShardReplicationOperationActi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (autoCreateIndex && !clusterService.state().metaData().hasConcreteIndex(request.index())) {
|
if (autoCreateIndex && !clusterService.state().metaData().hasConcreteIndex(request.index())) {
|
||||||
|
request.beforeLocalFork(); // we fork on another thread...
|
||||||
createIndexAction.execute(new CreateIndexRequest(request.index()).cause("auto(index api)"), new ActionListener<CreateIndexResponse>() {
|
createIndexAction.execute(new CreateIndexRequest(request.index()).cause("auto(index api)"), new ActionListener<CreateIndexResponse>() {
|
||||||
@Override public void onResponse(CreateIndexResponse result) {
|
@Override public void onResponse(CreateIndexResponse result) {
|
||||||
innerExecute(request, listener);
|
innerExecute(request, listener);
|
||||||
|
|
Loading…
Reference in New Issue