New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return detailed replication stats for running and pending jobs #2292
Conversation
Marking it as as draft pull request in order to start the discussion on the mailing list since it involves API changes |
Example of {
"total_rows": 1,
"offset": 0,
"docs": [
{
"database": "_replicator",
"doc_id": "2e5df7bf99f1a9d06feef6301300055f",
"id": "d99e532c1129e9cacbf7ed085deca509+continuous",
"node": "node1@127.0.0.1",
"source": "http://adm:*****@localhost:15984/src/",
"target": "http://adm:*****@localhost:15984/tgt/",
"state": "pending",
"info": {
"revisions_checked": 113,
"missing_revisions_found": 113,
"docs_read": 113,
"docs_written": 113,
"changes_pending": 0,
"doc_write_failures": 0,
"checkpointed_source_seq": "113-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE01ygQLsZsYGqcamiZjKcRqRxwIkGRqA1H-oSbZgk1KMLCzTDE0wdWUBAF6HJIQ",
"source_seq": "113-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE01ygQLsZsYGqcamiZjKcRqRxwIkGRqA1H-oSbZgk1KMLCzTDE0wdWUBAF6HJIQ",
"through_seq": "113-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE01ygQLsZsYGqcamiZjKcRqRxwIkGRqA1H-oSbZgk1KMLCzTDE0wdWUBAF6HJIQ"
},
"error_count": 0,
"last_updated": "2019-10-31T06:46:11Z",
"start_time": "2019-10-31T06:42:16Z",
"source_proxy": null,
"target_proxy": null
}
]
} |
Example of
|
d1f7a95
to
4ca8bb9
Compare
Vote passed on the mailing list: https://lists.apache.org/thread.html/799772bc092c473f06c16c97330ce8abe6912d5afd9ac431ef34e666@%3Cdev.couchdb.apache.org%3E Opening PR |
4ca8bb9
to
f31b504
Compare
Should we add your pending test you described as an actual test? |
Previously `_scheduled/docs` returned detailed replication statistics for completed jobs only. To get the same level of details from a running or pending jobs users had to use `_active_tasks`, which is not optimal and required jumping between monitoring endpoints. `info` field was originally meant to hold these statistics but they were not implemented and it just returned `null` as a placeholder. With work for 3.0 finalizing, this might be a good time to add this improvement to avoid disturbing the API afterwards. Just updating the `_scheduler/docs` was not quite enough since, replications started from the `_replicate` endpoint would not be visible there and users would still have to access `_active_tasks` to get inspect them, so let's add the `info` field to the `_scheduler/jobs` as well. After this update, all states and status details from `_active_tasks` and `_replicator` docs should be available under `_scheduler/jobs` and `_scheduler/docs` endpoints.
f31b504
to
c47c509
Compare
@davisp Good idea. Added the test. There was a test that already check active_tasks details were retained so modified to check that scheduler also has required fields both when it is running and pending. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Recently "info" field for running and pending states switched to having replication stats instead of being `null`, so update documentation accordingly. Related PR: apache/couchdb#2292
Recently "info" field for running and pending states switched to having replication stats instead of being `null`, so update documentation accordingly. Related PR: apache/couchdb#2292
Recently "info" field for running and pending states switched to having replication stats instead of being `null`, so update documentation accordingly. Related PR: apache/couchdb#2292
This mirrors the upstream CouchDB documentation: apache/couchdb-documentation@051acd9 And the new feature introduced in: apache/couchdb#2292
Recently "info" field for running and pending states switched to having replication stats instead of being `null`, so update documentation accordingly. Related PR: apache#2292
Overview
Previously
_scheduled/docs
returned detailed replication statistics forcompleted jobs only. To get the same level of details from a running or pending
jobs users had to use
_active_tasks
, which is not optimal and required jumpingbetween monitoring endpoints.
info
field was originally meant to hold these statistics but they were notimplemented and it just returned
null
as a placeholder. With work for 3.0finalizing, this might be a good time to add this improvement to avoid
disturbing the API afterwards.
Just updating the
_scheduler/docs
was not quite enough since, replicationsstarted from the
_replicate
endpoint would not be visible there and userswould still have to access
_active_tasks
to get inspect them, so let's addthe
info
field to the_scheduler/jobs
as well.After this update, all states and status details from
_active_tasks
and_replicator
docs should be available under_scheduler/jobs
and_scheduler/docs
endpoints.Testing recommendations
(edit: unit test added for the test below as well)
2. Create a few replications and monitor _scheduler/jobs and _scheduler/docs3. Make those jobs pending by lowering the max_jobs to 04. Inspect _scheduler/jobs and docs. Stats should still be showing even when the jobs are pending.5. Delete the max_jobs setting and wait for jobs to start running against. They should keep their stats and update them when new docs are replicated over.Related Issues or Pull Requests
Checklist