diff options
author | Harald Musum <musum@verizonmedia.com> | 2020-06-24 11:55:25 +0200 |
---|---|---|
committer | Harald Musum <musum@verizonmedia.com> | 2020-06-24 11:55:25 +0200 |
commit | 66302ab7fb3bd1047ceb73623a27308f7f1471df (patch) | |
tree | 3c127c10cb59585d4ee31743e0b83abdbb17a945 | |
parent | f34f8169989da5db18d43d2bbd3f6608df0a85c8 (diff) |
Remove config field, has not been used for years
3 files changed, 5 insertions, 14 deletions
diff --git a/configdefinitions/src/vespa/configserver.def b/configdefinitions/src/vespa/configserver.def index 88a637e3ecb..26051c7ff9d 100644 --- a/configdefinitions/src/vespa/configserver.def +++ b/configdefinitions/src/vespa/configserver.def @@ -63,7 +63,6 @@ sleepTimeWhenRedeployingFails long default=30 # Features (to be overridden in configserver-config.xml if needed) buildMinimalSetOfConfigModels bool default=true -throwIfBootstrappingTenantRepoFails bool default=true # Unused, remove in Vespa 8 throwIfActiveSessionCannotBeLoaded bool default=true diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java index 8ae6b1dae9d..61043608066 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java @@ -82,7 +82,6 @@ public class TenantRepository { private final ExecutorService bootstrapExecutor; private final ScheduledExecutorService checkForRemovedApplicationsService = new ScheduledThreadPoolExecutor(1); private final Optional<Curator.DirectoryCache> directoryCache; - private final boolean throwExceptionIfBootstrappingFails; /** * Creates a new tenant repository @@ -105,7 +104,6 @@ public class TenantRepository { this.componentRegistry = componentRegistry; ConfigserverConfig configserverConfig = componentRegistry.getConfigserverConfig(); this.bootstrapExecutor = Executors.newFixedThreadPool(configserverConfig.numParallelTenantLoaders()); - this.throwExceptionIfBootstrappingFails = configserverConfig.throwIfBootstrappingTenantRepoFails(); this.curator = componentRegistry.getCurator(); metricUpdater = componentRegistry.getMetrics().getOrCreateMetricUpdater(Collections.emptyMap()); this.tenantListeners.add(componentRegistry.getTenantListener()); @@ -187,7 +185,7 @@ public class TenantRepository { } } - if (failed.size() > 0 && throwExceptionIfBootstrappingFails) + if (failed.size() > 0) throw new RuntimeException("Could not create all tenants when bootstrapping, failed to create: " + failed); metricUpdater.setTenants(tenants.size()); diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TenantRepositoryTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TenantRepositoryTest.java index 9cb9772cc9c..d73fb98214f 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TenantRepositoryTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TenantRepositoryTest.java @@ -170,15 +170,10 @@ public class TenantRepositoryTest { public void testFailingBootstrap() throws IOException { tenantRepository.close(); // stop using the one setup in Before method - // No exception if config is false - boolean throwIfBootstrappingTenantRepoFails = false; - new FailingDuringBootstrapTenantRepository(createComponentRegistry(throwIfBootstrappingTenantRepoFails)); - // Should get exception if config is true - throwIfBootstrappingTenantRepoFails = true; expectedException.expect(RuntimeException.class); expectedException.expectMessage("Could not create all tenants when bootstrapping, failed to create: [default]"); - new FailingDuringBootstrapTenantRepository(createComponentRegistry(throwIfBootstrappingTenantRepoFails)); + new FailingDuringBootstrapTenantRepository(createComponentRegistry()); } private List<String> readZKChildren(String path) throws Exception { @@ -190,13 +185,12 @@ public class TenantRepositoryTest { .checkExists().forPath(TenantRepository.getTenantPath(tenantName).getAbsolute())); } - private GlobalComponentRegistry createComponentRegistry(boolean throwIfBootstrappingTenantRepoFails) throws IOException { + private GlobalComponentRegistry createComponentRegistry() throws IOException { return new TestComponentRegistry.Builder() .curator(new MockCurator()) .configServerConfig(new ConfigserverConfig(new ConfigserverConfig.Builder() - .throwIfBootstrappingTenantRepoFails(throwIfBootstrappingTenantRepoFails) - .configDefinitionsDir(temporaryFolder.newFolder("configdefs" + throwIfBootstrappingTenantRepoFails).getAbsolutePath()) - .configServerDBDir(temporaryFolder.newFolder("configserverdb" + throwIfBootstrappingTenantRepoFails).getAbsolutePath()))) + .configDefinitionsDir(temporaryFolder.newFolder("configdefs").getAbsolutePath()) + .configServerDBDir(temporaryFolder.newFolder("configserverdb").getAbsolutePath()))) .zone(new Zone(SystemName.cd, Environment.prod, RegionName.from("foo"))) .build(); } |