When the controller's battery-backed write cache is disabled, but the drive's write caches are enabled, will the controller pass on the flush commands from the OS to the drives (all physical drives in RAID0 or RAID1 virtual drives)?
The reason I ask is that the performance is much better with the drive caches enabled. It's even much better than with drive caches off and controller's cache on. If it is able to flush the caches on demand, then there shouldn't (in theory) be any filesystem corruption on power loss, with modern OSes and filesystems. [I realise there's a real risk of bugs, but power cuts are extremely rare where I am, so it may be worth the risk if it at least works on paper.]
If the answer is that it depends on the controller: I'm using MegaRaid 9280. Single disk RAID0s. Or is there any way to test this reliably?
I did a performance test with fio, and told the OS to use sync I/O.
With RAID controller, physical drive cache = On:
With RAID controller, physical drive cache = Off:
In another Linux host with cache on, native SATA port:
Clearly, the odd one out is the RAID controller with drive cache on. So it seems to be ignoring the sync commands.
It's not a bullet-proof argument, but it seems unlikely that the RAID controller does the right thing, so I'll give up on that approach unless there's a better answer.