Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-11514

Setting wal_flush_before_commit triggers flush on every set, in a transaction

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • techdebt-backlog
    • 2.5.1
    • forestdb
    • Security Level: Public
    • None
    • Untriaged
    • Unknown

    Description

      If a database's configuration's wal_flush_before_commit is set to true, and a lot of documents are added in a transaction, then ForestDB will eventually start flushing the WAL after every fdb_set call, causing a major slowdown. (In my benchmark code I'm seeing the populate-database test take 3x as long with wal_flush_before_commit enabled.)

      The problem I'm seeing is that the trigger for a WAL flush is
      wal_get_size(file) > _fdb_get_wal_threshold(handle))
      (forestdb.cc:2030). But when a transaction is active, the flush doesn't actually commit the WAL, so its size doesn't decrease. Therefore, once wal_get_size hits a large enough value, every single fdb_set call will trigger another flush.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jung-sang Jung-Sang Ahn (Inactive)
            jens Jens Alfke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty