dmwm / WMCore

Core workflow management components for CMS.
Apache License 2.0
46 stars 107 forks source link

CouchDB list/show functions will be removed in CouchDB 4.x #11453

Open amaltaro opened 1 year ago

amaltaro commented 1 year ago

Impact of the new feature WMCore in general

Is your feature request related to a problem? Please describe. As described in the CouchDB documentation: https://docs.couchdb.org/en/stable/ddocs/ddocs.html#list-functions

List and Show functions have already been deprecated in CouchDB 3.x and they will be completely removed in CouchDB 4.x

Describe the solution you'd like After discussing with CouchDB experts over Slack, we seem to have a few alternatives for that:

  1. make this processing on the client side. However, that means we would have to fetch include_docs=true, then process them in the client side. Using skip+limit parameters is discouraged for larger values though, as it is inefficient.
  2. adopt a (likely complex) selector that matches only what we want. Appropriate indexes would have to be created to make it efficient.
  3. another suggestion was to evaluate the _find API

Describe alternatives you've considered See above

Additional context Lists are still functional in CouchDB 3.x, even though they are already considered deprecated.

todor-ivanov commented 1 year ago

Thanks for starting this investigation @amaltaro. I have two questions here:

amaltaro commented 1 year ago

I didn't check the overall impact, but I am certain that it won't be a matter of a couple of days development. One use case is already known: acquiring work from global workqueue.

As long as we are in CouchDB 3.x, we can keep using it. Hopefully not for another 5 years after it's ended-of-life :-D

amaltaro commented 3 months ago

Quick update on this ticket, they have been deprecated in CouchDB 3.x, so we better start considering this development sooner than later.

One utilization example for this involves work acquisition between agent and global workqueue, example:

[notice] xxx GET /workqueue/_design/WorkQueue/_list/workRestrictions/availableByPriority?include_docs=true&descending=true&resources=%7B%22T2_CH_CERN_P5%22%3A+11379.0%2C+...+%22T2_HU_Budapest%22%3A+562.5%2C+%22T2_IT_Bari%22%3A+1905.0%7D&limit=2500&num_elem=2500&team=%22relval%22&skip=15000 200 ok 12872