diff options
author | Tor Brede Vekterli <vekterli@oath.com> | 2018-06-19 11:08:24 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@oath.com> | 2018-06-19 11:08:24 +0000 |
commit | 227312758d0fb74423972eba6d47a0d34cb03df7 (patch) | |
tree | a24e19fb7cf23927c0adb6d333696eea7419e02f /storage | |
parent | 966d50e79ed842841f49eb640c1f574e9da4b6dc (diff) |
Debug log when new config is received on content node
Diffstat (limited to 'storage')
-rw-r--r-- | storage/src/vespa/storage/storageserver/storagenode.cpp | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/storage/src/vespa/storage/storageserver/storagenode.cpp b/storage/src/vespa/storage/storageserver/storagenode.cpp index 6bb2ca31ec1..0602d14e088 100644 --- a/storage/src/vespa/storage/storageserver/storagenode.cpp +++ b/storage/src/vespa/storage/storageserver/storagenode.cpp @@ -16,6 +16,8 @@ #include <fcntl.h> #include <vespa/log/log.h> +#include <vespa/config/print/configdatabuffer.h> + LOG_SETUP(".node.server"); using vespa::config::content::StorDistributionConfigBuilder; @@ -466,12 +468,24 @@ StorageNode::shutdown() LOG(debug, "Done shutting down node"); } -void StorageNode::configure(std::unique_ptr<StorServerConfig> 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 +namespace { + +void log_config_received(const config::ConfigInstance& cfg) { + if (LOG_WOULD_LOG(debug)) { + config::ConfigDataBuffer buf; + cfg.serialize(buf); + LOG(debug, "Received new %s config: %s", cfg.defName().c_str(), buf.getEncodedString().c_str()); + } +} + +} + +void StorageNode::configure(std::unique_ptr<StorServerConfig> config) { + log_config_received(*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); _newServerConfig = std::move(config); @@ -482,13 +496,8 @@ void StorageNode::configure(std::unique_ptr<StorServerConfig> config) } } -void -StorageNode::configure(std::unique_ptr<UpgradingConfig> 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 +void StorageNode::configure(std::unique_ptr<UpgradingConfig> config) { + log_config_received(*config); { vespalib::LockGuard configLockGuard(_configLock); _newClusterConfig = std::move(config); @@ -499,13 +508,8 @@ StorageNode::configure(std::unique_ptr<UpgradingConfig> config) } } -void -StorageNode::configure(std::unique_ptr<StorDistributionConfig> 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 +void StorageNode::configure(std::unique_ptr<StorDistributionConfig> config) { + log_config_received(*config); { vespalib::LockGuard configLockGuard(_configLock); _newDistributionConfig = std::move(config); @@ -516,9 +520,8 @@ StorageNode::configure(std::unique_ptr<StorDistributionConfig> config) } } -void -StorageNode::configure(std::unique_ptr<StorPrioritymappingConfig> config) -{ +void StorageNode::configure(std::unique_ptr<StorPrioritymappingConfig> config) { + log_config_received(*config); { vespalib::LockGuard configLockGuard(_configLock); _newPriorityConfig = std::move(config); @@ -533,6 +536,7 @@ void StorageNode::configure(std::unique_ptr<document::DocumenttypesConfig> config, bool hasChanged, int64_t generation) { + log_config_received(*config); (void) generation; if (!hasChanged) return; @@ -546,9 +550,8 @@ StorageNode::configure(std::unique_ptr<document::DocumenttypesConfig> config, } } -void -StorageNode::configure(std::unique_ptr<BucketspacesConfig> config) -{ +void StorageNode::configure(std::unique_ptr<BucketspacesConfig> config) { + log_config_received(*config); { vespalib::LockGuard configLockGuard(_configLock); _newBucketSpacesConfig = std::move(config); |