Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-5165

Add cursor copy debug mode

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: WT3.2.2, 4.3.3, 4.2.4
    • Component/s: None
    • Labels:
      None
    • Story Points:
      5
    • Sprint:
      Storage Engines 2019-11-18, Storage Engines 2019-12-02, Storage Engines 2019-12-16, Storage Engines 2019-12-30, Storage Engines 2020-01-13, Storage Engines 2020-01-27

      Description

      There have been a class of problems where MongoDB is using the addresses for data cursors keys and values after those cursors have repositioned or reset. Those stale addresses are often still "valid" unless eviction or some other event renders them invalid.

      MongoDB would like a setting where WiredTiger will malloc a copy of the data it is returning on every positioning cursor call. When the cursor changes its position, any previous copy would be freed and a new malloc call would occur for the next data. Doing this would allow sanitizers to detect this incorrect usage and aid MongoDB in finding these issues. (I.e. we would not use realloc because that tries to use the same space nor try to use the same memory ourselves if it fits, etc. We want a free/malloc.)

      This would only need to apply to the value portion.

      My suggested API would be to add debug_mode=(cursor_copy=true)). This setting would only apply to data/table cursors, and not, for example, to statistics, metadata or backup cursors.

      (A secondary possibility in this mode could be a memcmp prior to the free to verify that the user did not alter any WiredTiger content that it wasn't supposed to.)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              donald.anderson Donald Anderson
              Reporter:
              sue.loverso Susan LoVerso
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: