diff options
author | Harald Musum <musum@yahooinc.com> | 2021-10-14 11:52:36 +0200 |
---|---|---|
committer | Harald Musum <musum@yahooinc.com> | 2021-10-14 11:52:36 +0200 |
commit | ffe1453578849b7ed82fe2c00df1d895d4f0e584 (patch) | |
tree | 6add5b8c801329540b33de15682d886a584bc05a /configserver | |
parent | 5a3c92ad0a9b3bfb77c215f9b415bac8eed83e97 (diff) |
Improve download of application package in maintainer
Set downloadFromOtherSourceIfNotFound to false, so that the receiving config server
that gets the request don't try to download a file reference. This will be
done by the ApplicationPackageMaintainer on the other server anyway.
Diffstat (limited to 'configserver')
2 files changed, 6 insertions, 2 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/maintenance/ApplicationPackageMaintainer.java b/configserver/src/main/java/com/yahoo/vespa/config/server/maintenance/ApplicationPackageMaintainer.java index 5314f95a5b9..ee775fa7afb 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/maintenance/ApplicationPackageMaintainer.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/maintenance/ApplicationPackageMaintainer.java @@ -16,6 +16,7 @@ import com.yahoo.vespa.curator.Curator; import com.yahoo.vespa.defaults.Defaults; import com.yahoo.vespa.filedistribution.Downloads; import com.yahoo.vespa.filedistribution.FileDownloader; +import com.yahoo.vespa.filedistribution.FileReferenceDownload; import com.yahoo.vespa.flags.FlagSource; import java.io.File; @@ -74,7 +75,10 @@ public class ApplicationPackageMaintainer extends ConfigServerMaintainer { if (! fileReferenceExistsOnDisk(downloadDirectory, applicationPackage)) { log.fine(() -> "Downloading missing application package for application " + applicationId + " (session " + sessionId + ")"); - if (fileDownloader.getFile(applicationPackage).isEmpty()) { + FileReferenceDownload download = new FileReferenceDownload(applicationPackage, + false, + this.getClass().getSimpleName()); + if (fileDownloader.getFile(download).isEmpty()) { failures++; log.warning("Failed to download application package for application " + applicationId + " (session " + sessionId + ")"); continue; diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/filedistribution/FileServerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/filedistribution/FileServerTest.java index ec94b845546..1cb6b2a13cd 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/filedistribution/FileServerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/filedistribution/FileServerTest.java @@ -57,7 +57,7 @@ public class FileServerTest { public void requireThatNonExistingFileWillBeDownloaded() throws IOException { String dir = "123"; assertFalse(fileServer.hasFile(dir)); - FileReferenceDownload foo = new FileReferenceDownload(new FileReference(dir), true, "foo"); + FileReferenceDownload foo = new FileReferenceDownload(new FileReference(dir)); assertFalse(fileServer.hasFileDownloadIfNeeded(foo)); writeFile(dir); assertTrue(fileServer.hasFileDownloadIfNeeded(foo)); |