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

page-swap error handling is inconsistent

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • WT2.8.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      WiredTiger's page-swap function error handling is wrong.

      There are 5 callers of the page-swap function: 2 in the walk code, 2 in the row-store search code, 1 in the column-store search code. They expect to handle following errors:

      1. walk #1: handles no errors
      2. walk #2: handles both restart and notfound errors
      3. row-store search #1, #2 and column-store search: all handle restart errors

      The underlying function:

      • returns the error in the case of either restart or notfound, without discarding the originally held page,
      • discards both the originally held and desired page on other error (the desired page is discarded when the desired page is successfully acquired, but the originally held page is not successfully discarded).

      If the caller discards the originally held page on error, they will attempt to discard an already discarded hazard pointer in cases where no page is held when the underlying function returns.

      If the caller doesn't discard the originally held page on error, they will fail to discard a hazard pointer should the underlying function return a notfound or restart error they're not prepared to handle.

            keith.bostic@mongodb.com Keith Bostic (Inactive)
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            0 Vote for this issue
            1 Start watching this issue