Skip to content

get /api/{cluster}/topic/last-record fails when topic has only a single record #2490

@xhedoja

Description

@xhedoja

The current implementation of getLastRecord in RecordRepository only works if a topic has more than one record. For topics only one record there is, no result because the code does endOffset - 2 and then performs a single poll. If the partition only contains one record, this logic skips it.

Steps to Reproduce:

  • Create a topic with only one partition.
  • Produce a single message to that topic.
  • Call get /api/{cluster}/topic/last-record for said record
  • Empty response returned

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions