Skip to content

Validate stored consumer offset range #2730

@hubcio

Description

@hubcio

Prevent storing consumer offsets beyond the partition's actual message range. Applies to both set consumer offset and set consumer group offset — both flow through store_consumer_offset, which resolves the PollingConsumer (Consumer or ConsumerGroup variant) before storing.

What to focus on:

  • Validate offset before store_consumer_offset_base is called — that's the single entry point for both consumer and consumer group offsets
  • Query partition stats (messages_count) to determine max valid offset
  • Handle empty partitions gracefully
  • Add integration tests for boundary cases (both consumer and consumer group paths)

Done when storing an out-of-range offset fails with a descriptive error for both consumer and consumer group offsets.

Open questions:

  • Should we allow offset equal to max_offset + 1 (next message position)? Doer decides, reviewers evaluate
  • Should validation be optional or always enforced? Enforced

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersserveriggy-server related change

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions