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

Incorrect version check in GridDhtPartitionsReservation#release

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None
    • Docs Required, Release Notes Required

    Description

      Currently GridDhtPartitionsReservation holds a last server topology version, but compares it with a current version in reserve, causing unnecessary eviction attempts.

      The fix looks easy:

      /**
           * Releases all the registered partitions.
           */
          @Override public void release() {
              for (;;) {
                  int r = reservations.get();
      
                  if (r <= 0)
                      throw new IllegalStateException("Method 'reserve' must be called before 'release'.");
      
                  if (reservations.compareAndSet(r, r - 1)) {
                      // If it was the last reservation and topology version changed -> attempt to evict partitions.
                      if (r == 1 && !cctx.kernalContext().isStopping() &&
                          !topVer.equals(cctx.shared().exchange().lastAffinityChangedTopologyVersion(cctx.topology().readyTopologyVersion())))
                          tryEvict(parts.get());
      
                      return;
                  }
              }
          }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            ascherbakov Alexey Scherbakov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: