-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
Upgrade to CouchDb 3.4.x #9303
Comments
Added to 4.14 to at least investigate it. We need to test for performance improvements and regressions, particularly when querying the changes feed with over 1,000 doc IDs. Use this issue as the MVP upgrade - we can look at turning on the optional new features later. |
Related: CHT Core is looking to bifurcate online and offline search which will leverage features in the latest version of couch. We're currently on couch |
I've done a round of tests on upgrading CouchDB to version 3.4.2 on CHT.
{
"dbname": "medic",
"index": {
"ddoc": null,
"name": "_all_docs",
"type": "special",
"def": {
"fields": [
{
"_id": "asc"
}
]
}
},
"partitioned": "undefined",
"selector": {
"type": {
"$eq": "person"
}
},
"opts": {
"use_index": [],
"bookmark": "nil",
"limit": 25,
"skip": 0,
"sort": {},
"fields": "all_fields",
"partition": "",
"r": [
49
],
"conflicts": false,
"stale": false,
"update": true,
"stable": false,
"execution_stats": false
},
"limit": 25,
"skip": 0,
"fields": "all_fields",
"mrargs": {
"include_docs": true,
"view_type": "map",
"reduce": false,
"partition": null,
"start_key": null,
"end_key": "<MAX>",
"direction": "fwd",
"stable": false,
"update": true,
"conflicts": "undefined"
}
} b. {
"dbname": "medic",
"index": {
"ddoc": null,
"name": "_all_docs",
"type": "special",
"def": {
"fields": [
{
"_id": "asc"
}
]
}
},
"partitioned": false,
"selector": {
"type": {
"$eq": "person"
}
},
"opts": {
"use_index": [],
"bookmark": "nil",
"limit": 25,
"skip": 0,
"sort": {},
"fields": [],
"partition": "",
"r": 1,
"conflicts": false,
"stale": false,
"update": true,
"stable": false,
"execution_stats": false
},
"limit": 25,
"skip": 0,
"fields": [],
"index_candidates": [],
"selector_hints": [
{
"type": "json",
"indexable_fields": [
"type"
],
"unindexable_fields": []
}
],
"mrargs": {
"include_docs": true,
"view_type": "map",
"reduce": false,
"partition": null,
"start_key": null,
"end_key": "<MAX>",
"direction": "fwd",
"stable": false,
"update": true,
"conflicts": "undefined"
},
"covering": false
} TODO: performance tests |
@sugat009 |
Seconding Hareet's suggestion to test pre-couch 3.x upgrades. Since Core 4.4 added Couch 3.x, maybe try Core 4.2 -> Core branch @ ~master with couch 3.4.x? |
@Hareet @mrjones-plip yes, we should try that if it's one of the production cases. |
Did an upgrade test from an instance in CHT version 4.13 with CouchDB version 3.3.3 to CouchDB 3.4.2 with 250K docs in the Next is clustered upgrade test |
Moved to 4.15.0 so as not to hold up the release. |
The upgrade test from a CHT instance with version 4.13 and clustered CouchDB version 3.3.3 to 3.4.2 was successful without any document loss. The test procedure is the same as above for a single-node CouchDB. Next: Performance tests |
Performance tests for purging and replication have been done.
The timing metrics are as follows.
The metrics obtained for v3.3.3 VS v3.4.2 have a major difference in the purging time. Should we perform another test to confirm the validity of these timing measurements? |
I'm seriously worried about two metrics here:
I think we should at least re-run the tests and check if we get comparable times. And if yes, it's possible we might need to re-evaluate what happens for both these actions. |
After checking the logs of Sentinel and Couch, I'm guessing the major bottleneck for this is the batch size of the purge documents. The batch size was seen to be decreased from 1000 to a minimum of 15. From there on the processing, is normal but slow. I've deleted the purge DBs and rerun the purge to check if this was not a one-time thing. |
yea, that was my suspicion, that we need to rework purging to hit different endpoints that are more efficient now. |
I've created an issue for this: #9642 |
@dianabarsan - OK to make #9642 a sub-issue of this ticket? I think we don't want to release the couch v3.4.2 upgrade without using new endpoints and sub-issues are a nice new feature of GH that we can leverage to show the dependencies! no biggie |
Added it as a sub issue |
The second run of purging in deployment with CouchDB version 3.4.2 has been completed. The metrics and logs are similar.
|
Moving it to 4.16 to not block 4.15 |
Update: |
Yes, good news is that we don't need to make any code changes to have quick purging, we just need to adjust the changes optimization counter, so minimal effort required here. |
I think we should just merge this as-is, with the adjustment so we don't take a performance hit for purging. |
+1 from me. If I understand correctly the perf numbers are all approximately the same, right? If so, then it makes sense to get this first step merged sooner rather than later. |
@sugat009 what do you think? |
Yes, the numbers seem alright to do the upgrade. However, we planned on doing a quick upgrade test from older active versions like the one Hareet mentioned above to 3.4.2. We could continue with the upgrade after that. |
We have an e2e test that covers an upgrade from 4.2.2 to current branch. |
In that case, I think we can move ahead with the upgrade. |
I've just merged the commit that upgrades couch to v 3.4.2 and bumps the changes optimization threshold. |
What feature do you want to improve?
CouchDb 3.4.0 will be released soon.
It includes some changes that could improve things for the CHT significantly such as:
Full release notes: https://docs.couchdb.org/en/latest/whatsnew/3.4.html
Describe the improvement you'd like
Upgrade CHT to use CouchDb 3.4.0
The text was updated successfully, but these errors were encountered: