While instrumenting the availability SLI for T431145 I ran into a steady stream of index_not_found_exception errors on user-facing search that does not seem to be tracked anywhere.
What the numbers say
mediawiki_CirrusSearch_backend_failures_total{type="config_issue"} counts index_not_found_exception and nothing else, see ElasticaErrorHandler::classifyError(). Over the last 30 days, external namespaces (mw-web plus mw-api-ext):
| Errors | ~726,000, so ~236,000 per week |
| Share of external search requests | 0.013% |
| Share of all search failures that are not user error | 96% |
Where they come from, same 30 days, all namespaces:
| namespace | errors |
|---|---|
| mw-web | 712,148 |
| mw-api-ext | 12,340 |
| mw-jobrunner | 1,165 |
| mw-cron | 977 |
So this is almost entirely browser-facing search rather than jobs or maintenance scripts. Since the pool label landed in T434975 the affected requests are pool="Search" with a handful of pool="Prefix", i.e. ordinary full text search. Split by site, codfw runs about 2.4x eqiad (379k against 159k), which I cannot explain and which may be a clue.
It is not a spike either. The daily rate has grown slowly and steadily: 0.20/s 90 days ago, 0.215/s 30 days ago, 0.266/s now.
Why it is worth a ticket
Each one of these is a search that returned no results to a reader. 0.013% of traffic is small, but it is 96% of everything failing on the search path for reasons that are ours rather than the user's, and it is trending upwards.
It also changes how we scope the availability SLO in T431145. Counting config_issue in the SLI puts external search availability at 99.986%; leaving it out puts it at 99.9995%. I would rather fix the errors than exclude them from the measurement.
Where to look next
The Prometheus metric has no wiki or index dimension, so it cannot say which index is missing. The log line can: ElasticsearchIntermediary::failure() writes to channel CirrusSearch with the message Search backend error during {queryType} after {tookMs}: {error_message}, and error_message carries the index name. A logstash query on that channel filtered to index_not_found_exception should name the wiki or index quickly.
Hypotheses worth ruling out, in no particular order:
- a wiki whose index was never created, or was deleted and never rebuilt (new, closed or private wikis)
- a stale cluster assignment, sending a wiki's queries to a cluster that does not hold its index
- a query against an index alias that exists on only some of the three clusters (chi, omega, psi)
Reproducing the measurement
sum by (kubernetes_namespace) (
increase(mediawiki_CirrusSearch_backend_failures_total{
type="config_issue", prometheus="k8s"
}[30d])
)