diff options
-rw-r--r-- | storage/src/vespa/storage/distributor/distributor_bucket_space_repo.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/storage/src/vespa/storage/distributor/distributor_bucket_space_repo.cpp b/storage/src/vespa/storage/distributor/distributor_bucket_space_repo.cpp index d5d4accd70a..7dea2e621e1 100644 --- a/storage/src/vespa/storage/distributor/distributor_bucket_space_repo.cpp +++ b/storage/src/vespa/storage/distributor/distributor_bucket_space_repo.cpp @@ -5,6 +5,7 @@ #include <vespa/vdslib/state/cluster_state_bundle.h> #include <vespa/vdslib/state/clusterstate.h> #include <vespa/document/bucket/fixed_bucket_spaces.h> +#include <vespa/vespalib/util/backtrace.h> #include <cassert> #include <vespa/log/log.h> @@ -34,7 +35,10 @@ DistributorBucketSpace & DistributorBucketSpaceRepo::get(BucketSpace bucketSpace) { auto itr = _map.find(bucketSpace); - assert(itr != _map.end()); + if (itr == _map.end()) [[unlikely]] { + LOG(error, "Bucket space %zu does not have a valid mapping. %s", bucketSpace.getId(), vespalib::getStackTrace(0).c_str()); + abort(); + } return *itr->second; } @@ -42,7 +46,10 @@ const DistributorBucketSpace & DistributorBucketSpaceRepo::get(BucketSpace bucketSpace) const { auto itr = _map.find(bucketSpace); - assert(itr != _map.end()); + if (itr == _map.end()) [[unlikely]] { + LOG(error, "Bucket space %zu does not have a valid mapping. %s", bucketSpace.getId(), vespalib::getStackTrace(0).c_str()); + abort(); + } return *itr->second; } |