Problem/Motivation
At the moment, the CommentStatistics service creates statistics entries (for all its existing comment fields) at the moment an entity is created, when there are no comments yet. Supposedly this is needed to report full statistics more easily.
If we want to be consistent, statistics should also be created for all existing entities when a new comment field is added to an entity bundle that holds existing entities.
However, the process of creating those statistics could take a long time. (And given the current definition of CommentStatisticsInterface::create(), we need to load full entities in order to do create entity statistics.) So this is best done in a 'batchable/queue' way.
Remaining tasks
Do this after #89181: Use queue API for node and comment, user, node multiple deletes / #355926: Add comment_mass_update() gets resolved.
Comments
Comment #1
roderikFound another issue...
Comment #8
geek-merlin> If we want to be consistent, statistics should also be created for all existing entities
As they are essentially denormalized "last comment" information, this is imho not a convincing reason. Any reasons i did not grok?