You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/07/14 16:04:03 UTC

[GitHub] [couchdb] davisp commented on a change in pull request #3003: add active_tasks for view builds using version stamps

davisp commented on a change in pull request #3003:
URL: https://github.com/apache/couchdb/pull/3003#discussion_r454468373



##########
File path: src/couch_views/src/couch_views_indexer.erl
##########
@@ -231,10 +231,24 @@ maybe_set_build_status(TxDb, Mrst1, _ViewVS, State) ->
 get_update_start_state(TxDb, Mrst, #{db_seq := undefined} = State) ->
     ViewVS = couch_views_fdb:get_creation_vs(TxDb, Mrst),
     ViewSeq = couch_views_fdb:get_update_seq(TxDb, Mrst),
+    DbSeq = fabric2_db:get_update_seq(TxDb),
+    DbVS = fabric2_fdb:seq_to_vs(DbSeq),
+    ViewVS1 = convert_version_stamp(ViewVS),
+    DbVS1 = convert_version_stamp(DbVS),
+
+    couch_task_status:add_task([
+        {type, indexer},
+        {database, Mrst#mrst.db_name},
+        {design_document, Mrst#mrst.idx_name},
+        {changes_done, 0},

Review comment:
       Historically, `changes_done` refers to how many changes have been processed by this view update. It's for judging how much work is left before the view is up to date. One way to think of this would be if you had a 10,000,000 docs processed for a view, and then went to process another 1,000,000 docs to bring the view up to date, you wouldn't want to start at 99% finished as that'd be misleading to operators.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org