[cache_restore] The metadata version and clean shutdown flags were
swapped. Reveal by failing --omit-clean-shutdown test
This commit is contained in:
parent
61d747b246
commit
4da8d19f29
@ -60,8 +60,9 @@ namespace {
|
||||
try {
|
||||
block_manager<>::ptr bm = open_bm(*fs.output, block_manager<>::READ_WRITE);
|
||||
metadata::ptr md(new metadata(bm, metadata::CREATE));
|
||||
emitter::ptr restorer = create_restore_emitter(md, fs.clean_shutdown,
|
||||
fs.metadata_version);
|
||||
emitter::ptr restorer = create_restore_emitter(md,
|
||||
fs.metadata_version,
|
||||
fs.clean_shutdown ? CLEAN_SHUTDOWN : NO_CLEAN_SHUTDOWN);
|
||||
|
||||
check_file_exists(*fs.input);
|
||||
ifstream in(fs.input->c_str(), ifstream::in);
|
||||
|
@ -115,9 +115,9 @@ namespace {
|
||||
|
||||
emitter::ptr
|
||||
caching::create_restore_emitter(metadata::ptr md, unsigned metadata_version,
|
||||
bool clean_shutdown)
|
||||
shutdown_type st)
|
||||
{
|
||||
return emitter::ptr(new restorer(md, clean_shutdown, metadata_version));
|
||||
return emitter::ptr(new restorer(md, st == CLEAN_SHUTDOWN, metadata_version));
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
@ -7,9 +7,15 @@
|
||||
//----------------------------------------------------------------
|
||||
|
||||
namespace caching {
|
||||
|
||||
enum shutdown_type {
|
||||
CLEAN_SHUTDOWN,
|
||||
NO_CLEAN_SHUTDOWN
|
||||
};
|
||||
|
||||
emitter::ptr create_restore_emitter(metadata::ptr md,
|
||||
unsigned metadata_version,
|
||||
bool clean_shutdown = true);
|
||||
shutdown_type st = CLEAN_SHUTDOWN);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user