Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-13052

Calculate result of reserveHistoryForExchange in advance

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.9
    • None
    • None
    • Docs Required, Release Notes Required

    Description

      Method reserveHistoryForExchange() is called on every partition map exchange. It's an expensive call: it requires iteration over the whole checkpoint history with possible retrieve of GroupState from WAL (it's stored on heap with SoftReference). On some deployments this operation can take several minutes.

      The idea of optimization is to calculate its result only on first PME (ideally, even before first PME, on recovery stage), keep resulting map (grpId, partId -> earlisetCheckpoint) on heap and update it if necessary. From the first glance, the map should be updated:
      1) On checkpoint. If a new partition appears on local node, it should be registered in the map with current checkpoint. If a partition is evicted from local node, or changes its state to non-OWNING, it should be removed from the map. If checkpoint is marked as inapplicable for a certain group, the whole group should be removed from the map.
      2) On checkpoint history cleanup. For every (grpId, partId), previous earliest checkpoint should be changed with setIfGreater to new earliest checkpoint.
      We should also extract WAL pointer reservation and filtering small partitions from reserveHistoryForExchange(), but this shouldn't be a problem.
      Another point for optimization: searchPartitionCounter() and searchCheckpointEntry() are executed for each (grpId, partId). That means we'll perform O(number of partitions) linear lookups in history. This should be optimized as well: we can perform one lookup for all (grpId, partId) pairs. This is especially critical for reserveHistoryForPreloading() method complexity: it's executed from exchange thread.

      Memory overhead of storing described map on heap is insignificant. Its size isn't greater than size of map returned from reserveHistoryForExchange().

      Described fix should be much simpler than IGNITE-12429.

      P.S. Possibly, instead of storing map, we can keep earliestCheckpoint right in GridDhtLocalPartition. It may simplify implementation.

      Attachments

        Issue Links

          Activity

            People

              v.pyatkov Vladislav Pyatkov
              ivan.glukos Ivan Rakov
              Ivan Rakov Ivan Rakov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 80h
                  80h
                  Remaining:
                  Remaining Estimate - 79h 40m
                  79h 40m
                  Logged:
                  Remaining Estimate - 79h 40m
                  20m