user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 1/2] extindex: show mismatches for messages deleted from inbox
  2021-10-18  5:09  5% [PATCH 0/2] fix v2 mirrors of reused Message-IDs Eric Wong
@ 2021-10-18  5:09  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-10-18  5:09 UTC (permalink / raw)
  To: meta

There seems to be a bug in v2 inbox reindexing somewhere...
---
 lib/PublicInbox/ExtSearchIdx.pm | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/lib/PublicInbox/ExtSearchIdx.pm b/lib/PublicInbox/ExtSearchIdx.pm
index f479cf9e1a3f..4b46fa1622ea 100644
--- a/lib/PublicInbox/ExtSearchIdx.pm
+++ b/lib/PublicInbox/ExtSearchIdx.pm
@@ -292,8 +292,8 @@ sub ck_existing { # git->cat_async callback
 
 # is the messages visible in the inbox currently being indexed?
 # return the number if so
-sub cur_ibx_xnum ($$) {
-	my ($req, $bref) = @_;
+sub cur_ibx_xnum ($$;$) {
+	my ($req, $bref, $mismatch) = @_;
 	my $ibx = $req->{ibx} or die 'BUG: current {ibx} missing';
 
 	$req->{eml} = PublicInbox::Eml->new($bref);
@@ -303,6 +303,7 @@ sub cur_ibx_xnum ($$) {
 		my ($id, $prev);
 		while (my $x = $ibx->over->next_by_mid($mid, \$id, \$prev)) {
 			return $x->{num} if $x->{blob} eq $req->{oid};
+			push @$mismatch, $x if $mismatch;
 		}
 	}
 	undef;
@@ -317,8 +318,15 @@ sub index_oid { # git->cat_async callback for 'm'
 		blob => $oid,
 	}, 'PublicInbox::Smsg';
 	$new_smsg->set_bytes($$bref, $size);
-	defined($req->{xnum} = cur_ibx_xnum($req, $bref)) or return;
 	++${$req->{nr}};
+	my $mismatch = [];
+	$req->{xnum} = cur_ibx_xnum($req, $bref, $mismatch) // do {
+		warn "# deleted\n";
+		warn "# mismatch $_->{blob}\n" for @$mismatch;
+		${$req->{latest_cmt}} = $req->{cur_cmt} //
+			die "BUG: {cur_cmt} unset ($oid)\n";
+		return;
+	};
 	do_step($req);
 }
 

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/2] fix v2 mirrors of reused Message-IDs
@ 2021-10-18  5:09  5% Eric Wong
  2021-10-18  5:09  7% ` [PATCH 1/2] extindex: show mismatches for messages deleted from inbox Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2021-10-18  5:09 UTC (permalink / raw)
  To: meta

Eeep! :<

Eric Wong (2):
  extindex: show mismatches for messages deleted from inbox
  v2: mirrors don't clobber msgs w/ reused Message-IDs

 MANIFEST                        |  1 +
 lib/PublicInbox/ExtSearchIdx.pm | 14 ++++++++++---
 lib/PublicInbox/V2Writable.pm   |  7 ++++++-
 t/v2index-late-dupe.t           | 37 +++++++++++++++++++++++++++++++++
 4 files changed, 55 insertions(+), 4 deletions(-)
 create mode 100644 t/v2index-late-dupe.t

^ permalink raw reply	[relevance 5%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-10-18  5:09  5% [PATCH 0/2] fix v2 mirrors of reused Message-IDs Eric Wong
2021-10-18  5:09  7% ` [PATCH 1/2] extindex: show mismatches for messages deleted from inbox Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).