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

Local caches should use 1 segment everywhere

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • Major
    • None
    • None
    • Core, Loaders and Stores
    • None

    Description

      Local cache data containers always use 1 segment. But if any store is segmented (and they are segmented by default), the stores still create numSegments segments and waste time computing the segment of keys.

      What's more, the stores are dynamic, so other components that work with stores need to adjust whether they use segments internally or not based on the current available stores. Some of them do (KeyPartitioner, LocalPublisherManagerImpl, ClusterLoader query PersistenceStatus.usingSegmentedStore() every time), some of them do not (LocalLogic, LocalClusterPublisherManagerImpl only query Configurations.needSegments() on startup, others like DataContainerFactory do not care about stores at all).

      A LOCAL cache with a segmented store is unable to compute the cache size in constant time, because size uses publishers internally. Because of the segmented store, each segment is iterated separately, but that means iterating the data container numSegments times and filtering out the keys in other segments.

      It would be much simpler if local caches used 1 segment everywhere, and if any store is configured as segmented, only 1 segment is used. If a user wants to migrate from a LOCAL cache to a DIST cache or vice-versa, they can use the store migrator to migrate their data.

      Attachments

        Activity

          People

            Unassigned Unassigned
            dberinde@redhat.com Dan Berindei (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: