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

Rewrite shard follow node task logic #31581

Merged
merged 46 commits into from
Jul 10, 2018

Commits on Jun 27, 2018

  1. Rewrite shard follow node task logic

    The current shard follow mechanism is complex and does not give us easy ways the have visibility into the system (e.g. why we are falling behind).
    The main reason why it is complex is because the current design is highly asynchronous. Also in the current model it is hard to apply backpressure
    other than reducing the concurrent reads from the leader shard.
    
    This PR has the following changes:
    * Rewrote the shard follow task to coordinate the shard follow mechanism between a leader and follow shard in a single threaded manner.
      This allows for better unit testing and makes it easier to add stats.
    * All write operations read from the shard changes api should be added to a buffer instead of directly sending it to the bulk shard operations api.
      This allows to apply backpressure. In this PR there is a limit that controls how many write ops are allowed in the buffer after which no new reads
      will be performed until the number of ops is below that limit.
    * The shard changes api includes the current global checkpoint on the leader shard copy. This allows reading to be a more self sufficient process;
      instead of relying on a background thread to fetch the leader shard's global checkpoint.
    * Reading write operations from the leader shard (via shard changes api) is a seperate step then writing the write operations (via bulk shards operations api).
      Whereas before a read would immediately result into a write.
    * The bulk shard operations api returns the local checkpoint on the follow primary shard, to keep the shard follow task up to date with what has been written.
    * Moved the shard follow logic that was previously in ShardFollowTasksExecutor to ShardFollowNodeTask.
    * Moved over the changes from elastic#31242 to make shard follow mechanism resilient from node and shard failures.
    
    Relates to elastic#30086
    martijnvg committed Jun 27, 2018
    Configuration menu
    Copy the full SHA
    516dcb7 View commit details
    Browse the repository at this point in the history

Commits on Jun 28, 2018

  1. Made to param required like before and changed validation in shard ch…

    …anges api and
    
    LuceneChangesSnapshot to allow a response to not return up to `toSeqNo`.
    martijnvg committed Jun 28, 2018
    Configuration menu
    Copy the full SHA
    9dec920 View commit details
    Browse the repository at this point in the history
  2. changed log levels

    martijnvg committed Jun 28, 2018
    Configuration menu
    Copy the full SHA
    7ae1f1d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5510731 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f3d58e0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0330e5f View commit details
    Browse the repository at this point in the history
  6. iter

    martijnvg committed Jun 28, 2018
    Configuration menu
    Copy the full SHA
    adc829f View commit details
    Browse the repository at this point in the history
  7. coordinate reads should not schedule, but if there is budget at least…

    … do a single read.
    
    if the shard changes response returns no hits and had no target seqno then
    it should schedule coordinate reads phase.
    martijnvg committed Jun 28, 2018
    Configuration menu
    Copy the full SHA
    0b8e6a7 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    7b3fb30 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    a0059ae View commit details
    Browse the repository at this point in the history
  10. iter, exception handling.

    martijnvg committed Jun 28, 2018
    Configuration menu
    Copy the full SHA
    a356fbe View commit details
    Browse the repository at this point in the history
  11. iter

    martijnvg committed Jun 28, 2018
    Configuration menu
    Copy the full SHA
    fa6bb6f View commit details
    Browse the repository at this point in the history
  12. adjusted test

    martijnvg committed Jun 28, 2018
    Configuration menu
    Copy the full SHA
    e73d990 View commit details
    Browse the repository at this point in the history

Commits on Jun 29, 2018

  1. improve coordinateReads()

    martijnvg committed Jun 29, 2018
    Configuration menu
    Copy the full SHA
    942c777 View commit details
    Browse the repository at this point in the history
  2. improved assert

    martijnvg committed Jun 29, 2018
    Configuration menu
    Copy the full SHA
    9cdf320 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b5c6187 View commit details
    Browse the repository at this point in the history

Commits on Jul 1, 2018

  1. Merge remote-tracking branch 'elastic/ccr' into pr/31581

    * elastic/ccr: (30 commits)
      Enable setting client path prefix to / (elastic#30119)
      [DOCS] Secure settings specified per node (elastic#31621)
      has_parent builder: exception message/param fix (elastic#31182)
      TEST: Randomize soft-deletes settings (elastic#31585)
      Mute 'Test typed keys parameter for suggesters' as we await a fix.
      Build test: Thread linger
      Fix gradle4.8 deprecation warnings (elastic#31654)
      Mute FileRealmTests#testAuthenticateCaching with an @AwaitsFix.
      Mute TransportChangePasswordActionTests#testIncorrectPasswordHashingAlgorithm with an @AwaitsFix.
      Build: Fix naming conventions task   (elastic#31681)
      Introduce a Hashing Processor (elastic#31087)
      Do not check for object existence when deleting repository index files (elastic#31680)
      Remove extra check for object existence in repository-gcs read object (elastic#31661)
      Support multiple system store types (elastic#31650)
      [Test] Clean up some repository-s3 tests (elastic#31601)
      [Docs] Use capital letters in section headings (elastic#31678)
      muted tests that will be replaced by the shard follow task refactoring: elastic#31581
      [DOCS] Add PQL language Plugin (elastic#31237)
      Merge AzureStorageService and AzureStorageServiceImpl and clean up tests (elastic#31607)
      TEST: Fix test task invocation (elastic#31657)
      ...
    jasontedor committed Jul 1, 2018
    Configuration menu
    Copy the full SHA
    5cd19ad View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2018

  1. iter

    martijnvg committed Jul 2, 2018
    Configuration menu
    Copy the full SHA
    e9d61c1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9b8de5f View commit details
    Browse the repository at this point in the history

Commits on Jul 3, 2018

  1. increase timeouts

    martijnvg committed Jul 3, 2018
    Configuration menu
    Copy the full SHA
    60fb9a8 View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2018

  1. Configuration menu
    Copy the full SHA
    75b07aa View commit details
    Browse the repository at this point in the history
  2. rename + jdocs

    martijnvg committed Jul 5, 2018
    Configuration menu
    Copy the full SHA
    2ec6ac4 View commit details
    Browse the repository at this point in the history
  3. iter

    martijnvg committed Jul 5, 2018
    Configuration menu
    Copy the full SHA
    fa1b52f View commit details
    Browse the repository at this point in the history
  4. keep strict validation

    martijnvg committed Jul 5, 2018
    Configuration menu
    Copy the full SHA
    932eeaa View commit details
    Browse the repository at this point in the history
  5. iter2

    martijnvg committed Jul 5, 2018
    Configuration menu
    Copy the full SHA
    aa11dda View commit details
    Browse the repository at this point in the history
  6. implemented custom WritePrimaryResult to include global checkpoint in…

    … response after
    
    it replication has been completed
    martijnvg committed Jul 5, 2018
    Configuration menu
    Copy the full SHA
    b100b97 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    9048913 View commit details
    Browse the repository at this point in the history
  8. added to test whether we always return at least 1 op when

    the maxOperationSizeInBytes limit has been met
    martijnvg committed Jul 5, 2018
    Configuration menu
    Copy the full SHA
    fb8d47e View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    b0e3d49 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    b6f0320 View commit details
    Browse the repository at this point in the history
  11. added comment

    martijnvg committed Jul 5, 2018
    Configuration menu
    Copy the full SHA
    d17a4b3 View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2018

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

Commits on Jul 9, 2018

  1. made parameter names consistent and collapsed maxReadSize and maxWrit…

    …eSize into maxBatchOperationCount
    martijnvg committed Jul 9, 2018
    Configuration menu
    Copy the full SHA
    53fe1c2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    813498a View commit details
    Browse the repository at this point in the history
  3. iter

    martijnvg committed Jul 9, 2018
    Configuration menu
    Copy the full SHA
    cb03c9a View commit details
    Browse the repository at this point in the history
  4. iter2

    martijnvg committed Jul 9, 2018
    Configuration menu
    Copy the full SHA
    7682b8c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    80c895d View commit details
    Browse the repository at this point in the history
  6. added some more stats

    martijnvg committed Jul 9, 2018
    Configuration menu
    Copy the full SHA
    e6c5422 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    3eb0056 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    efee1af View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    2367e06 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    d9086fe View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2018

  1. variable rename

    martijnvg committed Jul 10, 2018
    Configuration menu
    Copy the full SHA
    bf251af View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    775de27 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cf63047 View commit details
    Browse the repository at this point in the history
  4. the if check is not needed, calling coordinateReads() and coordinateW…

    …rites() is always safe
    martijnvg committed Jul 10, 2018
    Configuration menu
    Copy the full SHA
    cb09fd7 View commit details
    Browse the repository at this point in the history