diff options
author | Tor Egge <Tor.Egge@broadpark.no> | 2018-08-04 15:24:56 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@broadpark.no> | 2018-08-04 15:26:48 +0200 |
commit | 458ef496df6c381f33f71fe589efb44335fbb9f6 (patch) | |
tree | d389c172b15f0eb538d6a95d7cd29a615235d34f /searchcore | |
parent | 9f083505f92ce020de31648fb6df69fb7a7911c8 (diff) |
Sync index dirs before marking index dir valid.
Sync config save dir before marking config save valid.
Diffstat (limited to 'searchcore')
4 files changed, 7 insertions, 0 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attributedisklayout.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attributedisklayout.cpp index bb2f99d077b..a675927b85f 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/attributedisklayout.cpp +++ b/searchcore/src/vespa/searchcore/proton/attribute/attributedisklayout.cpp @@ -14,6 +14,7 @@ AttributeDiskLayout::AttributeDiskLayout(const vespalib::string &baseDir, Privat _dirs() { vespalib::mkdir(_baseDir, false); + vespalib::File::sync(vespalib::dirname(_baseDir)); } AttributeDiskLayout::~AttributeDiskLayout() diff --git a/searchcore/src/vespa/searchcore/proton/index/index_manager_initializer.cpp b/searchcore/src/vespa/searchcore/proton/index/index_manager_initializer.cpp index b8f2947c9b4..ad233a66d1f 100644 --- a/searchcore/src/vespa/searchcore/proton/index/index_manager_initializer.cpp +++ b/searchcore/src/vespa/searchcore/proton/index/index_manager_initializer.cpp @@ -45,6 +45,7 @@ IndexManagerInitializer::run() LOG(debug, "About to create proton::IndexManager with %u index field(s)", _schema.getNumIndexFields()); vespalib::mkdir(_baseDir, false); + vespalib::File::sync(vespalib::dirname(_baseDir)); *_indexManager = std::make_shared<proton::IndexManager> (_baseDir, _warmupCfg, diff --git a/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp b/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp index 76f2ffce93a..72f48df3295 100644 --- a/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp @@ -229,6 +229,7 @@ FileConfigManager::FileConfigManager(const vespalib::string &baseDir, _protonConfig() { vespalib::mkdir(baseDir, false); + vespalib::File::sync(vespalib::dirname(baseDir)); if (!_info.load()) _info.save(); removeInvalid(); @@ -297,6 +298,8 @@ FileConfigManager::saveConfig(const DocumentDBConfig &snapshot, bool saveHistorySchemaRes = historySchema.saveToFile(snapDir + "/historyschema.txt"); assert(saveHistorySchemaRes); (void) saveHistorySchemaRes; + vespalib::File::sync(snapDir); + vespalib::File::sync(_baseDir); _info.validateSnapshot(serialNum); @@ -402,6 +405,7 @@ FileConfigManager::removeInvalid() LOG(warning, "Removing obsolete config directory '%s' failed due to %s", snapDir.c_str(), e.what()); } } + vespalib::File::sync(_baseDir); for (const auto &serial : toRem) { _info.removeSnapshot(serial); } diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp index ad06525a5a3..2d3c204d259 100644 --- a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp @@ -139,6 +139,7 @@ StoreOnlyDocSubDB::StoreOnlyDocSubDB(const Config &cfg, const Context &ctx) _gidToLidChangeHandler(std::make_shared<DummyGidToLidChangeHandler>()) { vespalib::mkdir(_baseDir, false); // Assume parent is created. + vespalib::File::sync(vespalib::dirname(_baseDir)); } StoreOnlyDocSubDB::~StoreOnlyDocSubDB() |