Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-2283

row level atomicity

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • None
    • 0.90.0
    • None
    • None
    • Reviewed

    Description

      The flow during a HRegionServer.put() seems to be the following. [For now, let's just consider single row Put containing edits to multiple column families/columns.

      HRegionServer.put() does a:

      HRegion.put();
      syncWal() (the HDFS sync call). /* this is assuming we have HDFS-200 */

      HRegion.put() does a:
      for each column family

      { HLog.append(all edits to the colum family); write all edits to Memstore; }

      HLog.append() does a :
      foreach edit in a single column family

      { doWrite() }

      doWrite() does a:
      this.writer.append().

      There seems to be two related issues here that could result in inconsistencies.

      Issue #1: A put() does a bunch of HLog.append() calls. These in turn do a bunch of "write" calls on the underlying DFS stream. If we crash after having written out some append's to DFS, recovery will run and apply a partial transaction to memstore.

      Issue #2: The updates to memstore should happen after the sync rather than before. Otherwise, there is the danger that the write to DFS (sync) fails for some reason & we return an error to the client, but we have already taken edits to the memstore. So subsequent reads will serve uncommitted data.

      Attachments

        1. rowLevelAtomicity_2283_v3.patch
          37 kB
          Kannan Muthukkaruppan
        2. rowLevelAtomicity_2283_v2.patch
          36 kB
          Kannan Muthukkaruppan
        3. rowLevelAtomicity_2283_v1.patch
          31 kB
          Kannan Muthukkaruppan

        Issue Links

          Activity

            People

              kannanm Kannan Muthukkaruppan
              kannanm Kannan Muthukkaruppan
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: