pmem / pmdk-convert

Conversion tool for pmdk pools
Other
1 stars 19 forks source link

Pointless flushing #55

Open kilobyte opened 5 years ago

kilobyte commented 5 years ago

There are big warnings that -convert is not crash-safe: the user has to back up the data beforehand, and restore it in case of power loss during conversion (and obviously, having no backups before upgrading violates the First Rule of Sysadmin, but that's the user's fault).

This raises the question: why do we flush the data at all? If power loss destroys data, any flush loses speed for no gain — and flushes make the conversion drastically slower. A simple test case takes more than a day when backed by a SSD — and even on real pmem, there's a large loss of speed. This actually decreases data safety: conversion that takes longer has faces a bigger risk of getting interrupted by power loss.

Thus, pmdk-convert shouldn't flush at all. Not even on real pmem.

kilobyte commented 5 years ago

There's one possible problem: without flushing, -convert will happily report that the work is done, while some data is still in the cache. The user starts real work. A power loss comes, corrupting whatever remains unflushed.

Some sort of a global flush would be enough here.