I have a fairly good grasp on when and where using SingleWrite can be advantageous as a log algorithm in MQ. It benefits high throughput, low concurrency workloads. When the wor
Very roughly speaking its something like the following (Remember the issue is only ever about partial pages which are less and less likely as you move up releases of MQ - that's why the benefit of single write is very minimal mostly)
Imagine MQ wrote 10 bytes into a page, so has lots of space left in the log page (which are fixed sizes). When MQ then wants to write more bytes (either the rest of the page now the logger has moved on, or potentially (less likely) a small amount more data), it cant just write over that page as the disk may crash mid write and would potentially corrupt what was already needed to preserve to maintain integrity (the first 10 bytes). Hence the 2nd write (with more data) occurs elsewhere and is followed by a 3rd write which goes over the original page. Because it always know which writes were successful, it knows whether the original page or the 'elsewhere' page should be used during the recovery step.