Skip to content

Expose search.throttled on _cat/indices #37073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 4, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/reference/frozen-indices.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,25 @@ The default value for `pre_filter_shard_size` is `128` but it's recommended to s
significant overhead associated with this pre-filter phase.
================================

== Monitoring frozen indices

Frozen indices are ordinary indices that use search throttling and a memory efficient shard implementation. In order to monitor / filter
frozen indices in APIs like the <<cat-indices>> they must be filtered by their `throttled` property since frozen indices are not a core
concept.

[source,js]
--------------------------------------------------
GET /_cat/indices/twitter?v&h=i,sth
--------------------------------------------------
// CONSOLE
// TEST[s/^/PUT twitter\nPOST twitter\/_freeze\n/]

The response looks like:

[source,txt]
--------------------------------------------------
i sth
twitter true
--------------------------------------------------
// TESTRESPONSE[_cat]

Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.time.DateFormatters;
import org.elasticsearch.index.Index;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.RestResponse;
Expand Down Expand Up @@ -335,6 +336,8 @@ protected Table getTableWithHeader(final RestRequest request) {
table.addCell("memory.total", "sibling:pri;alias:tm,memoryTotal;default:false;text-align:right;desc:total used memory");
table.addCell("pri.memory.total", "default:false;text-align:right;desc:total user memory");

table.addCell("search.throttled", "alias:sth;default:false;desc:indicates if the index is search throttled");

table.endHeaders();
return table;
}
Expand All @@ -357,6 +360,7 @@ Table buildTable(RestRequest request, Index[] indices, ClusterHealthResponse res
IndexStats indexStats = stats.getIndices().get(indexName);
IndexMetaData indexMetaData = indexMetaDatas.getIndices().get(indexName);
IndexMetaData.State state = indexMetaData.getState();
boolean searchThrottled = IndexSettings.INDEX_SEARCH_THROTTLED.get(indexMetaData.getSettings());

if (status != null) {
if (state == IndexMetaData.State.CLOSE ||
Expand Down Expand Up @@ -558,6 +562,8 @@ Table buildTable(RestRequest request, Index[] indices, ClusterHealthResponse res
table.addCell(indexStats == null ? null : indexStats.getTotal().getTotalMemory());
table.addCell(indexStats == null ? null : indexStats.getPrimaries().getTotalMemory());

table.addCell(searchThrottled);

table.endRow();
}

Expand Down