On Wed, 1 Jul 2020 05:53:58 -0700 (PDT), Niall Douglas <
nialldo...@gmail.com> wrote:
>On Tuesday, June 30, 2020 at 10:26:19 PM UTC+1, steve wrote:
>>
>>
>> I'm working on crash consistency for my hash table. I've gotten it to the
>> point where I can kill the process either with Task Manager or by hitting
>> Ctrl-C and then when I start the program again, it takes up where it left
>> off without losing anything.
>>
>
>That's sudden exit consistency. That can be made quite fast.
Actually it slows down my program by about a factor of 10 compared to the version without consistency protection at all, but the performance is still
pretty good.
>> But when I actually turn off the power to the machine at the power strip
>> it's plugged into, the data is messed up when I restart.
>>
>> Is there a way to simulate a power failure so I can relatively easily
>> reproduce this issue? Ideally I'd like a tool that would let me say "kill
>> this
>> process at this point as though there were a power failure". Does such a
>> tool exist, and if not, is there anything else that might help with this
>> issue?
>>
>> The way I do it is to start 16 KVMs in parallel to run the test program,
>then kill -9 those KVMs after each a random period of time, then loop that
>whole thing for 24 hours.
>
>That's *still* not sudden power loss safety mind you. When you force kill a
>VM, the host OS still ensures whatever the VM wrote reaches storage.
>
>If you really want to do it properly, you need a few dozen Raspberry Pis,
>each with their power connected to a software controller switch. You boot
>them, run your test program, randomly kill power, loop for 24 hours. Be
>aware that if you do do this properly, you'll be finding sudden power loss
>bugs in all sorts of places.
Raspberry Pis can use Optane DC PM? Wow!
>Me personally, I'd take it to VM sudden death consistency, advertise that,
>call it a day. Most folk nowadays run everything inside Docker or whatever
>anyway, so they only care about VM consistency. They assume that if the
>host ever panics or dies, you need to reset the entire system from the
>cloud.
How do you define "VM sudden death consistency"? Is that when you force kill a VM as mentioned above?
>Niall
------------
Steve Heller