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

Add unit testing for hazard pointers

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • 8
    • StorEng - Defined Pipeline

      Dedicated testing for hazard pointers is currently limited. This ticket will add unit tests for the hazard pointer logic. These tests only need to cover functional behaviour, and don't need to think about races between threads that modify hazard pointers.

      (Some of) the behaviour to be covered includes:

      • Inserting a new hazard pointer (hazard_set_func)
        • When no previous hazard pointer is present for the page
        • When the session already holds a hazard pointer for the page
      • Removing a hazard pointer (hazard_clear)
        • When the session has that hazard pointer
        • When the session does not have that hazard pointer already
      • Verifying that hazard_check
        • Finds hazard pointers when they are present
        • Does not find hazard pointers when they aren't present
        • That the above behaviour works across multiple sessions
      • That hazard_count returns the correct result for varying numbers of hazard pointers

      This process may also require exposing the relevant functions to the unit testing framework when the HAVE_UNITTEST compile flag is set.

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            andrew.morton@mongodb.com Andrew Morton
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: