Skip to content

Commit 21ff90f

Browse files
author
Ali Beyad
authored
Fixes debug logging on index creation waiting for shards to be started (#19612)
1 parent 6f76740 commit 21ff90f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/src/main/java/org/elasticsearch/cluster/metadata/MetaDataCreateIndexService.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,10 @@ public void createIndex(final CreateIndexClusterStateUpdateRequest request,
202202
if (response.isAcknowledged()) {
203203
activeShardsObserver.waitForActiveShards(request.index(), request.waitForActiveShards(), request.ackTimeout(),
204204
shardsAcked -> {
205-
logger.debug("[{}] index created, but the operation timed out while waiting for " +
206-
"enough shards to be started.", request.index());
205+
if (shardsAcked == false) {
206+
logger.debug("[{}] index created, but the operation timed out while waiting for " +
207+
"enough shards to be started.", request.index());
208+
}
207209
listener.onResponse(new CreateIndexClusterStateUpdateResponse(response.isAcknowledged(), shardsAcked));
208210
}, listener::onFailure);
209211
} else {

0 commit comments

Comments
 (0)