hi there,

disclaimer: i haven't followed all turns and details on this task so sorry if my comments are outdated (or generally uninteresting).

---

i've been glancing on the review comments on the parallel applying, and have some comments to make.

i think it will be well invested time to add infrastructure to be able to restrict when parallel applying will be performed.

typically i think it would be nice to
- only allow parallel transaction in same engine
- decrease parallelism when performing DDL
...(more of these can probably be added)

restrictions that will make it easier to reason about correctness and that will not affect performance
for 99% of the cases (i think :-)

if adding such restrictions was an option, the resolving review comments on weird corner cases would be much easier.

---

from what I can tell, there are currently no such restrictions,
and no infrastructure to add them either.

i realize that it might not be trivial to introduce such restrictions,
but personally i think it will be worth the effort to get a solid solution in place.

<quick thoughts on implementation>
for row-based replication this seems quite "easy".

for statement-based replication i image that you would have to add hooks into the "real" code
after parsing has been performed, but before the actual execution is started (and yes, i know that there is sometimes a blurry line here)
</thoughts>

---

/Jonas