Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-7420

Global stores should be guarded as read-only for regular tasks

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.2.0
    • streams

    Description

      Global stores should only be update by the global thread. Any other task, should only read from a global store. However, when getting a reference to a global store, all tasks have full read/write access to the store.

      We should put a guard in place and only return either (a) a read-only store, or (b) wrap the store but throw an exception on write for regular tasks.

      While the read-only store idea might be cleaner from an API point of view, we should consider the second approach for 2 reasons: (1) it's backwards compatible (of course, code might fail at runtime, but this seems to be ok, as it indicates a bug in the user code anyway) (2) with regard to KIP-358, we should have the more runtime efficient methods at this level (currently, global stores are only key-value stores and this argument falls a little short though—however, it might be a good idea to stay future proof; at least, we should discuss it).

      Attachments

        Issue Links

          Activity

            People

              nizhikov Nikolay Izhikov
              mjsax Matthias J. Sax
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: