From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 6B34E1FA01 for ; Mon, 11 Oct 2021 08:06:20 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 3/6] extindex: rename var: active => active_shards Date: Mon, 11 Oct 2021 08:06:17 +0000 Message-Id: <20211011080620.27478-4-e@80x24.org> In-Reply-To: <20211011080620.27478-1-e@80x24.org> References: <20211011080620.27478-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We also have the idea of active inboxes, too, so "active shards" ought to make the purpose of the data structure more obvious. --- lib/PublicInbox/ExtSearchIdx.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/PublicInbox/ExtSearchIdx.pm b/lib/PublicInbox/ExtSearchIdx.pm index 8da98ba44a9a..64cd8641585d 100644 --- a/lib/PublicInbox/ExtSearchIdx.pm +++ b/lib/PublicInbox/ExtSearchIdx.pm @@ -434,7 +434,7 @@ DELETE FROM over WHERE num > 0 AND num NOT IN (SELECT docid FROM xref3) SELECT MIN(num) FROM over WHERE num > 0 EOM $cur // return; # empty - my ($r, $n, %active); + my ($r, $n, %active_shards); $nr = 0; while (1) { $r = $self->{oidx}->dbh->selectcol_arrayref(<<"", undef, $cur); @@ -445,15 +445,15 @@ SELECT num FROM over WHERE num >= ? ORDER BY num ASC LIMIT 10000 for my $i ($cur..($n - 1)) { my $idx = idx_shard($self, $i); $idx->ipc_do('xdb_remove_quiet', $i); - $active{$idx} = $idx; + $active_shards{$idx} = $idx; } $cur = $n + 1; } if (checkpoint_due($sync)) { - for my $idx (values %active) { + for my $idx (values %active_shards) { $nr += $idx->ipc_do('nr_quiet_rm') } - %active = (); + %active_shards = (); reindex_checkpoint($self, $sync); } }