summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@oath.com>2018-01-12 09:40:14 +0000
committerTor Brede Vekterli <vekterli@oath.com>2018-01-12 09:40:14 +0000
commit52c9cae866bf65e4a622b386a2510add19996b0b (patch)
treeb7fbb88e526d1170425f4f3c2d22b6f4e01a6cbb /storage
parentbbcae800a485fbf835a7df7112de377654aebd5c (diff)
Add bucket spaces to bucket DB status pages
Diffstat (limited to 'storage')
-rw-r--r--storage/src/tests/distributor/idealstatemanagertest.cpp4
-rw-r--r--storage/src/vespa/storage/bucketdb/bucketmanager.cpp19
-rw-r--r--storage/src/vespa/storage/distributor/idealstatemanager.cpp24
-rw-r--r--storage/src/vespa/storage/distributor/idealstatemanager.h1
4 files changed, 34 insertions, 14 deletions
diff --git a/storage/src/tests/distributor/idealstatemanagertest.cpp b/storage/src/tests/distributor/idealstatemanagertest.cpp
index bca15d702f5..945ccfa1484 100644
--- a/storage/src/tests/distributor/idealstatemanagertest.cpp
+++ b/storage/src/tests/distributor/idealstatemanagertest.cpp
@@ -91,7 +91,8 @@ IdealStateManagerTest::testStatusPage() {
std::ostringstream ost;
getIdealStateManager().getBucketStatus(ost);
- CPPUNIT_ASSERT_EQUAL(std::string("BucketId(0x4000000000000002) : [node(idx=0,crc=0xff,docs=10/10,bytes=10/10,trusted=true,active=true,ready=false)]<br>\n"
+ CPPUNIT_ASSERT_EQUAL(std::string("<h2>default - BucketSpace(0x0000000000000001)</h2>\n"
+ "BucketId(0x4000000000000002) : [node(idx=0,crc=0xff,docs=10/10,bytes=10/10,trusted=true,active=true,ready=false)]<br>\n"
"<b>BucketId(0x4000000000000005):</b> <i> : split: [Splitting bucket because its maximum size (200 b, 100 docs, 100 meta, 200 b total) is "
"higher than the configured limit of (100, 1000000)]</i> [node(idx=0,crc=0xff,docs=100/100,bytes=200/200,trusted=true,"
"active=true,ready=false)]<br>\n"),
@@ -113,6 +114,7 @@ IdealStateManagerTest::testDisabledStateChecker() {
getIdealStateManager().getBucketStatus(ost);
CPPUNIT_ASSERT_EQUAL(std::string(
+ "<h2>default - BucketSpace(0x0000000000000001)</h2>\n"
"BucketId(0x4000000000000002) : [node(idx=0,crc=0xff,docs=10/10,bytes=10/10,trusted=true,active=true,ready=false)]<br>\n"
"<b>BucketId(0x4000000000000005):</b> <i> : split: [Splitting bucket because its maximum size (200 b, 100 docs, 100 meta, 200 b total) is "
"higher than the configured limit of (100, 1000000)]</i> [node(idx=0,crc=0xff,docs=100/100,bytes=200/200,trusted=true,"
diff --git a/storage/src/vespa/storage/bucketdb/bucketmanager.cpp b/storage/src/vespa/storage/bucketdb/bucketmanager.cpp
index aa9158f9e5b..1b118e72ded 100644
--- a/storage/src/vespa/storage/bucketdb/bucketmanager.cpp
+++ b/storage/src/vespa/storage/bucketdb/bucketmanager.cpp
@@ -16,6 +16,7 @@
#include <vespa/storageapi/message/state.h>
#include <vespa/storageapi/message/bucketsplitting.h>
#include <vespa/storageapi/message/stat.h>
+#include <vespa/persistence/spi/fixed_bucket_spaces.h>
#include <vespa/vespalib/util/stringfmt.h>
#include <vespa/vespalib/stllike/hash_map.hpp>
#include <vespa/config/config.h>
@@ -333,11 +334,21 @@ BucketManager::reportStatus(std::ostream& out,
bool showAll = path.hasAttribute("showall");
if (showAll) {
framework::PartlyXmlStatusReporter xmlReporter(*this, out, path);
+
+ using vespalib::xml::XmlTag;
+ using vespalib::xml::XmlEndTag;
+ using vespalib::xml::XmlAttribute;
+
xmlReporter << vespalib::xml::XmlTag("buckets");
- BucketDBDumper dumper(xmlReporter.getStream());
- _component.getBucketSpaceRepo().forEachBucketChunked(
- dumper, "BucketManager::reportStatus");
- xmlReporter << vespalib::xml::XmlEndTag();
+ for (auto& space : _component.getBucketSpaceRepo()) {
+ xmlReporter << XmlTag("bucket-space")
+ << XmlAttribute("name", spi::FixedBucketSpaces::to_string(space.first));
+ BucketDBDumper dumper(xmlReporter.getStream());
+ _component.getBucketSpaceRepo().get(space.first).bucketDatabase().chunkedAll(
+ dumper, "BucketManager::reportStatus");
+ xmlReporter << XmlEndTag();
+ }
+ xmlReporter << XmlEndTag();
} else {
framework::PartlyHtmlStatusReporter htmlReporter(*this);
htmlReporter.reportHtmlHeader(out, path);
diff --git a/storage/src/vespa/storage/distributor/idealstatemanager.cpp b/storage/src/vespa/storage/distributor/idealstatemanager.cpp
index 031e9946178..d132d0e018c 100644
--- a/storage/src/vespa/storage/distributor/idealstatemanager.cpp
+++ b/storage/src/vespa/storage/distributor/idealstatemanager.cpp
@@ -9,6 +9,7 @@
#include <vespa/storageapi/message/persistence.h>
#include <vespa/storageapi/message/multioperation.h>
#include <vespa/storage/common/bucketmessages.h>
+#include <vespa/persistence/spi/fixed_bucket_spaces.h>
#include <vespa/vespalib/stllike/hash_map.hpp>
#include "distributor_bucket_space_repo.h"
#include "distributor_bucket_space.h"
@@ -246,9 +247,6 @@ IdealStateManager::getBucketStatus(
NodeMaintenanceStatsTracker& statsTracker,
std::ostream& out) const
{
- LOG(debug, "Dumping bucket database valid at cluster state version %u",
- _distributorComponent.getDistributor().getClusterState().getVersion());
-
document::Bucket bucket(bucketSpace, entry.getBucketId());
std::vector<MaintenanceOperation::SP> operations(
generateAll(bucket, statsTracker));
@@ -270,14 +268,22 @@ IdealStateManager::getBucketStatus(
out << "[" << entry->toString() << "]<br>\n";
}
-void
-IdealStateManager::getBucketStatus(std::ostream& out) const
-{
- BucketSpace bucketSpace(BucketSpace::placeHolder());
- StatusBucketVisitor proc(*this, bucketSpace, out);
- auto &distributorBucketSpace(_bucketSpaceRepo.get(bucketSpace));
+void IdealStateManager::dump_bucket_space_db_status(document::BucketSpace bucket_space, std::ostream& out) const {
+ out << "<h2>" << spi::FixedBucketSpaces::to_string(bucket_space) << " - " << bucket_space << "</h2>\n";
+
+ StatusBucketVisitor proc(*this, bucket_space, out);
+ auto &distributorBucketSpace(_bucketSpaceRepo.get(bucket_space));
distributorBucketSpace.getBucketDatabase().forEach(proc);
}
+void IdealStateManager::getBucketStatus(std::ostream& out) const {
+ LOG(debug, "Dumping bucket database valid at cluster state version %u",
+ _distributorComponent.getDistributor().getClusterState().getVersion());
+
+ for (auto& space : _bucketSpaceRepo) {
+ dump_bucket_space_db_status(space.first, out);
+ }
+}
+
} // distributor
} // storage
diff --git a/storage/src/vespa/storage/distributor/idealstatemanager.h b/storage/src/vespa/storage/distributor/idealstatemanager.h
index 028c9cbb0b6..c8be2a40ad7 100644
--- a/storage/src/vespa/storage/distributor/idealstatemanager.h
+++ b/storage/src/vespa/storage/distributor/idealstatemanager.h
@@ -136,6 +136,7 @@ private:
void getBucketStatus(document::BucketSpace bucketSpace, const BucketDatabase::Entry& entry,
NodeMaintenanceStatsTracker& statsTracker, std::ostream& out) const;
+ void dump_bucket_space_db_status(document::BucketSpace bucket_space, std::ostream& out) const;
};
}