You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "rnewson (via GitHub)" <gi...@apache.org> on 2026/03/24 11:53:32 UTC
[PR] fix view compaction duration logging [couchdb]
rnewson opened a new pull request, #5939:
URL: https://github.com/apache/couchdb/pull/5939
## Overview
This was wrong in the original PR (https://github.com/apache/couchdb/pull/5861) as it recorded the start time far too later (notably, _after_ compaction...). Move this up. I've made a large view locally and are getting higher numbers as it grows.
## Testing recommendations
Enable info level logging, build a large view, and then compact it, compare the timestamps of the start and end info level events with the duration on the notice level 'Compaction swap' event.
## Related Issues or Pull Requests
https://github.com/apache/couchdb/pull/5861)
## Checklist
- [x] This is my own work, I did not use AI, LLM's or similar technology
- [x] Code is written and works correctly
- [ ] Changes are covered by tests
- [ ] Any new configurable parameters are documented in `rel/overlay/etc/default.ini`
- [ ] Documentation changes were made in the `src/docs` folder
- [ ] Documentation changes were backported (separated PR) to affected branches
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix view compaction duration logging [couchdb]
Posted by "rnewson (via GitHub)" <gi...@apache.org>.
rnewson commented on code in PR #5939:
URL: https://github.com/apache/couchdb/pull/5939#discussion_r2982418569
##########
src/couch_mrview/src/couch_mrview_compactor.erl:
##########
@@ -48,7 +48,7 @@ compact(State) ->
{EmptyState, NumDocIds} = couch_util:with_db(DbName, fun(Db) ->
CompactFName = couch_mrview_util:compaction_file(DbName, Sig),
{ok, Fd} = couch_mrview_util:open_file(CompactFName),
- ESt = couch_mrview_util:reset_index(Db, Fd, State),
+ ESt = (couch_mrview_util:reset_index(Db, Fd, State))#mrst{start_time = now_secs()},
Review Comment:
I did initially have it as a separate line but then had to give the 'old' value a silly name like Est0. not creating that seemed tidier than this but I can switch it back if you like
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix view compaction duration logging [couchdb]
Posted by "nickva (via GitHub)" <gi...@apache.org>.
nickva commented on code in PR #5939:
URL: https://github.com/apache/couchdb/pull/5939#discussion_r2982390459
##########
src/couch_mrview/src/couch_mrview_compactor.erl:
##########
@@ -48,7 +48,7 @@ compact(State) ->
{EmptyState, NumDocIds} = couch_util:with_db(DbName, fun(Db) ->
CompactFName = couch_mrview_util:compaction_file(DbName, Sig),
{ok, Fd} = couch_mrview_util:open_file(CompactFName),
- ESt = couch_mrview_util:reset_index(Db, Fd, State),
+ ESt = (couch_mrview_util:reset_index(Db, Fd, State))#mrst{start_time = now_secs()},
Review Comment:
style nit: imho it might look a bit better to use a separate line or update `ESt#{start_time = now_sec())` a final result
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix view compaction duration logging [couchdb]
Posted by "rnewson (via GitHub)" <gi...@apache.org>.
rnewson merged PR #5939:
URL: https://github.com/apache/couchdb/pull/5939
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org