From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 178F11F518 for ; Wed, 14 Aug 2024 00:16:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1723594606; bh=uzyQXp6GEBsuq1AxoGIwf/CIdpVzWEIaep/5YRqcoH0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oYXeuuIoStVjDR4wN6CMTvYdegfVyBa6qzr6J4XTo6BrWvHyzi0NFaXb/n0FlYTi+ lDEdRCySGtFNpIuzylR9qPrgGoiksNcijSwx/pRfv5+zIN9tXXeU5UDX78+Eusz5QE xAYz6VR7HEQ3xk5ugqHu6M4/PZ/3Td4tnjLP0gHE= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 3/5] v2writable: confess on broken {idx_shards} Date: Wed, 14 Aug 2024 00:16:43 +0000 Message-Id: <20240814001645.395576-4-e@80x24.org> In-Reply-To: <20240814001645.395576-1-e@80x24.org> References: <20240814001645.395576-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: There's a bug in `lei import' introduced in 4ff8e8d21ab5 (lei/store: stop shard workers + cat-file on idle, 2024-04-16) which causes {idx_shards} to not be recreated properly. Hopefully this can help me track it down since it's not easily reproducible. --- lib/PublicInbox/V2Writable.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index 15a73158..dab5e64d 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -90,6 +90,9 @@ sub init_inbox { sub idx_shard ($$) { my ($self, $num) = @_; + use Carp qw(confess); # FIXME: lei_store bug somewhere.. + confess 'BUG: {idx_shards} unset' if !$self->{idx_shards}; + confess 'BUG: {idx_shards} empty' if !@{$self->{idx_shards}}; $self->{idx_shards}->[$num % scalar(@{$self->{idx_shards}})]; }