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

cbdbmain --vacuum doesn't work

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Major
    • 2.0-beta
    • 1.7.2, 1.8.0
    • storage-engine
    • Security Level: Public
    • None
    • Linux

    Description

      I believe that cbdbmaint --vacuum doesn't currently do anything, and silently swallows errors.

      By modifying the script to print the stderr output from the run_sql, I see this:
      "Error: incomplete SQL: vacuum"

      I believe this is because SQL requires the vacuum command to be followed by a trailing semi-colon.

      I propose the following patch to improve error handling and to fix this problem, by adding a semi-colon to the vacuum command: (Also attached as a text file)

      $ diff -c /opt/couchbase/lib/python/ cbdbmaint

          • /opt/couchbase/lib/python/cbdbmaint Thu Dec 29 11:19:51 2011
          • cbdbmaint Thu Mar 22 07:27:49 2012
            ***************
          • 33,38 ****
          • 33,42 ----
            logger.write("Error running query: %s\n" % sql)
            logger.write(e)
            sys.exit(1)
            + if e:
            + logger.write("Error running query: %s\n" % sql)
            + logger.write(e)
            + sys$exit(1)
            return o

      def findCmd(cmdName):
      ***************

          • 73,79 ****

      if shouldVacuum and (fn == db_path or isADBFile(fn)):
      print "Vacuuming", fn
      ! run_sql(sqlitebin, fn, "vacuum")

      if dest_dir:
      dest_fn = os.path.join(dest_dir, os.path.basename(fn))
      — 77,83 ----

      if shouldVacuum and (fn == db_path or isADBFile(fn)):
      print "Vacuuming", fn
      ! print run_sql(sqlitebin, fn, "vacuum;")

      if dest_dir:
      dest_fn = os.path.join(dest_dir, os.path.basename(fn))

      Attachments

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

        Activity

          People

            steve Steve Yen
            steve.little Steve Little
            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