void test_after_tlog(bool failover) { const auto wrns(make_random_namespace()); SharedVolumePtr v = make_volume(*wrns); const std::string pattern1("Hairdresser On Fire"); { SCOPED_BLOCK_BACKEND(*v); writeToVolume(*v, v->getClusterMultiplier() * CachePage::capacity(), v->getClusterSize(), pattern1); } v->scheduleBackendSync(); waitForThisBackendWrite(*v); const std::string pattern2("Such A Little Thing Makes Such A Big Difference"); writeToVolume(*v, 2 * v->getClusterMultiplier() * CachePage::capacity(), v->getClusterSize(), pattern2); const auto ncfgs(node_configs()); if (failover) { mds_manager_->stop_one(ncfgs[0]); checkVolume(*v, 0, v->getClusterSize(), ""); } else { const std::vector<MDSNodeConfig> ncfgs2{ ncfgs[1], ncfgs[0] }; v->updateMetaDataBackendConfig(MDSMetaDataBackendConfig(ncfgs2, ApplyRelocationsToSlaves::T)); } check_config(*v, ncfgs, true); checkVolume(*v, v->getClusterMultiplier() * CachePage::capacity(), v->getClusterSize(), pattern1); checkVolume(*v, 2 * v->getClusterMultiplier() * CachePage::capacity(), v->getClusterSize(), pattern2); destroyVolume(v, DeleteLocalData::F, RemoveVolumeCompletely::F); v = localRestart(wrns->ns()); check_config(*v, ncfgs, true); checkVolume(*v, v->getClusterMultiplier() * CachePage::capacity(), v->getClusterSize(), pattern1); checkVolume(*v, 2 * v->getClusterMultiplier() * CachePage::capacity(), v->getClusterSize(), pattern2); }
void test_before_tlog(bool failover) { const auto wrns(make_random_namespace()); SharedVolumePtr v = make_volume(*wrns); const auto ncfgs(node_configs()); const std::string pattern("King Leer"); { SCOPED_BLOCK_BACKEND(*v); writeToVolume(*v, v->getClusterMultiplier() * CachePage::capacity(), v->getClusterSize(), pattern); if (failover) { mds_manager_->stop_one(ncfgs[0]); checkVolume(*v, 0, v->getClusterSize(), ""); } else { const std::vector<MDSNodeConfig> ncfgs2{ ncfgs[1], ncfgs[0] }; v->updateMetaDataBackendConfig(MDSMetaDataBackendConfig(ncfgs2, ApplyRelocationsToSlaves::T)); } check_config(*v, ncfgs, true); checkVolume(*v, v->getClusterMultiplier() * CachePage::capacity(), v->getClusterSize(), pattern); } destroyVolume(v, DeleteLocalData::F, RemoveVolumeCompletely::F); v = localRestart(wrns->ns()); check_config(*v, ncfgs, true); checkVolume(*v, v->getClusterMultiplier() * CachePage::capacity(), v->getClusterSize(), pattern); }