$n < 1 ? 1 : $n;
}
-sub count_partitions ($) {
+sub count_shards ($) {
my ($self) = @_;
my $nparts = 0;
my $xpfx = $self->{xpfx};
rotate_bytes => int((1024 * 1024 * 1024) / $PACKING_FACTOR),
last_commit => [], # git repo -> commit
};
- $self->{partitions} = count_partitions($self) || nproc_parts($creat);
+ $self->{partitions} = count_shards($self) || nproc_parts($creat);
bless $self, $class;
}
$over->create;
# xcpdb can change shard count while -watch is idle
- my $nparts = count_partitions($self);
+ my $nparts = count_shards($self);
if ($nparts && $nparts != $self->{partitions}) {
$self->{partitions} = $nparts;
}
if (!$opt->{-coarse_lock}) {
$opt->{-skip_lock} = 1;
- if ($im->can('count_partitions')) {
+ if ($im->can('count_shards')) {
my $pr = $opt->{-progress};
- my $n = $im->count_partitions;
+ my $n = $im->count_shards;
if (defined $new_parts && $n != $new_parts) {
die
"BUG: counted $n shards after resharding to $new_parts";