summaryrefslogtreecommitdiffstats
path: root/filedistribution
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-06-20 16:06:22 +0200
committerGitHub <noreply@github.com>2017-06-20 16:06:22 +0200
commit3b6d32eed794c8a5ddde3b5d8ead90813d0899cc (patch)
treeb5ce25b97d0c4e182868b3571bc241efa7780ef3 /filedistribution
parent52c57a784be4fc09ad57255829d61392cbda610d (diff)
parentdaf2937862b3fd3cbd3e1a0583a3bfb632669182 (diff)
Merge pull request #2835 from yahoo/hmusum/keep-files-from-more-deployments
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;