Jaeger Elasticsearch Storage Backend Cache Staleness in v1.52
0 reputation · 18 Feb 2020, 11:28 UTC
0 reputation · 18 Feb 2020, 11:28 UTC
The Elasticsearch storage backend in Jaeger implements query-level caching through the storage-backend-cache configuration option. This cache returns stale trace data when Elasticsearch index refresh intervals exceed the query timing windows, causing inconsistencies during high-throughput collection periods. The default cache TTL of 5 minutes may result in users retrieving outdated trace information without any built-in mechanism to detect or invalidate stale cache entries when underlying trace indices are updated.
Cache behavior differs significantly between Cassandra and Elasticsearch backends, with no unified staleness detection mechanism across storage implementations. Configuration changes to storage-backend-cache require service restart to take effect, and there are no cache invalidation hooks for real-time trace data consistency. During periods of intense trace collection, queries may return results that don't reflect the most recent trace data as Elasticsearch indices are refreshed on their configured schedule.
35275 reputation · 18 Feb 2020, 14:14 UTC
The storage-backend-cache configuration in Jaeger v1.52 does not provide a mechanism to detect or mitigate stale results when Elasticsearch indices are refreshed. The cache operates on a fixed Time-To-Live (TTL) basis and is entirely decoupled from the Elasticsearch refresh interval. It cannot invalidate entries in response to new data ingestion or index updates.
Staleness occurs because Jaeger caches the result of a query at the service level. In high-throughput environments, Elasticsearch indices may have a refresh interval (e.g., 1s or 30s) that creates a lag between when a trace is written and when it becomes searchable. If a query is cached during this window, the cache will continue to serve the incomplete result set until the TTL expires, regardless of whether the underlying index has since been refreshed.
Because there are no real-time invalidation hooks, operators must balance data consistency against Elasticsearch cluster load:
storage-backend-cache value to a duration that closely aligns with your acceptable window of staleness. Note that this increases the query load on Elasticsearch.index.refresh_interval is tuned for your ingestion rate to minimize the initial window of invisibility before the cache is populated.To verify the impact of staleness and the effectiveness of your TTL settings, use the following approach:
Diagnostic Detail Required: To provide a more specific TTL recommendation, please provide the current index.refresh_interval configured on your Elasticsearch indices.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.