Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-18352

Optimize metadata mapping for distributed timers

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 30.0.0.Final
    • 29.0.0.Final
    • Clustering
    • None

      The metadata for a each distributed timer instance is mapped to 2 cache entries: 1 entry stores immutable meta data (e.g. timer configuration, timer context, etc); and 1 entry stores meta data that changes every timeout (e.g. duration between start time and last timeout).
      The intention was to minimize the the payload for requests for existing beans, where only the duration since creation requires updating.

      There are a few problems with this approach:
      1. Each cache entry requires the overhead of the cache key
      2. The existing mapping is prone to cross-entry data integrity issues, since both meta data entries must always exist.

      By leveraging Cache.compute(...), we can, encapsulate any meta data changes within a function, allowing us to store all meta data in a single cache entry, while still minimizing the payload per request. Additionally, since the compute function has access to the existing
      last timeout, we don't need to send the full duration value, but only the differences. Thus the payload of this value will never increase over time, as it does currently, since ProtoStream requires fewer bytes for smaller numeric values.

            pferraro@redhat.com Paul Ferraro
            pferraro@redhat.com Paul Ferraro
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: