From 46dfe1e0f3bb05016da14b39b2e35babbba4027a Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Thu, 21 Dec 2023 17:05:30 -0500 Subject: InternalLevel: appending an empty level is a no-op The existing reconstruction logic will occasionally attempt to append an empty level to another empty level, for some reason. While the underlying cause of this needs to be looked into, this special case should prevent shard constructors being called with a shard count of 0 under tiering, reducing the error handling overhead of shard code. --- include/framework/structure/InternalLevel.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/framework') diff --git a/include/framework/structure/InternalLevel.h b/include/framework/structure/InternalLevel.h index e70ed76..ee85cb3 100644 --- a/include/framework/structure/InternalLevel.h +++ b/include/framework/structure/InternalLevel.h @@ -68,6 +68,13 @@ public: * No changes are made to the level provided as an argument. */ void append_level(InternalLevel* level) { + // FIXME: that this is happening probably means that + // something is going terribly wrong earlier in the + // reconstruction logic. + if (level->get_shard_count() == 0) { + return; + } + Shard *shards[level->m_shard_cnt]; for (size_t i=0; im_shard_cnt; i++) { shards[i] = level->m_shards[i].get(); -- cgit v1.2.3