Skip to content

Remove or shrink the event search backfill once the backlog drains #3762

Open

Description

@sentry-junior

#3755 adds a heartbeat backfill (chat/conversations/event-search-backfill.ts). It stores missing lexemes and vectors for Conversations with activity in the last 7 days. Most of the work is one-time: history from before the index existed. After that backlog drains, decide whether to remove the backfill or keep a smaller version.

When: after the deploy that ships #3755, once the event_search.backfill span shows app.event_search.backfill.outcome = completed. The backlog counts (app.event_search.backfill.backlog.{conversation,lexeme,vector}.count) should stay near 0.

Check before removing it. The backfill also covers two gaps that keep recurring:

  • A Conversation that was idle for more than 7 days and becomes active again. Its older unindexed history gets indexed only by the backfill. The per-Turn task works newest first, so it reaches that history slowly.
  • A Turn that adds more than 256 vector events or 2,000 lexeme events. The per-Turn task leaves the rest for later Turns.

If the backlog counts stay at 0 apart from these cases, remove these:

  • the heartbeat phase (agent-dispatch/heartbeat.ts);
  • event-search-backfill.ts and its test;
  • the TELEMETRY.md row;
  • the limits parameter of embedConversationEvents and the maxEvents parameter of storeConversationEventLexemes.

The shared lock key (eventIndexLockKey) and the task's lock wait can then return to their previous form. If the recurring gaps are real, keep a smaller backfill that runs less often instead.

via @BYK.

--

View Session [Sentry]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions