diff options
author | Tor Brede Vekterli <vekterli@oath.com> | 2018-01-19 13:20:09 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@oath.com> | 2018-01-19 13:20:09 +0000 |
commit | 2b8eca7483f08f9a3a3e3b1765ca1060b9516da6 (patch) | |
tree | 42664717b803368e62ddf51c71a5b9626e3e4910 /storage | |
parent | 37d6a6f18c8df8ba747f302f6ad7aa35406250ab (diff) |
Log warning when aborting operation due to clock skew
Improves visibility into clock/NTP-related problems. Logs distributor
index to make it easier to identify the skewing node(s).
Diffstat (limited to 'storage')
-rw-r--r-- | storage/src/vespa/storage/storageserver/bouncer.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/storage/src/vespa/storage/storageserver/bouncer.cpp b/storage/src/vespa/storage/storageserver/bouncer.cpp index edd3d946aea..97ae3fb1a65 100644 --- a/storage/src/vespa/storage/storageserver/bouncer.cpp +++ b/storage/src/vespa/storage/storageserver/bouncer.cpp @@ -8,6 +8,7 @@ #include <sstream> #include <vespa/log/log.h> +#include <vespa/log/bufferedlogger.h> LOG_SETUP(".bouncer"); namespace storage { @@ -108,11 +109,14 @@ void Bouncer::abortCommandWithTooHighClockSkew(api::StorageMessage& msg, int maxClockSkewInSeconds) { - std::shared_ptr<api::StorageReply> reply( - static_cast<api::StorageCommand&>(msg).makeReply().release()); + auto& as_cmd = dynamic_cast<api::StorageCommand&>(msg); std::ostringstream ost; ost << "Message " << msg.getType() << " is more than " << maxClockSkewInSeconds << " seconds in the future."; + LOGBP(warning, "Aborting operation from distributor %u: %s", + as_cmd.getSourceIndex(), ost.str().c_str()); + + std::shared_ptr<api::StorageReply> reply(as_cmd.makeReply().release()); reply->setResult(api::ReturnCode(api::ReturnCode::ABORTED, ost.str())); sendUp(reply); } |