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

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Sharding EMEA
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

              Assignee:
              [DO NOT USE] Backlog - Sharding EMEA
              Reporter:
              Andy Schwerin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: