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

Keep data consistent if writes fail during a clean shutdown

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4.10, 3.6.0-rc0, WT3.0.0, 3.2.20
    • Component/s: None
    • Labels:
      None
    • Sprint:
      Storage 2017-10-02
    • Backport Requested:
      v3.4, v3.2

      Description

      Write failures during a clean shutdown can leave WiredTiger tables inconsistent with each other on restart.

      WT_CONNECTION::close attempts to continue after most errors so that it can free as many resources as possible. However, continuing after some writes fail during clean shutdown could incorrectly go on to mark the database as clean so that recovery would be skipped next time the database is opened. If some tables were successfully flushed before the error occurred, this could lead to inconsistencies in the data.

      For example, if WiredTiger successfully closes a MongoDB _id index (making it durable), but writes fail before the corresponding collection becomes durable, then on restart, when replication replays the oplog entries, it can successfully insert into the collection but then unexpectedly find the _id entries from before the shutdown, causing an assertion failure.

      WiredTiger should do a full checkpoint as part of a clean shutdown to avoid trees becoming inconsistent in this situation.

        Attachments

          Activity

            People

            • Assignee:
              sue.loverso Sue LoVerso
              Reporter:
              michael.cahill Michael Cahill
            • Votes:
              0 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: