Skip to content

[BUG] Indexer drops events when the Redis stream's MAXLEN trims unread entries #891

Open

Description

@meshackyaro

Bug Description

The Redis stream used to buffer raw Soroban events is capped with MAXLEN ~ N, and under a burst of on-chain activity, entries are trimmed before the indexer consumer group has read them.

Component

  • Backend
  • Frontend
  • Smart Contract
  • SDK
  • Documentation
  • Other:

Steps to Reproduce

  1. Configure a small MAXLEN for testing.
  2. Produce events faster than the indexer consumes them (simulate a burst).
  3. Check the consumer group's lag versus the stream's actual length.
  4. Confirm some events were trimmed before being read.

Expected Behavior

The stream should be sized (or use a consumer-aware trimming strategy) so unread entries are never trimmed, or there should be a fallback re-sync from the RPC.

Actual Behavior

Under burst load, unread events are trimmed and permanently lost from the indexer's perspective.

Environment

  • Node Version: 20.x
  • OS: Linux / macOS
  • Browser (if applicable): N/A
  • Network (Testnet/Mainnet): Testnet

Error Messages/Logs

N/A — no error output; behavior is incorrect but silent.

Screenshots

N/A — backend/API issue, not applicable.

Additional Context

MAXLEN ~ approximate trimming doesn't account for consumer group read position.

Possible Solution

Switch to XTRIM MINID based on the slowest consumer group's last-delivered ID, or add a periodic reconciliation pass against the RPC as a safety net.

Activity

  1. added
    bug
    priority: high
    difficulty: medium
    on Oct 29, 2026
  2. GangDev6707 commented on Nov 2, 2026

    @GangDev6707

    Hi maintainers,

    I'd like to help resolve this issue. Redis operations or stream consumer pipelines need robust handling around timeouts, atomic ttl expiration, and consumer group pel retention. I plan to audit the redis transaction or pipeline operations to guarantee atomic key creation and ttl assignment and ensure consumer group acknowledgment and stream retention parameters prevent unexpected data loss, followed by propagate configured timeout deadlines cleanly across pipelined commands.

    I'll simulate high-throughput or network delay scenarios to verify bounded memory and zero dropped entries to verify everything passes cleanly.

    Happy to take this on if you can assign it over. Will get a clean PR ready promptly.

  3. ranjan1969x commented on Nov 2, 2026

    @ranjan1969x

    Hello maintainers,

    I reviewed the requirements for Indexer drops events when the Redis stream's MAXLEN trims unread entries. Looking into the issue, redis operations or stream consumer pipelines need robust handling around timeouts, atomic TTL expiration, and consumer group PEL retention. My plan is to audit the redis transaction or pipeline operations to guarantee atomic key creation and ttl assignment, ensure consumer group acknowledgment and stream retention parameters prevent unexpected data loss, and ensure propagate configured timeout deadlines cleanly across pipelined commands.

    For testing, I'll simulate high-throughput or network delay scenarios to verify bounded memory and zero dropped entries.

    Please assign this to me and I'll submit the PR with passing CI.

  4. maxx-GENIUS commented on Nov 6, 2026

    @maxx-GENIUS

    Hey team,

    I reviewed the issue for Indexer drops events when the Redis stream's MAXLEN trims unread entries. Redis operations or stream consumer pipelines need robust handling around timeouts, atomic ttl expiration, and consumer group pel retention.

    Proposed Implementation:

    1. Audit the Redis transaction or pipeline operations to guarantee atomic key creation and TTL assignment.
    2. Ensure consumer group acknowledgment and stream retention parameters prevent unexpected data loss.
    3. Propagate configured timeout deadlines cleanly across pipelined commands.

    Testing & Verification:
    I will simulate high-throughput or network delay scenarios to verify bounded memory and zero dropped entries.

    Please assign this to me and I will deliver a clean PR with passing tests shortly.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdifficulty: mediuminfrastructurepriority: highweb3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions