Reduce scratch buffer locking mechanism to only default session

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Storage Engines - Foundations
    • 191.552
    • None
    • None

      The scratch buffer of an internal session is protected by scratch_lock.

      A session should be associated with a single thread. The exception in WT is the default_session that will be used by any thread when not associated with any session. 

      Extensions like compressors, encryptors, collators, depends on scratch buffer allocation that are not associated with any session.

      Scratch buffer allocations without any session attached will be serviced from the connection level default_session. The scratch buffer allocations from the default_session needs synchronisatio.

      So the concurrency construct scratch_lock is only required for default_session, not for other internal_sessions like sessions used by eviction threads, checkpoint etc.,

      At the moment the scratch lock is used for all internal sessions, instead of for only connection level default_session. 

      We can improve it to limit the scratch_lock only for default_session and reducing the lock/unlock overhead as part of scratch allocation for other internal sessions.

      For reference : scratch_lock is introduced as part of WT-13640

       

            Assignee:
            [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            Vamsi Boyapati
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: