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

Bug in GridCacheWriteBehindStore Flusher thread lookup

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.8, 2.7.5, 2.7.6, 2.9, 2.8.1, 2.10, 2.9.1
    • 2.12
    • cache
    • None
    • Fixed bug in GridGainWriteBehindStore flushers thread lookup.
    • Docs Required, Release Notes Required

    Description

      There's a bug in GridCacheWriteBehindStore in the flusher method.

      https://github.com/apache/ignite/blob/master/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheWriteBehindStore.java#L674

      The logic states there that if flush thread count is not a power of 2, then perform this math, which is not guaranteed to return a positive number.

      idx = ((h = key.hashCode()) ^ (h >>> 16)) % flushThreadCnt
      

      For example, if you pass this string as a key, it returns a negative number:
      accb2e8ea33e4a89b4189463cacc3c4e

      and then throws an array out of bounds exception when looking up the thread.

      http://apache-ignite-developers.2346864.n4.nabble.com/IndexOutOfBoundsException-in-GridCacheWriteBehindStore-Flusher-thread-lookup-IGNITE-14893-tp52827.html

      Attachments

        Issue Links

          Activity

            People

              Korol Ilya Korol
              mberg Mike W
              Vyacheslav Koptilin Vyacheslav Koptilin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m