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

Ignite logs that ClientCache#putAll uses unordered map

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None
    • Release Notes Required

    Description

      Even if user puts TreeSet to ClientCache#putAll to transactional cache it logs warning that map is unordered.

      [2024-10-13T15:53:34,892][WARN ]client-connector-#76%ignite.MyTest%[GridDhtColocatedCache] <default> Unordered map java.util.LinkedHashMap is used for putAll operation on cache default. This can lead to a distributed deadlock. Switch to a sorted map like TreeMap instead.

      To reproduce:

      try (IgniteClient cln = Ignition.startClient(clnCfg) {
          ClientCache c = cln.createCache(new ClientCacheConfiguration()
              .setName(DEFAULT_CACHE_NAME)
              .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL));
      
          Map<Integer, Integer> map = new TreeMap<>();
          map.put(0, 0);
          map.put(1, 1);
      
          c.putAll(map);
      }

       

      Possible solutions:

      1. Log the warn on client side only and skip warning on server side.
      2. Send a type of map with `putAll`, but how to fill it on server side?

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              timonin.maksim Maksim Timonin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: