diff options
7 files changed, 7 insertions, 144 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/StorageNode.java b/config-model/src/main/java/com/yahoo/vespa/model/content/StorageNode.java index 55a2a27f18c..3ee1472338e 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/StorageNode.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/StorageNode.java @@ -3,7 +3,6 @@ package com.yahoo.vespa.model.content; import com.yahoo.vespa.config.content.StorFilestorConfig; import com.yahoo.vespa.config.content.core.StorBucketmoverConfig; -import com.yahoo.vespa.config.storage.StorDevicesConfig; import com.yahoo.vespa.config.content.core.StorServerConfig; import com.yahoo.config.model.producer.AbstractConfigProducer; import com.yahoo.vespa.config.storage.StorMemfilepersistenceConfig; @@ -21,16 +20,13 @@ import java.util.Arrays; /** * Class to provide config related to a specific storage node. */ -@RestartConfigs({StorDevicesConfig.class, StorFilestorConfig.class, - StorMemfilepersistenceConfig.class, StorBucketmoverConfig.class}) -public class StorageNode extends ContentNode implements StorServerConfig.Producer, StorDevicesConfig.Producer { +@RestartConfigs({StorFilestorConfig.class, StorMemfilepersistenceConfig.class, StorBucketmoverConfig.class}) +public class StorageNode extends ContentNode implements StorServerConfig.Producer { - static final String rootFolder = Defaults.getDefaults().underVespaHome("var/db/vespa/vds/"); + static final String rootFolder = Defaults.getDefaults().underVespaHome("var/db/vespa/search/"); private final Double capacity; private final boolean retired; - private final boolean isHostedVespa; - private boolean usesVdsEngine = false; public static class Builder extends VespaDomBuilder.DomConfigProducerBuilder<StorageNode> { @Override @@ -47,7 +43,6 @@ public class StorageNode extends ContentNode implements StorServerConfig.Produce distributionKey); this.retired = retired; this.capacity = capacity; - this.isHostedVespa = cluster.getRoot().getDeployState().getProperties().hostedVespa(); } @Override @@ -57,31 +52,6 @@ public class StorageNode extends ContentNode implements StorServerConfig.Produce : "exec sbin/vespa-storaged -c $VESPA_CONFIG_ID"; } - @Override - public void getConfig(StorDevicesConfig.Builder builder) { - String root_folder = getRootDirectory(); - builder.root_folder(root_folder); - - // For VDS in hosted Vespa, we default to using the root_folder as the disk to store the data in. - // Setting disk_path will then - if (isHostedVespa && usesVdsEngine) { - // VDS looks up the first disk at the directory path root_folder/disks/d0. - builder.disk_path(Arrays.asList(root_folder + "/disks/d0")); - } - } - - // 2015-08-11: Needed because of the following circular dependency: - // 1. StorageNode is created. - // 2. A particular persistence engine is picked depending on things (like the presence of engine/proton element) - // that are hidden from the code creating the StorageNode in (1). - // 3. The persistence engine depends on the StorageNode, e.g. it's a parent node. - // - // If the VDSEngine is picked in (2), we would like to know this in StorageNode::getConfig(). Hence this setter. - public void useVdsEngine() { - usesVdsEngine = true; - } - - public double getCapacity() { if (capacity != null) { return capacity; diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/SearchNode.java b/config-model/src/main/java/com/yahoo/vespa/model/search/SearchNode.java index 924c282d2e5..547ff354b41 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/search/SearchNode.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/search/SearchNode.java @@ -13,7 +13,6 @@ import com.yahoo.vespa.config.content.core.StorCommunicationmanagerConfig; import com.yahoo.vespa.config.content.core.StorServerConfig; import com.yahoo.vespa.config.content.core.StorStatusConfig; import com.yahoo.vespa.config.search.core.ProtonConfig; -import com.yahoo.vespa.config.storage.StorDevicesConfig; import static com.yahoo.vespa.defaults.Defaults.getDefaults; import com.yahoo.vespa.model.AbstractService; import com.yahoo.vespa.model.admin.monitoring.Monitoring; @@ -39,7 +38,7 @@ import java.util.Optional; * @author hmusum */ @RestartConfigs({ProtonConfig.class, MetricsmanagerConfig.class, TranslogserverConfig.class, - StorDevicesConfig.class, StorFilestorConfig.class, StorBucketmoverConfig.class, + StorFilestorConfig.class, StorBucketmoverConfig.class, StorCommunicationmanagerConfig.class, StorStatusConfig.class, StorServerConfig.class, LoadTypeConfig.class}) public class SearchNode extends AbstractService implements diff --git a/config-model/src/test/java/com/yahoo/vespa/model/content/StorageClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/content/StorageClusterTest.java index d52b07a318a..373b2d90ad6 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/content/StorageClusterTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/content/StorageClusterTest.java @@ -6,20 +6,17 @@ import com.yahoo.vespa.config.content.core.StorVisitorConfig; import com.yahoo.vespa.config.content.StorFilestorConfig; import com.yahoo.vespa.config.content.core.StorServerConfig; import com.yahoo.vespa.config.content.PersistenceConfig; -import com.yahoo.vespa.config.storage.StorDevicesConfig; import com.yahoo.config.model.test.MockRoot; import com.yahoo.documentmodel.NewDocumentType; -import com.yahoo.text.XML; import static com.yahoo.vespa.defaults.Defaults.getDefaults; import com.yahoo.vespa.model.content.cluster.ContentCluster; import com.yahoo.vespa.model.content.storagecluster.StorageCluster; import com.yahoo.vespa.model.content.utils.ContentClusterUtils; import org.junit.Test; -import org.w3c.dom.Document; -import java.util.Collections; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; public class StorageClusterTest { @@ -195,13 +192,6 @@ public class StorageClusterTest { StorageNode node = cluster.getStorageNodes().getChildren().get("0"); { - StorDevicesConfig.Builder builder = new StorDevicesConfig.Builder(); - node.getConfig(builder); - StorDevicesConfig config = new StorDevicesConfig(builder); - assertEquals(getDefaults().underVespaHome("var/db/vespa/vds/storage/storage/0"), config.root_folder()); - } - - { StorServerConfig.Builder builder = new StorServerConfig.Builder(); cluster.getStorageNodes().getConfig(builder); node.getConfig(builder); diff --git a/configdefinitions/src/vespa/CMakeLists.txt b/configdefinitions/src/vespa/CMakeLists.txt index f578d797f3a..d0a5132b90f 100644 --- a/configdefinitions/src/vespa/CMakeLists.txt +++ b/configdefinitions/src/vespa/CMakeLists.txt @@ -52,8 +52,6 @@ vespa_generate_config(configdefinitions slobroks.def) install_config_definition(slobroks.def cloud.config.slobroks.def) vespa_generate_config(configdefinitions specialtokens.def) install_config_definition(specialtokens.def vespa.configdefinition.specialtokens.def) -vespa_generate_config(configdefinitions stor-devices.def) -install_config_definition(stor-devices.def vespa.config.storage.stor-devices.def) vespa_generate_config(configdefinitions stor-distribution.def) install_config_definition(stor-distribution.def vespa.config.content.stor-distribution.def) vespa_generate_config(configdefinitions stor-filestor.def) diff --git a/configdefinitions/src/vespa/stor-devices.def b/configdefinitions/src/vespa/stor-devices.def deleted file mode 100644 index bab67cc76af..00000000000 --- a/configdefinitions/src/vespa/stor-devices.def +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=vespa.config.storage - -## Root directory for all files related to this storage node. -## Will typically be "$VESPA_HOME/var/db/vespa/vds/<cluster>/<nodetype>/<index>" -## Within this directory the "disks/d<dirindex>" directories/symlinks will -## contain the actual data stored by storage. -root_folder string restart - -## List of disks to store the storage data in. Make an empty directory for -## each disk_path[index] if it does not exist yet, and make a symlink from each -## "<root_folder>/disks/d<index>" to disk_path[index] if it doesn't exist yet. -disk_path[] string restart - -## Capacity of the disks on this node. How much data and load will each disk -## get relative to the other disks on this node. The default disk capacity is -## 1.0. If disk capacity array size does not match disk counts, it will use the -## values that exist, and use 1.0 for the rest. -disk_capacity[] double restart - -## The device mapper is used to detect what storage directories map to what -## partitions and disks, such that then a disk event arise, it arise for all -## directories using that disk. Storage has two different device mappers. One -## that fakes the devices, assuming all VDS directories use unique partitions -## and disks, and a real one trying to detect what is actually being used. -## -## Advantage of simple one is that one can fake multiple disks, which may be -## useful in testing. Problem being that then storage gives clues that it has -## added X bytes to a partition, other directories on the same partition will -## not be adjusted. Thus, one might want to cache stat results less due to -## numbers being incorrect. -## -## If using a real mapper, disk events such as IO failures will mark all -## directories using partitions on that disk bad, rather than just the directory -## containing the file which we had trouble using. We dont detect real physical -## disks. Currently we detect whether they use the same *nix device or not. -device_mapper enum { SIMPLE_MAPPER, REAL_MAPPER } default=REAL_MAPPER restart - -## Whether or not to fail directories on same partition and/or disk as another -## directory on failures. Our goal is to return directory errors on failures -## only affecting one directory, partition failures for errors only affecting a -## single partition and so on. In reality, however, it is very hard to know if -## the problem is partition or disk related for instance. Both a corrupt -## filesystem and a bad disk may show the same IO error to storage. We -## recommend having this enabled, so we can attempt to do logic, but it is -## possible to turn it of, in case you see the logic doesnt work for you (and -## that you get more directories than needed marked down and that troubles -## your system) -fail_multiple_directories_on_common_events bool default=true restart - -## Storage stats file systems regularily to check how full they are. To avoid -## constantly calling this system call storage may cache the result and validate -## changes once in a while. The always policy always calls the real statfs -## function when asked for disk fullness. This may be useful in system testing -## where you want to test disk full situations (but not this policy). The stat -## once policy does a single stat upon start, and depends on storage to give -## clues about changes in disk usage to report correct results (currently not -## recommended since we dont guarantuee the clues are 100% correct). The period -## policy asks for each Nth request, and so does the dynamic policy, but the -## latter one has a dynamic period, being large when disk has low fill rate, but -## small with high fillrate. The dynamic policy is recommended as it doesnt -## require exact change clues requires few stat calls as long as the disks -## arent close to full. -statfs_policy enum { STAT_ALWAYS, STAT_ONCE, STAT_PERIOD, STAT_DYNAMIC } default=STAT_DYNAMIC restart - -## If set to non-null, overrides the code default period for stat period and -## dynamic policies. See PartitionMonitor class for details. -statfs_period int default=0 restart - diff --git a/storage/src/vespa/storage/storageserver/servicelayernode.cpp b/storage/src/vespa/storage/storageserver/servicelayernode.cpp index 9faf380d2ba..ad1f38e2b40 100644 --- a/storage/src/vespa/storage/storageserver/servicelayernode.cpp +++ b/storage/src/vespa/storage/storageserver/servicelayernode.cpp @@ -91,10 +91,8 @@ ServiceLayerNode::subscribeToConfigs() { StorageNode::subscribeToConfigs(); _configFetcher.reset(new config::ConfigFetcher(_configUri.getContext())); - _configFetcher->subscribe<StorDevicesConfig>(_configUri.getConfigId(), this); vespalib::LockGuard configLockGuard(_configLock); - _deviceConfig = std::move(_newDevicesConfig); // Verify and set disk count if (_serverConfig->diskCount != 0 && _serverConfig->diskCount != _partitions.size()) @@ -207,23 +205,6 @@ ServiceLayerNode::handleLiveConfigUpdate(const InitialGuard & initGuard) StorageNode::handleLiveConfigUpdate(initGuard); } -void -ServiceLayerNode::configure(std::unique_ptr<StorDevicesConfig> config) -{ - // When we get config, we try to grab the config lock to ensure noone - // else is doing configuration work, and then we write the new config - // to a variable where we can find it later when processing config - // updates - { - vespalib::LockGuard configLockGuard(_configLock); - _newDevicesConfig = std::move(config); - } - if (_distributionConfig) { - InitialGuard concurrent_config_guard(_initial_config_mutex); - handleLiveConfigUpdate(concurrent_config_guard); - } -} - VisitorMessageSession::UP ServiceLayerNode::createSession(Visitor& visitor, VisitorThread& thread) { diff --git a/storage/src/vespa/storage/storageserver/servicelayernode.h b/storage/src/vespa/storage/storageserver/servicelayernode.h index 12446152b90..7c0d6cd8ee3 100644 --- a/storage/src/vespa/storage/storageserver/servicelayernode.h +++ b/storage/src/vespa/storage/storageserver/servicelayernode.h @@ -15,7 +15,6 @@ #include <vespa/storage/common/visitorfactory.h> #include <vespa/storage/bucketdb/minimumusedbitstracker.h> #include <vespa/persistence/spi/persistenceprovider.h> -#include <vespa/config-stor-devices.h> #include <vespa/config/config.h> namespace storage { @@ -24,11 +23,9 @@ class FileStorManager; class ServiceLayerNode : public StorageNode, - private VisitorMessageSessionFactory, - private config::IFetcherCallback<vespa::config::storage::StorDevicesConfig> + private VisitorMessageSessionFactory { - using StorDevicesConfig = vespa::config::storage::StorDevicesConfig; ServiceLayerNodeContext& _context; spi::PersistenceProvider& _persistenceProvider; spi::PartitionStateList _partitions; @@ -37,8 +34,6 @@ class ServiceLayerNode // FIXME: Should probably use the fetcher in StorageNode std::unique_ptr<config::ConfigFetcher> _configFetcher; - std::unique_ptr<StorDevicesConfig> _deviceConfig; - std::unique_ptr<StorDevicesConfig> _newDevicesConfig; FileStorManager* _fileStorManager; bool _init_has_been_called; bool _noUsablePartitionMode; @@ -65,7 +60,6 @@ private: void subscribeToConfigs() override; void initializeNodeSpecific() override; void handleLiveConfigUpdate(const InitialGuard & initGuard) override; - void configure(std::unique_ptr<StorDevicesConfig> config) override; VisitorMessageSession::UP createSession(Visitor&, VisitorThread&) override; documentapi::Priority::Value toDocumentPriority(uint8_t storagePriority) const override; std::unique_ptr<StorageLink> createChain() override; |