diff options
19 files changed, 30 insertions, 161 deletions
diff --git a/clustercontroller-apps/src/main/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/ClusterControllerClusterConfigurer.java b/clustercontroller-apps/src/main/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/ClusterControllerClusterConfigurer.java index 6c8af75efac..b15cb2ad399 100644 --- a/clustercontroller-apps/src/main/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/ClusterControllerClusterConfigurer.java +++ b/clustercontroller-apps/src/main/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/ClusterControllerClusterConfigurer.java @@ -73,7 +73,6 @@ public class ClusterControllerClusterConfigurer { options.distributionBits = config.ideal_distribution_bits(); options.minNodeRatioPerGroup = config.min_node_ratio_per_group(); options.setMaxDeferredTaskVersionWaitTime(Duration.ofMillis((int)(config.max_deferred_task_version_wait_time_sec() * 1000))); - options.enableMultipleBucketSpaces = config.enable_multiple_bucket_spaces(); options.clusterHasGlobalDocumentTypes = config.cluster_has_global_document_types(); options.minMergeCompletionRatio = config.min_merge_completion_ratio(); } diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetController.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetController.java index 56fe679fc6a..005bf7971a5 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetController.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetController.java @@ -463,14 +463,9 @@ public class FleetController implements NodeStateOrHostInfoChangeHandler, NodeAd cluster.setSlobrokGenerationCount(0); } - // TODO don't hardcode bucket spaces - if (options.enableMultipleBucketSpaces) { - configuredBucketSpaces = Collections.unmodifiableSet( - Stream.of(FixedBucketSpaces.defaultSpace(), FixedBucketSpaces.globalSpace()) - .collect(Collectors.toSet())); - } else { - configuredBucketSpaces = Collections.emptySet(); - } + configuredBucketSpaces = Collections.unmodifiableSet( + Stream.of(FixedBucketSpaces.defaultSpace(), FixedBucketSpaces.globalSpace()) + .collect(Collectors.toSet())); stateVersionTracker.setMinMergeCompletionRatio(options.minMergeCompletionRatio); communicator.propagateOptions(options); diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetControllerOptions.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetControllerOptions.java index 31268e78338..e069dde1901 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetControllerOptions.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetControllerOptions.java @@ -119,9 +119,6 @@ public class FleetControllerOptions implements Cloneable { private Duration maxDeferredTaskVersionWaitTime = Duration.ofSeconds(30); - // TODO replace this flag with a set of bucket spaces instead - public boolean enableMultipleBucketSpaces = false; - public boolean clusterHasGlobalDocumentTypes = false; // TODO: Choose a default value @@ -233,7 +230,6 @@ public class FleetControllerOptions implements Cloneable { sb.append("<tr><td><nobr>Maximum node event log size</nobr></td><td align=\"right\">").append(eventNodeLogMaxSize).append("</td></tr>"); sb.append("<tr><td><nobr>Wanted distribution bits</nobr></td><td align=\"right\">").append(distributionBits).append("</td></tr>"); sb.append("<tr><td><nobr>Max deferred task version wait time</nobr></td><td align=\"right\">").append(maxDeferredTaskVersionWaitTime.toMillis()).append("ms</td></tr>"); - sb.append("<tr><td><nobr>Multiple bucket spaces enabled</nobr></td><td align=\"right\">").append(enableMultipleBucketSpaces).append("</td></tr>"); sb.append("<tr><td><nobr>Cluster has global document types configured</nobr></td><td align=\"right\">").append(clusterHasGlobalDocumentTypes).append("</td></tr>"); sb.append("</table>"); diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/MasterElectionTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/MasterElectionTest.java index 07d176745bc..9d6e39f244a 100644 --- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/MasterElectionTest.java +++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/MasterElectionTest.java @@ -501,7 +501,6 @@ public class MasterElectionTest extends FleetControllerTest { public void previously_published_state_is_taken_into_account_for_default_space_when_controller_bootstraps() throws Exception { startingTest("MasterElectionTest::previously_published_state_is_taken_into_account_for_default_space_when_controller_bootstraps"); FleetControllerOptions options = new FleetControllerOptions("mycluster"); - options.enableMultipleBucketSpaces = true; options.clusterHasGlobalDocumentTypes = true; options.masterZooKeeperCooldownPeriod = 1; options.minTimeBeforeFirstSystemStateBroadcast = 100000; @@ -545,7 +544,6 @@ public class MasterElectionTest extends FleetControllerTest { public void default_space_nodes_not_marked_as_maintenance_when_cluster_has_no_global_document_types() throws Exception { startingTest("MasterElectionTest::default_space_nodes_not_marked_as_maintenance_when_cluster_has_no_global_document_types"); FleetControllerOptions options = new FleetControllerOptions("mycluster"); - options.enableMultipleBucketSpaces = true; options.clusterHasGlobalDocumentTypes = false; options.masterZooKeeperCooldownPeriod = 1; options.minTimeBeforeFirstSystemStateBroadcast = 100000; diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java index 7bb6e3dabd4..27da41c2bfa 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java @@ -86,7 +86,6 @@ public class ContentCluster extends AbstractConfigProducer implements private final boolean isHostedVespa; private final Map<String, NewDocumentType> documentDefinitions; private final Set<NewDocumentType> globallyDistributedDocuments; - private boolean forceEnableMultipleBucketSpaces = false; private com.yahoo.vespa.model.content.StorageGroup rootGroup; private StorageCluster storageNodes; private DistributorCluster distributorNodes; @@ -266,10 +265,7 @@ public class ContentCluster extends AbstractConfigProducer implements } private void setupExperimental(ContentCluster cluster, ModelElement experimental) { - Boolean enableMultipleBucketSpaces = experimental.childAsBoolean("enable-multiple-bucket-spaces"); - if (enableMultipleBucketSpaces != null) { - cluster.forceEnableMultipleBucketSpaces = enableMultipleBucketSpaces; - } + // Put handling of experimental flags here } private void validateGroupSiblings(String cluster, StorageGroup group) { @@ -615,7 +611,6 @@ public class ContentCluster extends AbstractConfigProducer implements builder.min_distributor_up_ratio(0); builder.min_storage_up_ratio(0); } - builder.enable_multiple_bucket_spaces(true); // Telling the controller whether we actually _have_ global document types lets // it selectively enable or disable constraints that aren't needed when these // are not are present, even if full protocol and backend support is enabled @@ -750,9 +745,5 @@ public class ContentCluster extends AbstractConfigProducer implements docTypeBuilder.bucketspace(bucketSpace); builder.documenttype(docTypeBuilder); } - // NOTE: this config is kept around to allow the use of multiple bucket spaces - // on older versions of Vespa. It is for all intents and purposes a no-op in - // newer versions where multiple bucket spaces are enabled by default. - builder.enable_multiple_bucket_spaces(forceEnableMultipleBucketSpaces); } } diff --git a/config-model/src/main/resources/schema/content.rnc b/config-model/src/main/resources/schema/content.rnc index 58d22ea9b6f..c0313cd50ef 100644 --- a/config-model/src/main/resources/schema/content.rnc +++ b/config-model/src/main/resources/schema/content.rnc @@ -114,9 +114,9 @@ Content = element content { Documents? & ContentNodes? & TopGroup? & - Controllers? & + Controllers? # Contains experimental feature switches - Experimental? + #Experimental? } Controllers = @@ -368,9 +368,9 @@ TuningCompression = element compression { element level { xsd:nonNegativeInteger }? } -Experimental = element experimental { - element enable-multiple-bucket-spaces { xsd:boolean }? -} +#Experimental = element experimental { +# Put experimental flags here +#} Thread = element thread { ## The lowest priority this thread should handle. diff --git a/config-model/src/test/java/com/yahoo/vespa/model/content/ContentSearchClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/content/ContentSearchClusterTest.java index 0156128f7ca..83b4cfebca5 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/content/ContentSearchClusterTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/content/ContentSearchClusterTest.java @@ -40,8 +40,11 @@ public class ContentSearchClusterTest { } private static ContentCluster createClusterWithGlobalType() throws Exception { - return createCluster(createClusterBuilderWithGlobalType().getXml(), - createSearchDefinitions("global", "regular")); + return createClusterFromBuilderAndDocTypes(createClusterBuilderWithGlobalType(), "global", "regular"); + } + + private static ContentCluster createClusterWithoutGlobalType() throws Exception { + return createClusterFromBuilderAndDocTypes(createClusterBuilderWithOnlyDefaultTypes(), "marve", "fleksnes"); } private static ContentCluster createClusterFromBuilderAndDocTypes(ContentClusterBuilder builder, String... docTypes) throws Exception { @@ -49,26 +52,10 @@ public class ContentSearchClusterTest { "<node distribution-key='0' hostalias='mockhost'/>", "<node distribution-key='1' hostalias='mockhost'/>", "</group>")); - builder.enableMultipleBucketSpaces(true); String clusterXml = builder.getXml(); return createCluster(clusterXml, createSearchDefinitions(docTypes)); } - private static ContentCluster createClusterWithMultipleBucketSpacesEnabled() throws Exception { - return createClusterFromBuilderAndDocTypes(createClusterBuilderWithGlobalType(), "global", "regular"); - } - - private static ContentCluster createClusterWithMultipleBucketSpacesEnabledButNoGlobalDocs() throws Exception { - return createClusterFromBuilderAndDocTypes(createClusterBuilderWithOnlyDefaultTypes(), "marve", "fleksnes"); - } - - private static ContentCluster createClusterWithGlobalDocsButNotMultipleSpacesEnabled() throws Exception { - return createCluster(createClusterBuilderWithGlobalType() - .enableMultipleBucketSpaces(false) - .getXml(), - createSearchDefinitions("global", "regular")); - } - private static ContentClusterBuilder createClusterBuilderWithGlobalType() { return new ContentClusterBuilder() .docTypes(Arrays.asList(DocType.indexGlobal("global"), DocType.index("regular"))); @@ -178,41 +165,18 @@ public class ContentSearchClusterTest { assertEquals(2, config.documenttype().size()); assertDocumentType("global", "global", config.documenttype(0)); assertDocumentType("regular", "default", config.documenttype(1)); - // Safeguard against flipping the switch - assertFalse(config.enable_multiple_bucket_spaces()); - } - - @Test - public void require_that_multiple_bucket_spaces_can_be_force_enabled() throws Exception { - ContentCluster cluster = createClusterWithMultipleBucketSpacesEnabled(); - { - BucketspacesConfig config = getBucketspacesConfig(cluster); - assertEquals(2, config.documenttype().size()); - assertDocumentType("global", "global", config.documenttype(0)); - assertDocumentType("regular", "default", config.documenttype(1)); - assertTrue(config.enable_multiple_bucket_spaces()); - } - { - assertTrue(getFleetcontrollerConfig(cluster).enable_multiple_bucket_spaces()); - } } @Test public void cluster_with_global_document_types_sets_cluster_controller_global_docs_config_option() throws Exception { - ContentCluster cluster = createClusterWithMultipleBucketSpacesEnabled(); + ContentCluster cluster = createClusterWithGlobalType(); assertTrue(getFleetcontrollerConfig(cluster).cluster_has_global_document_types()); } @Test public void cluster_without_global_document_types_unsets_cluster_controller_global_docs_config_option() throws Exception { - ContentCluster cluster = createClusterWithMultipleBucketSpacesEnabledButNoGlobalDocs(); + ContentCluster cluster = createClusterWithoutGlobalType(); assertFalse(getFleetcontrollerConfig(cluster).cluster_has_global_document_types()); } - @Test - public void controller_global_documents_config_always_enabled_even_without_experimental_flag_set() throws Exception { - ContentCluster cluster = createClusterWithGlobalDocsButNotMultipleSpacesEnabled(); - assertTrue(getFleetcontrollerConfig(cluster).cluster_has_global_document_types()); - } - } diff --git a/config-model/src/test/java/com/yahoo/vespa/model/content/utils/ContentClusterBuilder.java b/config-model/src/test/java/com/yahoo/vespa/model/content/utils/ContentClusterBuilder.java index 79bc9504659..95c57bb544c 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/content/utils/ContentClusterBuilder.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/content/utils/ContentClusterBuilder.java @@ -26,7 +26,6 @@ public class ContentClusterBuilder { private Optional<String> dispatchXml = Optional.empty(); private Optional<Double> protonDiskLimit = Optional.empty(); private Optional<Double> protonMemoryLimit = Optional.empty(); - private Optional<Boolean> enableMultipleBucketSpaces = Optional.empty(); public ContentClusterBuilder() { } @@ -78,11 +77,6 @@ public class ContentClusterBuilder { return this; } - public ContentClusterBuilder enableMultipleBucketSpaces(boolean value) { - this.enableMultipleBucketSpaces = Optional.of(value); - return this; - } - public ContentCluster build(MockRoot root) throws Exception { return ContentClusterUtils.createCluster(getXml(), root); } @@ -100,11 +94,6 @@ public class ContentClusterBuilder { if (dispatchXml.isPresent()) { xml += dispatchXml.get(); } - if (enableMultipleBucketSpaces.isPresent()) { - xml += joinLines("<experimental>", - "<enable-multiple-bucket-spaces>" + (enableMultipleBucketSpaces.get() ? "true" : "false") + "</enable-multiple-bucket-spaces>", - "</experimental>"); - } return xml + groupXml + "</content>"; } diff --git a/configdefinitions/src/vespa/bucketspaces.def b/configdefinitions/src/vespa/bucketspaces.def index 4db107ec1ee..c9468850018 100644 --- a/configdefinitions/src/vespa/bucketspaces.def +++ b/configdefinitions/src/vespa/bucketspaces.def @@ -10,5 +10,3 @@ documenttype[].name string ## The bucket space this document type belongs to. documenttype[].bucketspace string -## Switch to enable multiple bucket spaces in content layer and content nodes. -enable_multiple_bucket_spaces bool default=false diff --git a/configdefinitions/src/vespa/fleetcontroller.def b/configdefinitions/src/vespa/fleetcontroller.def index ca7ede28cb2..04c9e3b7c73 100644 --- a/configdefinitions/src/vespa/fleetcontroller.def +++ b/configdefinitions/src/vespa/fleetcontroller.def @@ -155,9 +155,6 @@ min_node_ratio_per_group double default=0.0 ## within this duration. max_deferred_task_version_wait_time_sec double default=30.0 -## Switch to enable multiple bucket spaces in cluster controller. -enable_multiple_bucket_spaces bool default=false - ## Whether or not the content cluster the controller has responsibility for ## contains any document types that are tagged as global. If this is true, ## global document-specific behavior is enabled that marks nodes down in the diff --git a/storage/src/vespa/storage/common/storagecomponent.cpp b/storage/src/vespa/storage/common/storagecomponent.cpp index 1d6b563f6eb..21a4b8eea64 100644 --- a/storage/src/vespa/storage/common/storagecomponent.cpp +++ b/storage/src/vespa/storage/common/storagecomponent.cpp @@ -62,13 +62,6 @@ StorageComponent::setDistribution(DistributionSP distribution) } void -StorageComponent::enableMultipleBucketSpaces(bool value) -{ - std::lock_guard guard(_lock); - _enableMultipleBucketSpaces = value; -} - -void StorageComponent::setNodeStateUpdater(NodeStateUpdater& updater) { std::lock_guard guard(_lock); @@ -91,8 +84,7 @@ StorageComponent::StorageComponent(StorageComponentRegister& compReg, _bucketIdFactory(), _distribution(), _nodeStateUpdater(nullptr), - _lock(), - _enableMultipleBucketSpaces(false) + _lock() { compReg.registerStorageComponent(*this); } @@ -145,11 +137,4 @@ StorageComponent::getDistribution() const return _distribution; } -bool -StorageComponent::enableMultipleBucketSpaces() const -{ - std::lock_guard guard(_lock); - return _enableMultipleBucketSpaces; -} - } // storage diff --git a/storage/src/vespa/storage/common/storagecomponent.h b/storage/src/vespa/storage/common/storagecomponent.h index 168bdbe9aa6..901594ade99 100644 --- a/storage/src/vespa/storage/common/storagecomponent.h +++ b/storage/src/vespa/storage/common/storagecomponent.h @@ -83,7 +83,6 @@ public: void setPriorityConfig(const PriorityConfig&); void setBucketIdFactory(const document::BucketIdFactory&); void setDistribution(DistributionSP); - void enableMultipleBucketSpaces(bool value); StorageComponent(StorageComponentRegister&, vespalib::stringref name); virtual ~StorageComponent(); @@ -102,7 +101,6 @@ public: uint8_t getPriority(const documentapi::LoadType&) const; DistributionSP getDistribution() const; NodeStateUpdater& getStateUpdater() const; - bool enableMultipleBucketSpaces() const; private: vespalib::string _clusterName; @@ -115,7 +113,6 @@ private: DistributionSP _distribution; NodeStateUpdater* _nodeStateUpdater; mutable std::mutex _lock; - bool _enableMultipleBucketSpaces; }; struct StorageComponentRegister : public virtual framework::ComponentRegister diff --git a/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.cpp b/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.cpp index 0a172ccd4e2..2f66027ccab 100644 --- a/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.cpp +++ b/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.cpp @@ -21,8 +21,7 @@ StorageComponentRegisterImpl::StorageComponentRegisterImpl() _bucketIdFactory(), _distribution(), _nodeStateUpdater(nullptr), - _bucketSpacesConfig(), - _enableMultipleBucketSpaces(false) + _bucketSpacesConfig() { } @@ -43,7 +42,6 @@ StorageComponentRegisterImpl::registerStorageComponent(StorageComponent& smc) smc.setPriorityConfig(_priorityConfig); smc.setBucketIdFactory(_bucketIdFactory); smc.setDistribution(_distribution); - smc.enableMultipleBucketSpaces(_enableMultipleBucketSpaces); } void @@ -133,19 +131,4 @@ StorageComponentRegisterImpl::setBucketSpacesConfig(const BucketspacesConfig& co _bucketSpacesConfig = config; } -void StorageComponentRegisterImpl::setEnableMultipleBucketSpaces(bool enabled) { - vespalib::LockGuard lock(_componentLock); - assert(!_enableMultipleBucketSpaces); // Cannot disable once enabled. - _enableMultipleBucketSpaces = enabled; - for (auto& component : _components) { - component->enableMultipleBucketSpaces(_enableMultipleBucketSpaces); - } -} - -bool StorageComponentRegisterImpl::enableMultipleBucketSpaces() const { - // We allow reading this outside _componentLock, as it should never be written - // again after startup. - return _enableMultipleBucketSpaces; -} - } // storage diff --git a/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.h b/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.h index 1621f4e71f3..2f8bfaab87b 100644 --- a/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.h +++ b/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.h @@ -36,7 +36,6 @@ class StorageComponentRegisterImpl lib::Distribution::SP _distribution; NodeStateUpdater* _nodeStateUpdater; BucketspacesConfig _bucketSpacesConfig; - bool _enableMultipleBucketSpaces; public: typedef std::unique_ptr<StorageComponentRegisterImpl> UP; @@ -67,10 +66,6 @@ public: virtual void setBucketIdFactory(const document::BucketIdFactory&); virtual void setDistribution(lib::Distribution::SP); virtual void setBucketSpacesConfig(const BucketspacesConfig&); - - virtual void setEnableMultipleBucketSpaces(bool enabled); // To be called during startup configuration phase only. - bool enableMultipleBucketSpaces() const; - }; } // storage diff --git a/storage/src/vespa/storage/storageserver/communicationmanager.cpp b/storage/src/vespa/storage/storageserver/communicationmanager.cpp index eee688b1fb2..5a1c2aed113 100644 --- a/storage/src/vespa/storage/storageserver/communicationmanager.cpp +++ b/storage/src/vespa/storage/storageserver/communicationmanager.cpp @@ -439,8 +439,7 @@ void CommunicationManager::configure(std::unique_ptr<CommunicationManagerConfig> _mbus = std::make_unique<mbus::RPCMessageBus>( mbus::ProtocolSet() .add(std::make_shared<documentapi::DocumentProtocol>(*_component.getLoadTypes(), _component.getTypeRepo())) - .add(std::make_shared<mbusprot::StorageProtocol>(_component.getTypeRepo(), *_component.getLoadTypes(), - _component.enableMultipleBucketSpaces())), + .add(std::make_shared<mbusprot::StorageProtocol>(_component.getTypeRepo(), *_component.getLoadTypes())), params, _configUri); @@ -781,7 +780,7 @@ void CommunicationManager::updateMessagebusProtocol( auto newDocumentProtocol = std::make_shared<documentapi::DocumentProtocol>(*_component.getLoadTypes(), repo); std::lock_guard<std::mutex> guard(_earlierGenerationsLock); _earlierGenerations.push_back(std::make_pair(now, _mbus->getMessageBus().putProtocol(newDocumentProtocol))); - auto newStorageProtocol = std::make_shared<mbusprot::StorageProtocol>(repo, *_component.getLoadTypes(), _component.enableMultipleBucketSpaces()); + auto newStorageProtocol = std::make_shared<mbusprot::StorageProtocol>(repo, *_component.getLoadTypes()); _earlierGenerations.push_back(std::make_pair(now, _mbus->getMessageBus().putProtocol(newStorageProtocol))); } } diff --git a/storage/src/vespa/storage/storageserver/storagenode.cpp b/storage/src/vespa/storage/storageserver/storagenode.cpp index ed33f3846c1..d159b6e5bdd 100644 --- a/storage/src/vespa/storage/storageserver/storagenode.cpp +++ b/storage/src/vespa/storage/storageserver/storagenode.cpp @@ -146,11 +146,6 @@ StorageNode::initialize() // and store them away, while having the config lock. subscribeToConfigs(); - // Multiple bucket spaces can only be enabled on startup and cannot be live reconfigured. - // A process restart is required to either enable or disable after the fact. - // TODO ensure config is tagged as 'restart' as a consequence - _context.getComponentRegister().setEnableMultipleBucketSpaces(_bucketSpacesConfig->enableMultipleBucketSpaces); - updateUpgradeFlag(*_clusterConfig); // First update some basics that doesn't depend on anything else to be diff --git a/storageapi/src/tests/mbusprot/storageprotocoltest.cpp b/storageapi/src/tests/mbusprot/storageprotocoltest.cpp index da7e8cb743e..f634667afd5 100644 --- a/storageapi/src/tests/mbusprot/storageprotocoltest.cpp +++ b/storageapi/src/tests/mbusprot/storageprotocoltest.cpp @@ -56,7 +56,7 @@ struct StorageProtocolTest : public CppUnit::TestFixture { _testDoc(_docMan.createDocument()), _testDocId(_testDoc->getId()), _bucket(makeDocumentBucket(document::BucketId(16, 0x51))), - _protocol(_docMan.getTypeRepoSP(), _loadTypes, true) + _protocol(_docMan.getTypeRepoSP(), _loadTypes) { _loadTypes.addLoadType(34, "foo", documentapi::Priority::PRI_NORMAL_2); } diff --git a/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.cpp b/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.cpp index f83188f7dd8..7e6be0a84f5 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.cpp +++ b/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.cpp @@ -16,13 +16,11 @@ namespace storage::mbusprot { mbus::string StorageProtocol::NAME = "StorageProtocol"; StorageProtocol::StorageProtocol(const std::shared_ptr<const document::DocumentTypeRepo> repo, - const documentapi::LoadTypeSet& loadTypes, - bool configForcedBucketSpaceSerialization) + const documentapi::LoadTypeSet& loadTypes) : _serializer5_0(repo, loadTypes), _serializer5_1(repo, loadTypes), _serializer5_2(repo, loadTypes), - _serializer6_0(repo, loadTypes), - _configForcedBucketSpaceSerialization(configForcedBucketSpaceSerialization) + _serializer6_0(repo, loadTypes) { } @@ -106,14 +104,10 @@ StorageProtocol::encode(const vespalib::Version& version, } else if (version < version5_2) { return encodeMessage(_serializer5_1, routable, message, version5_1, version); } else { - if (_configForcedBucketSpaceSerialization) { - return encodeMessage(_serializer6_0, routable, message, version6_0, version); + if (version < version6_0) { + return encodeMessage(_serializer5_2, routable, message, version5_2, version); } else { - if (version < version6_0) { - return encodeMessage(_serializer5_2, routable, message, version5_2, version); - } else { - return encodeMessage(_serializer6_0, routable, message, version6_0, version); - } + return encodeMessage(_serializer6_0, routable, message, version6_0, version); } } @@ -184,14 +178,10 @@ StorageProtocol::decode(const vespalib::Version & version, } else if (version < version5_2) { return decodeMessage(_serializer5_1, data, type, version5_1, version); } else { - if (_configForcedBucketSpaceSerialization) { - return decodeMessage(_serializer6_0, data, type, version6_0, version); + if (version < version6_0) { + return decodeMessage(_serializer5_2, data, type, version5_2, version); } else { - if (version < version6_0) { - return decodeMessage(_serializer5_2, data, type, version5_2, version); - } else { - return decodeMessage(_serializer6_0, data, type, version6_0, version); - } + return decodeMessage(_serializer6_0, data, type, version6_0, version); } } } catch (std::exception & e) { diff --git a/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.h b/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.h index 56f271db1d0..1acd7c9675f 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.h +++ b/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.h @@ -15,8 +15,7 @@ public: static mbus::string NAME; StorageProtocol(const std::shared_ptr<const document::DocumentTypeRepo>, - const documentapi::LoadTypeSet& loadTypes, - bool activateBucketSpaceSerialization = false); + const documentapi::LoadTypeSet& loadTypes); ~StorageProtocol(); const mbus::string& getName() const override { return NAME; } @@ -29,7 +28,6 @@ private: ProtocolSerialization5_1 _serializer5_1; ProtocolSerialization5_2 _serializer5_2; ProtocolSerialization6_0 _serializer6_0; - bool _configForcedBucketSpaceSerialization; }; } |