diff --git a/bgs/bgs.go b/bgs/bgs.go index 2a2464a0c..eac62775d 100644 --- a/bgs/bgs.go +++ b/bgs/bgs.go @@ -764,8 +764,12 @@ func (bgs *BGS) handleFedEvent(ctx context.Context, host *models.PDS, env *event return nil } + if evt.Rebase { + return fmt.Errorf("rebase was true in event seq:%d,host:%s", evt.Seq, host.Host) + } + // skip the fast path for rebases or if the user is already in the slow path - if evt.Rebase || bgs.Index.Crawler.RepoInSlowPath(ctx, host, u.ID) { + if bgs.Index.Crawler.RepoInSlowPath(ctx, host, u.ID) { rebasesCounter.WithLabelValues(host.Host).Add(1) ai, err := bgs.Index.LookupUser(ctx, u.ID) if err != nil { @@ -787,9 +791,9 @@ func (bgs *BGS) handleFedEvent(ctx context.Context, host *models.PDS, env *event log.Warnw("failed handling event", "err", err, "host", host.Host, "seq", evt.Seq, "repo", u.Did, "prev", stringLink(evt.Prev), "commit", evt.Commit.String()) if errors.Is(err, carstore.ErrRepoBaseMismatch) || ipld.IsNotFound(err) { - ai, err := bgs.Index.LookupUser(ctx, u.ID) - if err != nil { - return fmt.Errorf("failed to look up user (err case): %w", err) + ai, lerr := bgs.Index.LookupUser(ctx, u.ID) + if lerr != nil { + return fmt.Errorf("failed to look up user %s (%d) (err case: %s): %w", u.Did, u.ID, err, lerr) } span.SetAttributes(attribute.Bool("catchup_queue", true)) diff --git a/indexer/indexer.go b/indexer/indexer.go index bd44a3bc0..1eba2275b 100644 --- a/indexer/indexer.go +++ b/indexer/indexer.go @@ -452,7 +452,7 @@ func (ix *Indexer) FetchAndIndexRepo(ctx context.Context, job *crawlWork) error for i, j := range job.catchup { catchupEventsProcessed.Inc() if err := ix.repomgr.HandleExternalUserEvent(ctx, pds.ID, ai.Uid, ai.Did, j.evt.Since, j.evt.Rev, j.evt.Blocks, j.evt.Ops); err != nil { - log.Errorw("buffered event catchup failed", "error", err, "did", ai.Did, "i", i, "jobCount", len(job.catchup)) + log.Errorw("buffered event catchup failed", "error", err, "did", ai.Did, "i", i, "jobCount", len(job.catchup), "seq", j.evt.Seq) resync = true // fall back to a repo sync break }