Avoid calling ReplicaSetWriteBlockBypass::setFromMetadata for read operations in readPrivilegedRequestMetadata

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Networking & Observability
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      ReplicaSetWriteBlockBypass::setFromMetadata is a write-blocking bypass initialization path, but it is currently executed even when the incoming operation is a read. The method sets the bypass state either from request metadata or from the AuthorizationSession default when the metadata field is absent, so calling it on reads introduces unnecessary state mutation / setup for operations that should not need replica-set write-block bypass handling.

      As part of this ticket, we should:

      1. Optimize readPrivilegedRequestMetadata so it does not call ReplicaSetWriteBlockBypass::get(opCtx).setFromMetadata(...) for read operations.
      2. Remove the duplication in readPrivilegedRequestMetadata checks concerning global user write blocking and replica set write blocking.
      3. Run a regression analysis for sep_benchmark and check that avoiding ReplicaSetWriteBlockBypass::setFromMetadata on reads reduces the extra read-path work introduced by SERVER-120970 and reported by BF-43448, with the expectation that instruction_per_iteration_mean for BM_FIND_ONE should go down.

       

            Assignee:
            Unassigned
            Reporter:
            Anna Maria Nestorov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: