diff options
author | Eric Wong <e@80x24.org> | 2019-02-27 20:25:36 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-02-27 20:26:21 +0000 |
commit | 7d9b50c3df67d22a289afa31eddcc3a06ddd93cf (patch) | |
tree | 4ed8805ca693bab4bffa9627c48137e2109503f0 | |
parent | 1c8b2e78042d774a199faa18679c22547b13420e (diff) | |
download | public-inbox-7d9b50c3df67d22a289afa31eddcc3a06ddd93cf.tar.gz |
All of our internal epoch rollover calculations are done using the estimated unpacked (and uncompressed) size of the repo. The importer instance needs to check that unpacked size before selecting an epoch when an epoch already has packed data. This bug did not impact the initial mass imports since we only initialize the Import instance once-per-epoch and did not need to take existing epochs into account. Tested manually with -mda on a local clone of LKML Reported-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r-- | lib/PublicInbox/V2Writable.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index 1f17fe21..b1d8095f 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -588,7 +588,9 @@ sub importer { if (defined $latest) { my $git = PublicInbox::Git->new($latest); my $packed_bytes = $git->packed_bytes; - if ($packed_bytes >= $self->{rotate_bytes}) { + my $unpacked_bytes = $packed_bytes / $PACKING_FACTOR; + + if ($unpacked_bytes >= $self->{rotate_bytes}) { $epoch = $max + 1; } else { $self->{epoch_max} = $max; |