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 6a5de0d1f53353f86a6d6e32955db3d2e4294e69 Author: Paul J. Davis <[email protected]> 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..5390f9f 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 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 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 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 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 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 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 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 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 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 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 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 [email protected].
