What's the "precommitted" concept/machanism in lvm2 code?

I asked:app

I see the word "precommitted" appears quite often in the code - metadata read/write path. can you please help me understand the machinism behind it?ui

Agk:code

It's a name we used. There are two version of metadata when you change it: the old metadata and the new one. Both are on disk, then we flip a pointer to commit. "precommit" = before commit, so that's the metadata before the pointer has been flipped.ip

The old metadata is on disk, then the new metadata is written after it, and then flip the pointer to the new one. You will see it if you just look at -vvv how it writes first to all disks, then commit to them all. Commit = flip pointer.get

Kabi:it

write : suspend : commit : resume
suspend is the only one that see both - commited & precommited (new)io

Agk:table

keep as little as possible between suspend and resume
have a single commit point that everything respects = any of the metadata areas gets its pointer flipped on disk. first pointer flip on disk is the commit.sed

suspend pokes the new metadata into the kernel but doesn't make it live. if the commit fails, then the resume reverts to the previous metadata.meta

Kabi:

notable thing - we can handle 'reasonably' well failure in write & suspend. and it's quite hard and nearly impossible to handle failures on resume. thus resume should mostly never fail.....

相關文章
相關標籤/搜索