checkpoints.asciidoc 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. [role="xpack"]
  2. [[transform-checkpoints]]
  3. === How {transform} checkpoints work
  4. ++++
  5. <titleabbrev>How checkpoints work</titleabbrev>
  6. ++++
  7. beta[]
  8. Each time a {transform} examines the source indices and creates or
  9. updates the destination index, it generates a _checkpoint_.
  10. If your {transform} runs only once, there is logically only one
  11. checkpoint. If your {transform} runs continuously, however, it creates
  12. checkpoints as it ingests and transforms new source data.
  13. To create a checkpoint, the {ctransform}:
  14. . Checks for changes to source indices.
  15. +
  16. Using a simple periodic timer, the {transform} checks for changes to
  17. the source indices. This check is done based on the interval defined in the
  18. transform's `frequency` property.
  19. +
  20. If the source indices remain unchanged or if a checkpoint is already in progress
  21. then it waits for the next timer.
  22. . Identifies which entities have changed.
  23. +
  24. The {transform} searches to see which entities have changed since the
  25. last time it checked. The `sync` configuration object in the {transform}
  26. identifies a time field in the source indices. The {transform} uses the values
  27. in that field to synchronize the source and destination indices.
  28. . Updates the destination index (the {dataframe}) with the changed entities.
  29. +
  30. --
  31. The {transform} applies changes related to either new or changed
  32. entities to the destination index. The set of changed entities is paginated. For
  33. each page, the {transform} performs a composite aggregation using a
  34. `terms` query. After all the pages of changes have been applied, the checkpoint
  35. is complete.
  36. --
  37. This checkpoint process involves both search and indexing activity on the
  38. cluster. We have attempted to favor control over performance while developing
  39. {transforms}. We decided it was preferable for the
  40. {transform} to take longer to complete, rather than to finish quickly
  41. and take precedence in resource consumption. That being said, the cluster still
  42. requires enough resources to support both the composite aggregation search and
  43. the indexing of its results.
  44. TIP: If the cluster experiences unsuitable performance degradation due to the
  45. {transform}, stop the {transform}. Consider whether you can apply a
  46. source query to the {transform} to reduce the scope of data it
  47. processes. Also consider whether the cluster has sufficient resources in place
  48. to support both the composite aggregation search and the indexing of its
  49. results.
  50. [discrete]
  51. [[ml-transform-checkpoint-errors]]
  52. ==== Error handling
  53. Failures in {transforms} tend to be related to searching or indexing.
  54. To increase the resiliency of {transforms}, the cursor positions of
  55. the aggregated search and the changed entities search are tracked in memory and
  56. persisted periodically.
  57. Checkpoint failures can be categorized as follows:
  58. * Temporary failures: The checkpoint is retried. If 10 consecutive failures
  59. occur, the {transform} has a failed status. For example, this
  60. situation might occur when there are shard failures and queries return only
  61. partial results.
  62. * Irrecoverable failures: The {transform} immediately fails. For
  63. example, this situation occurs when the source index is not found.
  64. * Adjustment failures: The {transform} retries with adjusted settings.
  65. For example, if a parent circuit breaker memory errors occur during the
  66. composite aggregation, the {transform} receives partial results. The aggregated
  67. search is retried with a smaller number of buckets. This retry is performed at
  68. the interval defined in the `frequency` property for the {transform}. If the
  69. search is retried to the point where it reaches a minimal number of buckets, an
  70. irrecoverable failure occurs.
  71. If the node running the {transforms} fails, the {transform} restarts
  72. from the most recent persisted cursor position. This recovery process might
  73. repeat some of the work the {transform} had already done, but it ensures data
  74. consistency.