We sometimes encounter situations such as T198156: Server-side deletion of User:LorenzoMilano/sandbox that could be solved, according to @jcrespo and @Marostegui if deletions happened in batches of revisions. It'd also help reduce or suppress db lag once the deletion is complete. Thank you.
Batches implies multiple transactions and wait for slaves- which breaks the ability to quickly revert. This means that atomicity would have to be implemented on application side, or change the model of deletion completely, as suggested on T20493.
When attempting to delete or undelete a page with many revisions, the operation fails with an exception of type "Wikimedia\Rdbms\DBTransactionSizeError".