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

Inactive shard flush should wait for ongoing one #89430

Merged
merged 8 commits into from
Aug 22, 2022

Commits on Aug 18, 2022

  1. Inactive shard flush should wait for ongoing one

    org.elasticsearch.indices.flush.FlushIT#testFlushOnInactive would
    sometimes fail in the following case:
    * SHARD_MEMORY_INTERVAL_TIME_SETTING is set very low, e.g., 10ms
    * The regularly scheduled multiple flushes proceed to
      org.elasticsearch.index.shard.IndexShard#flushOnIdle
    * There, the first flush will handle e.g., the first document
      that was indexed. The second flush will arrive shortly after,
      before the first flush finishes.
    * The second flush will find that wasActive = true (due to the
      indexing of the remaining documents), and will set it to false.
    * However, the second flush will not be executed because
      waitIfOngoing = false, and there is the ongoing first flush.
    * No other flush is scheduled (since any next regularly scheduled
      flush will find wasActive = false), which creates the problem.
    
    Solution: if a flush request does not happen, revert active flag,
    so that a next flush request can happen.
    
    Fixes elastic#87888
    kingherc committed Aug 18, 2022
    Configuration menu
    Copy the full SHA
    c5509c4 View commit details
    Browse the repository at this point in the history
  2. Fix test

    kingherc committed Aug 18, 2022
    Configuration menu
    Copy the full SHA
    a1285b3 View commit details
    Browse the repository at this point in the history
  3. New test for concurrent flushes

    And fix some PR review feedback
    kingherc committed Aug 18, 2022
    Configuration menu
    Copy the full SHA
    bdb7a4b View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2022

  1. Apply suggestions from code review

    Co-authored-by: Henning Andersen <33268011+henningandersen@users.noreply.github.com>
    kingherc and henningandersen committed Aug 22, 2022
    Configuration menu
    Copy the full SHA
    d1cae13 View commit details
    Browse the repository at this point in the history
  2. Fix test and comments

    kingherc committed Aug 22, 2022
    Configuration menu
    Copy the full SHA
    92e9b3f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3ee32e8 View commit details
    Browse the repository at this point in the history
  4. Test active flag as well

    Fix some javadoc
    kingherc committed Aug 22, 2022
    Configuration menu
    Copy the full SHA
    d23a145 View commit details
    Browse the repository at this point in the history
  5. Improve test comments

    kingherc committed Aug 22, 2022
    Configuration menu
    Copy the full SHA
    7531b4f View commit details
    Browse the repository at this point in the history