summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahoo-inc.com>2017-10-05 16:42:09 +0200
committerGitHub <noreply@github.com>2017-10-05 16:42:09 +0200
commitae0b0962ce1fb23bd5cca58ddfeb3596bf1453f4 (patch)
tree64c872050667aa70550618a565d14d9b8f08e58c /storage
parent4097dc755264d0bfc2ea8c6e17ebf667325b86ca (diff)
parent24670c5ccf0d5287c2ef6d3d7b70e3de014d4003 (diff)
Merge pull request #3660 from vespa-engine/vekterli/log-with-backtrace-on-empty-bucketdb-update
Log with backtrace when inserting an empty bucket into the database
Diffstat (limited to 'storage')
-rw-r--r--storage/src/vespa/storage/bucketdb/mapbucketdatabase.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/storage/src/vespa/storage/bucketdb/mapbucketdatabase.cpp b/storage/src/vespa/storage/bucketdb/mapbucketdatabase.cpp
index fbc2b6d348f..5ac4c4b1ee7 100644
--- a/storage/src/vespa/storage/bucketdb/mapbucketdatabase.cpp
+++ b/storage/src/vespa/storage/bucketdb/mapbucketdatabase.cpp
@@ -2,8 +2,12 @@
#include "mapbucketdatabase.h"
#include <vespa/storage/common/bucketoperationlogger.h>
+#include <vespa/vespalib/util/backtrace.h>
#include <ostream>
+#include <vespa/log/bufferedlogger.h>
+LOG_SETUP(".mapbucketdatabase");
+
namespace storage {
MapBucketDatabase::MapBucketDatabase()
@@ -136,10 +140,24 @@ MapBucketDatabase::remove(const document::BucketId& bucket)
remove(0, 0, bucket);
}
+namespace {
+
+void __attribute__((noinline)) log_empty_bucket_insertion(const document::BucketId& id) {
+ // Use buffered logging to avoid spamming the logs in case this is triggered for
+ // many buckets simultaneously.
+ LOGBP(error, "Inserted empty bucket %s into database.\n%s",
+ id.toString().c_str(), vespalib::getStackTrace(2).c_str());
+}
+
+}
+
void
MapBucketDatabase::update(const Entry& newEntry)
{
assert(newEntry.valid());
+ if (newEntry->getNodeCount() == 0) {
+ log_empty_bucket_insertion(newEntry.getBucketId());
+ }
LOG_BUCKET_OPERATION_NO_LOCK(
newEntry.getBucketId(),
vespalib::make_string(