nickva opened a new pull request, #5347: URL: https://github.com/apache/couchdb/pull/5347
Previously, we included attachment sizes in the active size totals even if they attachments were deleted from the doc revision leafs. The fix is, unsurprisingly, to do what the compactor does when it copies and updates sizes: only update sizes for leaf revision during the rev-tree traversal. We did this for doc bodies already in #4264, but forgot to consider attachments then. In general we're aiming for the active size to approximate the size of the file after compaction. That is what drives smoosh (autocompaction) priority. If we don't remove non-leaf attachments from the calculation, the active/file ratio in smoosh may never trigger properly as ratio will stay low for shards with large attachments. Until a release goes out with this fix, a workaround could be to compact shards with large attachments by hand, or use a lower threshold on `slack_dbs` channel (and concurrency=1 to keep it in the background) to slowly cycle through all the shards and try to compact them. While the fix itself is small, to convince ourselves we did the right thing update the tests to check a few corner cases. Interestingly enough we had a disabled Elixir compaction test which we disabled because it was "mysteriously" not reporting a lower "active" size after compacting. So re-enable it and also improve it a bit to have both a attachment that gets deleted and one that stays live. Fix #5346 -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
