You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Ilya Korol (Jira)" <ji...@apache.org> on 2021/06/11 12:06:00 UTC

[jira] [Created] (IGNITE-14898) IndexOutOfBoundException in flusher selection logic in GridCacheWriteBehindStore

Ilya Korol created IGNITE-14898:
-----------------------------------

             Summary: IndexOutOfBoundException in flusher selection logic in GridCacheWriteBehindStore
                 Key: IGNITE-14898
                 URL: https://issues.apache.org/jira/browse/IGNITE-14898
             Project: Ignite
          Issue Type: Bug
          Components: general
    Affects Versions: 2.10
            Reporter: Ilya Korol
            Assignee: Ilya Korol


There i a bug in GridCacheWriteBehindStore method for selecting which flusher should be used for current data write by specified key:

{code:java}
    /**
     * Return flusher by by key.
     *
     * @param key Key for search.
     * @return flusher.
     */
    private Flusher flusher(K key) {
        int h, idx;

        if (flushThreadCntIsPowerOfTwo)
            idx = ((h = key.hashCode()) ^ (h >>> 16)) & (flushThreadCnt - 1);
        else
            idx = ((h = key.hashCode()) ^ (h >>> 16)) % flushThreadCnt;

        return flushThreads[idx];
    }
{code}

In case when flushThreadCount is not a power of 2 and incoming key.hashCode() < 0 (e.g. for UUID string) we will get IndexOutOfBoundException.




--
This message was sent by Atlassian Jira
(v8.3.4#803005)