From commits-return-32288-archive-asf-public=cust-asf.ponee.io@couchdb.apache.org Wed Feb 28 23:12:45 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 4019218066D for ; Wed, 28 Feb 2018 23:12:45 +0100 (CET) Received: (qmail 73776 invoked by uid 500); 28 Feb 2018 22:12:44 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 73654 invoked by uid 99); 28 Feb 2018 22:12:44 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Feb 2018 22:12:44 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id B19E28265F; Wed, 28 Feb 2018 22:12:43 +0000 (UTC) Date: Wed, 28 Feb 2018 22:12:44 +0000 To: "commits@couchdb.apache.org" Subject: [couchdb] 01/01: TMP - Now with more debug! MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: davisp@apache.org In-Reply-To: <151985596357.3960.16692959130993233156@gitbox.apache.org> References: <151985596357.3960.16692959130993233156@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: couchdb X-Git-Refname: refs/heads/jenkins-debug-compaction-daemon X-Git-Reftype: branch X-Git-Rev: dadfd203c456a7cd9081335ecfbb8b79d5f3c1d1 X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20180228221243.B19E28265F@gitbox.apache.org> This is an automated email from the ASF dual-hosted git repository. davisp pushed a commit to branch jenkins-debug-compaction-daemon in repository https://gitbox.apache.org/repos/asf/couchdb.git commit dadfd203c456a7cd9081335ecfbb8b79d5f3c1d1 Author: Paul J. Davis AuthorDate: Wed Feb 28 12:10:53 2018 -0600 TMP - Now with more debug! --- Jenkinsfile | 11 +++++++++++ src/couch/src/couch_bt_engine.erl | 2 ++ src/couch/src/couch_bt_engine_compactor.erl | 3 +++ src/couch/test/couchdb_compaction_daemon_tests.erl | 9 +++++++++ 4 files changed, 25 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 221e96f..c754f73 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -96,6 +96,7 @@ pipeline { cd apache-couchdb-* ./configure --with-curl make all + make eunit apps=couch suites=couchdb_compaction_daemon_tests || (build-aux/logfile-uploader.py && false) make check || (build-aux/logfile-uploader.py && false) # Build CouchDB packages @@ -136,6 +137,7 @@ pipeline { cd apache-couchdb-* ./configure --with-curl make all + make eunit apps=couch suites=couchdb_compaction_daemon_tests || (build-aux/logfile-uploader.py && false) make check || (build-aux/logfile-uploader.py && false) ''' } // withDocker @@ -161,6 +163,7 @@ pipeline { cd apache-couchdb-* ./configure --with-curl make all + make eunit apps=couch suites=couchdb_compaction_daemon_tests || (build-aux/logfile-uploader.py && false) make check || (build-aux/logfile-uploader.py && false) # Build CouchDB packages @@ -199,6 +202,7 @@ pipeline { cd apache-couchdb-* ./configure --with-curl make all + make eunit apps=couch suites=couchdb_compaction_daemon_tests || (build-aux/logfile-uploader.py && false) make check || (build-aux/logfile-uploader.py && false) ''' } // withDocker @@ -224,6 +228,7 @@ pipeline { cd apache-couchdb-* ./configure --with-curl make all + make eunit apps=couch suites=couchdb_compaction_daemon_tests || (build-aux/logfile-uploader.py && false) make check || (build-aux/logfile-uploader.py && false) # Build CouchDB packages @@ -262,6 +267,7 @@ pipeline { cd apache-couchdb-* ./configure --with-curl make all + make eunit apps=couch suites=couchdb_compaction_daemon_tests || (build-aux/logfile-uploader.py && false) make check || (build-aux/logfile-uploader.py && false) ''' } // withDocker @@ -287,6 +293,7 @@ pipeline { cd apache-couchdb-* ./configure --with-curl make all + make eunit apps=couch suites=couchdb_compaction_daemon_tests || (build-aux/logfile-uploader.py && false) make check || (build-aux/logfile-uploader.py && false) # Build CouchDB packages @@ -325,6 +332,7 @@ pipeline { cd apache-couchdb-* ./configure --with-curl make all + make eunit apps=couch suites=couchdb_compaction_daemon_tests || (build-aux/logfile-uploader.py && false) make check || (build-aux/logfile-uploader.py && false) ''' } // withDocker @@ -350,6 +358,7 @@ pipeline { cd apache-couchdb-* ./configure --with-curl make all + make eunit apps=couch suites=couchdb_compaction_daemon_tests || (build-aux/logfile-uploader.py && false) make check || (build-aux/logfile-uploader.py && false) # Build CouchDB packages @@ -388,6 +397,7 @@ pipeline { cd apache-couchdb-* ./configure --with-curl make all + make eunit apps=couch suites=couchdb_compaction_daemon_tests || (build-aux/logfile-uploader.py && false) make check || (build-aux/logfile-uploader.py && false) ''' } // withDocker @@ -413,6 +423,7 @@ pipeline { cd apache-couchdb-* ./configure --with-curl make all + make eunit apps=couch suites=couchdb_compaction_daemon_tests || (build-aux/logfile-uploader.py && false) make check || (build-aux/logfile-uploader.py && false) # Build CouchDB packages diff --git a/src/couch/src/couch_bt_engine.erl b/src/couch/src/couch_bt_engine.erl index 347c931..bf6b26b 100644 --- a/src/couch/src/couch_bt_engine.erl +++ b/src/couch/src/couch_bt_engine.erl @@ -498,8 +498,10 @@ finish_compaction(OldState, DbName, Options, CompactFilePath) -> NewSeq = get_update_seq(NewState1), case OldSeq == NewSeq of true -> + io:format(standard_error, "XKCD: Finishing compaction for: ~s", [DbName]), finish_compaction_int(OldState, NewState1); false -> + io:format(standard_error, "XKCD: Retrying compaction for: ~s", [DbName]), couch_log:info("Compaction file still behind main file " "(update seq=~p. compact update seq=~p). Retrying.", [OldSeq, NewSeq]), diff --git a/src/couch/src/couch_bt_engine_compactor.erl b/src/couch/src/couch_bt_engine_compactor.erl index 2f7a351..f3da52f 100644 --- a/src/couch/src/couch_bt_engine_compactor.erl +++ b/src/couch/src/couch_bt_engine_compactor.erl @@ -44,6 +44,8 @@ start(#st{} = St, DbName, Options, Parent) -> } = St, couch_log:debug("Compaction process spawned for db \"~s\"", [DbName]), + io:format(standard_error, "XKCD: Starting compaction for: ~s~n", [DbName]), + {ok, NewSt, DName, DFd, MFd, Retry} = open_compaction_files(Header, FilePath, Options), erlang:monitor(process, MFd), @@ -192,6 +194,7 @@ copy_compact(DbName, St, NewSt0, Retry) -> copy_docs(St, #st{} = NewSt, MixedInfos, Retry) -> + io:format(standard_error, "XKCD: Copying ~b docs~n", [length(MixedInfos)]), DocInfoIds = [Id || #doc_info{id=Id} <- MixedInfos], LookupResults = couch_btree:lookup(St#st.id_tree, DocInfoIds), % COUCHDB-968, make sure we prune duplicates during compaction diff --git a/src/couch/test/couchdb_compaction_daemon_tests.erl b/src/couch/test/couchdb_compaction_daemon_tests.erl index 47f35a0..6b613f5 100644 --- a/src/couch/test/couchdb_compaction_daemon_tests.erl +++ b/src/couch/test/couchdb_compaction_daemon_tests.erl @@ -21,6 +21,10 @@ [couch_db_updater, couch_mrview_compactor, couch_compaction_daemon]). +log(Fmt, Args) -> + io:format(standard_error, Fmt, Args). + + start() -> Ctx = test_util:start_couch(), ok = config:set("compaction_daemon", "check_interval", "3", false), @@ -73,6 +77,8 @@ compaction_daemon_test_() -> should_compact_by_default_rule(DbName) -> {timeout, ?TIMEOUT_S, ?_test(begin + log("XKCD: I AM TEST!~n", []), + CompactionMonitor = spawn_compaction_monitor(DbName), {_, DbFileSize} = get_db_frag(DbName), @@ -93,6 +99,8 @@ should_compact_by_default_rule(DbName) -> {DbFrag2, DbFileSize2} = get_db_frag(DbName), {ViewFrag2, ViewFileSize2} = get_view_frag(DbName), + log("~nXKCD: ~p ~p ~p~n", [DbFileSize, DbFileSize2, DbFrag2]), + ?assert(DbFrag2 < 70), ?assert(ViewFrag2 < 70), @@ -195,6 +203,7 @@ get_db_frag(DbName) -> couch_db:close(Db), FileSize = get_size(file, Info), DataSize = get_size(active, Info), + log("~nXKCD: ~p ~p ~w~n", [FileSize, DataSize, Info]), {round((FileSize - DataSize) / FileSize * 100), FileSize}. get_view_frag(DbName) -> -- To stop receiving notification emails like this one, please contact davisp@apache.org.