Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-20279

OperationShardVersion::get should return a pointer, not a mutable reference

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor - P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: Sharding
    • Labels:
      None

      Description

      OperationShardVersion is a copyable type, and OperationShardVersion::get(txn) returns a reference to "txn"'s OSV. If that value is captured into a local value variable instead of a local reference variable by omitting the &, the compiler will not fail, and this could lead to hard to find bugs.

      OperationShardVersion::get should be changed to return a pointer, and its value should be captured into an OperationShardVersion* when it is captured at all, to avoid this risk.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-server-sharding Backlog - Sharding Team
              Reporter:
              schwerin Andy Schwerin
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated: