Skip to content

Conversation

@colings86
Copy link
Contributor

This change adds trace level logging to IndicesrrequestCache with the
primary aim of helping to identify the cause of the failures in
#32827. The cache will
log at trace level when a cache hit or miss occurs including the reader
version and the cache key. Note that this change adds a
cacheKeyRenderer which supplies a human readable String of the cache
key since the actual cache key itself is a BytesReference containing
the wire protocol serialised form of the request.

Logging is also added for the case where a search timeout occurs and fr
that reason the cache entry is invalidated.

This change adds trace level logging to `IndicesrrequestCache` witht eh
primary aim of helping to identify the cause of teh failures in
#32827. The cache will
log at trace level when a cache hit or miss occurs including the reader
version and the cache key. Note that this change adds a
`cacheKeyRenderer` whcih supplies a human readable String of the cache
key since the actual cache key itself is a `BytesReference` containing
the wire protocol serialised form of the request.

Logging is also added for the case where a search timeout occurs and fr
that reason the cache entry is invalidated.
@colings86 colings86 added >non-issue :Search/Search Search-related issues that do not fall into other categories v7.0.0 labels Oct 1, 2018
@colings86 colings86 self-assigned this Oct 1, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs


BytesReference getOrCompute(CacheEntity cacheEntity, Supplier<BytesReference> loader,
DirectoryReader reader, BytesReference cacheKey) throws Exception {
DirectoryReader reader, BytesReference cacheKey, Supplier<String> cacheKeyRenderer) throws Exception {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new parameter hurts a bit the API, can we avoid it somehow? Or at least leave a comment asking to remove it once #32827 is addressed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that it hurts the API, unfortunately I didn't see a better way of exposing the request information in the log message since the cache key is the wire-protocol bytes of the request and converting the cache key back into a request object would have exposed things on the request that we wouldn't want either. Happy to add a comment as you suggest, also happy to implement a better way of supplying this information if someone can think of one

Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@colings86 colings86 merged commit 2d64e3d into elastic:master Oct 3, 2018
@colings86 colings86 deleted the debug/requestCacheTestLogging branch October 3, 2018 07:58
kcm pushed a commit that referenced this pull request Oct 30, 2018
* Adds trace logging to IndicesRequestCache

This change adds trace level logging to `IndicesrrequestCache` witht eh
primary aim of helping to identify the cause of teh failures in
#32827. The cache will
log at trace level when a cache hit or miss occurs including the reader
version and the cache key. Note that this change adds a
`cacheKeyRenderer` whcih supplies a human readable String of the cache
key since the actual cache key itself is a `BytesReference` containing
the wire protocol serialised form of the request.

Logging is also added for the case where a search timeout occurs and fr
that reason the cache entry is invalidated.

* Adds comment to remaind us to remove cacheKeyRenderer
javanna added a commit to javanna/elasticsearch that referenced this pull request Sep 17, 2020
In the context of of a recurring test failure tracked by elastic#32827, we added trace logging and an extra cache key renderer argument to IndicesRequestCache#getOrCompute (see elastic#39475 and elastic#34180).

We addressed the issue with elastic#54071, but the extra argument was left behind, with a NORELEASE comment saying it should be removed.

With this commit, we remove the extra cache key rendered argument and the corresponding log lines which are not so useful without it.

Closes elastic#55837
javanna added a commit that referenced this pull request Sep 18, 2020
In the context of of a recurring test failure tracked by #32827, we added trace logging and an extra cache key renderer argument to IndicesRequestCache#getOrCompute (see #39475 and #34180).

We addressed the issue with #54071, but the extra argument was left behind, with a NORELEASE comment saying it should be removed.

With this commit, we remove the extra cache key rendered argument and the corresponding log lines which are not so useful without it.

Closes #55837
javanna added a commit to javanna/elasticsearch that referenced this pull request Sep 18, 2020
…62534)

In the context of of a recurring test failure tracked by elastic#32827, we added trace logging and an extra cache key renderer argument to IndicesRequestCache#getOrCompute (see elastic#39475 and elastic#34180).

We addressed the issue with elastic#54071, but the extra argument was left behind, with a NORELEASE comment saying it should be removed.

With this commit, we remove the extra cache key rendered argument and the corresponding log lines which are not so useful without it.

Closes elastic#55837
javanna added a commit that referenced this pull request Sep 18, 2020
In the context of of a recurring test failure tracked by #32827, we added trace logging and an extra cache key renderer argument to IndicesRequestCache#getOrCompute (see #39475 and #34180).

We addressed the issue with #54071, but the extra argument was left behind, with a NORELEASE comment saying it should be removed.

With this commit, we remove the extra cache key rendered argument and the corresponding log lines which are not so useful without it.

Closes #55837
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>non-issue :Search/Search Search-related issues that do not fall into other categories v7.0.0-beta1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants