Is node_access_rebuild() really needed with every deployment?
Hi,
we have a specific project with more than 125.000 nodes and realized that deployment always fails because of this line: https://gitlab.lakedrops.com/gitlab-ci-cd/drupal/-/blob/main/test-and-deploy.yml#L622
researching it further (on the local machine) I have realized that node_access_rebuild()
needs ~45 minutes to be completed in this case.
I also see the node_access_needs_rebuild()
method, and in our case, it returns false, so it looks like rebuilding is not needed.
node_access_rebuild()
doesn't take into account node_access_needs_rebuild()
directly, so basically it will be executed every time, even if successfully done a few minutes ago.
Is this really needed on every deployment?
As another option, we can make it configurable, so with the possibility to be disabled.
Also, we can make it (at least we can try) in Drupal core that node_access_rebuild()
is only processed when needed. But still, we can expect long deployments (or timeouts) on websites with large volumes of nodes.
What do you think?
Thank you