aboutsummaryrefslogtreecommitdiffstats
path: root/filedistribution
diff options
context:
space:
mode:
authorHarald Musum <musum@yahoo-inc.com>2017-06-20 09:35:38 +0200
committerHarald Musum <musum@yahoo-inc.com>2017-06-20 09:35:38 +0200
commitdaf2937862b3fd3cbd3e1a0583a3bfb632669182 (patch)
tree9bc776edb4918281f78de4337e2f9716524fba6a /filedistribution
parent5b6faca5f132a290b875c266daf7b19082708b44 (diff)
Keep files from one more deployment
Diffstat (limited to 'filedistribution')
-rw-r--r--filedistribution/src/vespa/filedistribution/manager/filedistributionmanager.cpp2
-rw-r--r--filedistribution/src/vespa/filedistribution/model/deployedfilestodownload.cpp4
-rw-r--r--filedistribution/src/vespa/filedistribution/model/deployedfilestodownload.h4
3 files changed, 5 insertions, 5 deletions
diff --git a/filedistribution/src/vespa/filedistribution/manager/filedistributionmanager.cpp b/filedistribution/src/vespa/filedistribution/manager/filedistributionmanager.cpp
index fecb100f626..f1c74e4a000 100644
--- a/filedistribution/src/vespa/filedistribution/manager/filedistributionmanager.cpp
+++ b/filedistribution/src/vespa/filedistribution/manager/filedistributionmanager.cpp
@@ -139,7 +139,7 @@ Java_com_yahoo_vespa_filedistribution_FileDistributionManager_addFileImpl(
}
if (freshlyAdded == hasRegisteredFile) {
std::cerr << "freshlyAdded(" << freshlyAdded << ") == hasRegisteredFile(" << hasRegisteredFile
- << "), which is very odd. File is '" << fileReference << std::endl;
+ << "), which is very odd. File is '" << fileReference << "'" << std::endl;
}
//contains string with the characters 0-9 a-f
diff --git a/filedistribution/src/vespa/filedistribution/model/deployedfilestodownload.cpp b/filedistribution/src/vespa/filedistribution/model/deployedfilestodownload.cpp
index 53f33a2d986..9443d256c92 100644
--- a/filedistribution/src/vespa/filedistribution/model/deployedfilestodownload.cpp
+++ b/filedistribution/src/vespa/filedistribution/model/deployedfilestodownload.cpp
@@ -63,10 +63,10 @@ DeployedFilesToDownload::groupChildrenByAppId(const Path & parentPath, const Str
void
DeployedFilesToDownload::deleteExpiredDeployNodes(Path parentPath, StringVector children)
{
- if (children.size() > numberOfDeploysToKeepFiles) {
+ if (children.size() > numberOfDeploymentsToKeepFilesFrom) {
std::sort(children.begin(), children.end());
- size_t numberOfNodesToDelete = children.size() - numberOfDeploysToKeepFiles;
+ size_t numberOfNodesToDelete = children.size() - numberOfDeploymentsToKeepFilesFrom;
std::for_each(children.begin(), children.begin() + numberOfNodesToDelete,
[&](const std::string & s) {_zk.remove(parentPath / s); });
}
diff --git a/filedistribution/src/vespa/filedistribution/model/deployedfilestodownload.h b/filedistribution/src/vespa/filedistribution/model/deployedfilestodownload.h
index 0936f6e55e1..98da1b3d386 100644
--- a/filedistribution/src/vespa/filedistribution/model/deployedfilestodownload.h
+++ b/filedistribution/src/vespa/filedistribution/model/deployedfilestodownload.h
@@ -9,8 +9,8 @@ namespace filedistribution {
const std::string readApplicationId(ZKFacade & zk, const Path & deployNode);
class DeployedFilesToDownload {
- //includes the current deploy run;
- static const size_t numberOfDeploysToKeepFiles = 2;
+ //includes the current deployment. Want at least 3 ('original' + 2, since there might be concurrent deployments, e.g both external and internal)
+ static const size_t numberOfDeploymentsToKeepFilesFrom = 3;
ZKFacade& _zk;