Skip to content
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

Replace version with reader cache key in IndicesRequestCache #34189

Merged
merged 2 commits into from
Oct 4, 2018

Commits on Oct 1, 2018

  1. Replace version with reader cache key in IndicesRequestCache

    Today we use the version of a DirectoryReader as a component of the key
    of IndicesRequestCache. This usage is perfectly fine since the version
    is advanced every time a new change is made into IndexWriter. In other
    words, two DirectoryReader with the same version should have the same
    content. However, this invariant is only guaranteed in the context of a
    single IndexWriter because the version is reset to the committed version
    value when IndexWriter is re-opened.
    
    Since elastic#33473, each IndexShard may have more than one IndexWriter, and
    using the version of a DirectoryReader as a part of the cache key can
    cause IndicesRequestCache to return stale cached values. For example, in
    elastic#27650, we rollback the engine (i.e., re-open IndexWriter), index new
    documents, refresh, then make a count request, but the search layer
    mistakenly returns the count of the DirectoryReader of the previous
    IndexWriter because the current DirectoryReader has the same version to
    the old DirectoryReader. This is possible because these two readers come
    from different IndexWriters.
    
    This commit replaces the the version with the reader cache key of
    IndexReader as a component of the cache key of IndicesRequestCache.
    
    Closes elastic#27650
    Relates elastic#33473
    dnhatn committed Oct 1, 2018
    Configuration menu
    Copy the full SHA
    dd9c054 View commit details
    Browse the repository at this point in the history

Commits on Oct 3, 2018

  1. Configuration menu
    Copy the full SHA
    b73fbf8 View commit details
    Browse the repository at this point in the history