Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-8691

Infinispan rejects to read cache file bigger than 2147483647 (Integer.MAX_VALUE)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not a Bug
    • Minor
    • 9.4.2.Final
    • 9.1.1.Final
    • Loaders and Stores
    • None
    • Sprint 9.4.0.CR1, Sprint 9.4.0.CR3, Sprint 10.0.0.Alpha1, Sprint 9.4.0.Final

    Description

      In my scenario the cache file size created by SingleFileStore is 3.054.196.342 bytes. When this file is tried to be loaded, it fails with the following exception:

      Caused by: org.infinispan.persistence.spi.PersistenceException: ISPN000279: Failed to read stored entries from file. Error in file /work/search-service-layer_data/infinispan/cache_test_dk83146/markupCache.dat at offset 4
              at org.infinispan.persistence.file.SingleFileStore.rebuildIndex(SingleFileStore.java:182)
              at org.infinispan.persistence.file.SingleFileStore.start(SingleFileStore.java:127)
              ... 155 more
      

      Cache file content:

      0000000000: 46 43 53 31 80 B1 89 47 │ 00 00 00 00 00 00 00 00  FCS1?+%G
      0000000010: 00 00 00 00 FF FF FF FF │ FF FF FF FF 02 15 4E 06      yyyyyyyy☻§N♠
      0000000020: 05 03 04 09 00 00 00 2F │ 6F 72 67 2E 73 70 72 69  ♣♥♦○   /org.spri
      0000000030: 6E 67 66 72 61 6D 65 77 │ 6F 72 6B 2E 63 61 63 68  ngframework.cach
      0000000040: 65 2E 69 6E 74 65 72 63 │ 65 70 74 6F 72 2E 53 69  e.interceptor.Si
      0000000050: 6D 70 6C 65 4B 65 79 4C │ 0A 57 03 6B 6D 93 D8 00  mpleKeyL◙W♥km"O
      0000000060: 00 00 02 00 00 00 08 68 │ 61 73 68 43 6F 64 65 23    ☻   ◘hashCode#
      0000000070: 00 00 00 00 06 70 61 72 │ 61 6D 73 16 00 16 15 E6      ♠params▬ ▬§?
      

      The problem is that integer value 0x80B18947 is treated as signed integer in line SingleFileStore:181, hence in expression

      if (fe.size < KEY_POS + fe.keyLen + fe.dataLen + fe.metadataLen) {
        throw log.errorReadingFileStore(file.getPath(), filePos);
      }
      

      fe.size is negative and equal to -2135848633.

      I have tried to configure the persistence storage so that it gets purged on start:

      <persistence passivation="true">
      	<file-store path="/var/cache/infinispan" purge="true">
      		<write-behind thread-pool-size="5" />
      	</file-store>
      </persistence>
      

      however this does not help as storage is first read and then purged (see also ISPN-7186).

      It is expected that SingleFileStore either does not allow to write such big entries to the cache, or handles them correctly.

      Attachments

        Activity

          People

            remerson@redhat.com Ryan Emerson
            dma_k Dmitry Katsubo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: