DoctrineExtensions icon indicating copy to clipboard operation
DoctrineExtensions copied to clipboard

SortableListener postRemove event crashes large DB if more entities were removed -- (ORM adapter)

Open forgie1 opened this issue 3 years ago • 3 comments

If there is DB with:

  • hundred of thousands of entities with positions e.g. 0, 1, 2, ..., 658541, -- all in one group
  • and e.g. 4.000 random entities are removed in one EM::flush()

then DB goes down in SortableListener postRemove event. ORM::updatePositions() was used. The crash was severe - tested on MariaDB 10.3 also 10.4. On Linux and Windows the same. DB was even not recoverable after this happen, DB had to be deleted and recreated.

Basically Sortable works also without relocations persisted on postRemove, but this (disabling the postRemove event in SortableListener) is not the best solution to the problem.

forgie1 avatar Oct 21 '21 08:10 forgie1

I rewrited the script, so only 80 deletitions is flushed at once. And this batches repeat. It didn't help :( With SortableListener postRemove event on DB crashed completely at the first 80 deletions trying to flush. With SortableListener postRemove event off DB managed the deletions smoothly.

forgie1 avatar Oct 21 '21 17:10 forgie1

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar May 05 '22 09:05 github-actions[bot]

closed but not solved :(

forgie1 avatar Jun 04 '22 10:06 forgie1