Commit the compacted index before returning it.
Failing to compact here could cause errors trying to resume a compaction
due to timeouts while searching for a header.
See COUCHDB-994
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1174984 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/couch_index_compactor.erl b/src/couch_index_compactor.erl
index b8b1ecc..72bff51 100644
--- a/src/couch_index_compactor.erl
+++ b/src/couch_index_compactor.erl
@@ -103,6 +103,7 @@
{ok, NewIdxState} = couch_util:with_db(DbName, fun(Db) ->
Mod:compact(Db, IdxState, Opts)
end),
+ ok = Mod:commit(NewIdxState),
case gen_server:call(Idx, {compacted, NewIdxState}) of
recompact ->
?LOG_INFO("Compaction restarting for db: ~s idx: ~s", Args),