CouchDB
  1. CouchDB
  2. COUCHDB-1794

Automatic compaction warning causes crash

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3
    • Fix Version/s: 1.3.1
    • Component/s: Database Core
    • Labels:
      None

      Description

      While evaluating CouchDB 1.3.0's automatic compaction daemon, I encountered an error when the daemon tried to warn about insufficient free space:

      [Mon, 13 May 2013 22:30:10 GMT] [error] [emulator] Error in process <0.467.0> with exit value: {undef,[{couch_log,warn_on,[couch_compaction_daemon],[]},{couch_compaction_daemon,can_db_compact,2,[{file,"couch_compaction_daemon.erl"},{line,305}]},{couch_compaction_daemon,maybe_compact_db,2,[{file,"couch_compact... 
      
      [Mon, 13 May 2013 22:30:10 GMT] [error] [<0.466.0>] ** Generic server couch_compaction_daemon terminating 
      ** Last message in was {'EXIT',<0.467.0>,
                                 {undef,
                                     [{couch_log,warn_on,
                                          [couch_compaction_daemon],
                                          []},
                                      {couch_compaction_daemon,can_db_compact,2,
                                          [{file,"couch_compaction_daemon.erl"},
                                           {line,305}]},
                                      {couch_compaction_daemon,maybe_compact_db,2,
                                          [{file,"couch_compaction_daemon.erl"},
                                           {line,136}]},
                                      {couch_compaction_daemon,
                                          '-compact_loop/1-fun-0-',2,
                                          [{file,"couch_compaction_daemon.erl"},
                                           {line,113}]},
                                      {couch_server,'-all_databases/2-fun-0-',4,
                                          [{file,"couch_server.erl"},{line,207}]},
                                      {filelib,do_fold_files2,8,
                                          [{file,"filelib.erl"},{line,218}]},
                                      {couch_server,all_databases,2,
                                          [{file,"couch_server.erl"},{line,200}]},
                                      {couch_compaction_daemon,compact_loop,1,
                                          [{file,"couch_compaction_daemon.erl"},
                                           {line,101}]}]}}
      ** When Server state == {state,<0.467.0>}
      ** Reason for termination == 
      ** {compaction_loop_died,
             {undef,
                 [{couch_log,warn_on,[couch_compaction_daemon],[]},
                  {couch_compaction_daemon,can_db_compact,2,
                      [{file,"couch_compaction_daemon.erl"},{line,305}]},
                  {couch_compaction_daemon,maybe_compact_db,2,
                      [{file,"couch_compaction_daemon.erl"},{line,136}]},
                  {couch_compaction_daemon,'-compact_loop/1-fun-0-',2,
                      [{file,"couch_compaction_daemon.erl"},{line,113}]},
                  {couch_server,'-all_databases/2-fun-0-',4,
                      [{file,"couch_server.erl"},{line,207}]},
                  {filelib,do_fold_files2,8,[{file,"filelib.erl"},{line,218}]},
                  {couch_server,all_databases,2,
                      [{file,"couch_server.erl"},{line,200}]},
                  {couch_compaction_daemon,compact_loop,1,
                      [{file,"couch_compaction_daemon.erl"},{line,101}]}]}}
      
      [Mon, 13 May 2013 22:30:10 GMT] [error] [<0.466.0>] {error_report,<0.30.0>,
                           {<0.466.0>,crash_report,
                            [[{initial_call,
                               {couch_compaction_daemon,init,['Argument__1']}},
                              {pid,<0.466.0>},
                              {registered_name,couch_compaction_daemon},
                              {error_info,
                               {exit,
                                {compaction_loop_died,
                                 {undef,
                                  [{couch_log,warn_on,[couch_compaction_daemon],[]},
                                   {couch_compaction_daemon,can_db_compact,2,
                                    [{file,"couch_compaction_daemon.erl"},
                                     {line,305}]},
                                   {couch_compaction_daemon,maybe_compact_db,2,
                                    [{file,"couch_compaction_daemon.erl"},
                                     {line,136}]},
                                   {couch_compaction_daemon,
                                    '-compact_loop/1-fun-0-',2,
                                    [{file,"couch_compaction_daemon.erl"},
                                     {line,113}]},
                                   {couch_server,'-all_databases/2-fun-0-',4,
                                    [{file,"couch_server.erl"},{line,207}]},
                                   {filelib,do_fold_files2,8,
                                    [{file,"filelib.erl"},{line,218}]},
                                   {couch_server,all_databases,2,
                                    [{file,"couch_server.erl"},{line,200}]},
                                   {couch_compaction_daemon,compact_loop,1,
                                    [{file,"couch_compaction_daemon.erl"},
                                     {line,101}]}]}},
                                [{gen_server,terminate,6,
                                  [{file,"gen_server.erl"},{line,747}]},
                                 {proc_lib,init_p_do_apply,3,
                                  [{file,"proc_lib.erl"},{line,227}]}]}},
                              {ancestors,
                               [couch_secondary_services,couch_server_sup,<0.31.0>]},
                              {messages,[]},
                              {links,[<0.92.0>]},
                              {dictionary,[]},
                              {trap_exit,true},
                              {status,running},
                              {heap_size,987},
                              {stack_size,24},
                              {reductions,2845}],
      

      It looks like this is being caused by the ?LOG_WARN macro referencing couch_log:warn_on/1 (which does not exist and appears to be an artifact of per-module log levels, a feature is not a part of 1.3.0) instead of couch_log:warn_on/0.

      1. resolve-log_warn-undef.patch
        0.7 kB
        Christopher Bonhage

        Activity

        Hide
        Christopher Bonhage added a comment -

        I have attached a patch which resolves this issue.

        This bug appears to have originated from commit 19c82720d339e2e91614096fa066f190d53ae426 back on January 26, 2013.

        Show
        Christopher Bonhage added a comment - I have attached a patch which resolves this issue. This bug appears to have originated from commit 19c82720d339e2e91614096fa066f190d53ae426 back on January 26, 2013.
        Hide
        Randall Leeds added a comment -

        Thanks!

        Also corrected the NEWS entry that incorrectly states the per-module logging feature was added in 1.3.0.

        To https://git-wip-us.apache.org/repos/asf/couchdb.git
        869f42e..7308432 1.3.x -> 1.3.x
        cc7482e..94b402d master -> master

        Show
        Randall Leeds added a comment - Thanks! Also corrected the NEWS entry that incorrectly states the per-module logging feature was added in 1.3.0. To https://git-wip-us.apache.org/repos/asf/couchdb.git 869f42e..7308432 1.3.x -> 1.3.x cc7482e..94b402d master -> master

          People

          • Assignee:
            Unassigned
            Reporter:
            Christopher Bonhage
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development