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,AWL,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 6A60F1F609 for ; Sat, 15 Jun 2019 08:47:28 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 11/20] xapcmd: update comments referencing "partitions" Date: Sat, 15 Jun 2019 08:47:07 +0000 Message-Id: <20190615084716.3075-12-e@80x24.org> In-Reply-To: <20190615084716.3075-1-e@80x24.org> References: <20190615084716.3075-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Don't confuse future readers of our code. --- lib/PublicInbox/Xapcmd.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/PublicInbox/Xapcmd.pm b/lib/PublicInbox/Xapcmd.pm index 322d827..5e4ac87 100644 --- a/lib/PublicInbox/Xapcmd.pm +++ b/lib/PublicInbox/Xapcmd.pm @@ -40,7 +40,7 @@ sub commit_changes ($$$) { $over = undef; } - if (!defined($new)) { # culled partition + if (!defined($new)) { # culled shard push @old_part, $old; next; } @@ -359,7 +359,7 @@ sub cpdb ($$) { $new_parts = $opt->{reshard}; defined $new_parts or die 'BUG: got array src w/o --reshard'; - # repartitioning, M:N copy means have full read access + # resharding, M:N copy means have full read access foreach (@$old) { if ($src) { my $sub = Search::Xapian::Database->new($_); @@ -397,7 +397,7 @@ sub cpdb ($$) { my $lc = $src->get_metadata('last_commit'); $dst->set_metadata('last_commit', $lc) if $lc; - # only the first xapian partition (0) gets 'indexlevel' + # only the first xapian shard (0) gets 'indexlevel' if ($new =~ m!(?:xapian[0-9]+|xap[0-9]+/0)\b!) { my $l = $src->get_metadata('indexlevel'); if ($l eq 'medium') { @@ -407,7 +407,7 @@ sub cpdb ($$) { if ($pr_data) { my $tot = $src->get_doccount; - # we can only estimate when repartitioning, + # we can only estimate when resharding, # because removed spam causes slight imbalance my $est = ''; if (defined $cur_part && $new_parts > 1) { @@ -459,7 +459,7 @@ sub new { # http://www.tldp.org/LDP/abs/html/exitcodes.html $SIG{INT} = sub { exit(130) }; $SIG{HUP} = $SIG{PIPE} = $SIG{TERM} = sub { exit(1) }; - my $self = bless {}, $_[0]; # old partition => new (tmp) partition + my $self = bless {}, $_[0]; # old shard => new (WIP) shard $owner{"$self"} = $$; $self; } @@ -481,7 +481,7 @@ sub DESTROY { my $owner_pid = delete $owner{"$self"} or return; return if $owner_pid != $$; foreach my $new (values %$self) { - defined $new or next; # may be undef if repartitioning + defined $new or next; # may be undef if resharding remove_tree($new) unless -d "$new/old"; } done($self); -- EW